Skip to content

Commit 39a4c60

Browse files
authored
Initial commit
0 parents  commit 39a4c60

19 files changed

+2080
-0
lines changed

.cspell.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
3+
"version": "0.2",
4+
"words": ["Bitwarden"],
5+
"flagWords": [],
6+
"ignorePaths": [
7+
".vscode",
8+
"**/.cspell.json",
9+
"**/.git/**",
10+
"**/node_modules/**",
11+
"**/package-lock.json",
12+
"/project-words.txt"
13+
]
14+
}

.editorconfig

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Don't use tabs for indentation.
7+
[*]
8+
indent_size = 4
9+
indent_style = space
10+
tab_width = 4
11+
end_of_line = lf
12+
charset = utf-8
13+
trim_trailing_whitespace = true
14+
insert_final_newline = true
15+
guidelines = 120
16+
17+
# Code files
18+
[*.{cs,csx,vb,vbx}]
19+
indent_size = 4
20+
21+
# Xml project files
22+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
23+
indent_size = 2
24+
25+
# Xml config files
26+
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
27+
indent_size = 2
28+
29+
# JSON files
30+
[*.json]
31+
indent_size = 2
32+
33+
# JS files
34+
[*.{js,ts,scss,html}]
35+
indent_size = 2
36+
37+
[*.{ts}]
38+
quote_type = single
39+
40+
[*.{scss,yml,csproj}]
41+
indent_size = 2
42+
43+
[*.sln]
44+
indent_style = tab
45+
46+
# Dotnet code style settings:
47+
[*.{cs,vb}]
48+
# Sort using and Import directives with System.* appearing first
49+
dotnet_sort_system_directives_first = true
50+
# Avoid "this." and "Me." if not necessary
51+
dotnet_style_qualification_for_field = false:suggestion
52+
dotnet_style_qualification_for_property = false:suggestion
53+
dotnet_style_qualification_for_method = false:suggestion
54+
dotnet_style_qualification_for_event = false:suggestion
55+
56+
# Use language keywords instead of framework type names for type references
57+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
58+
dotnet_style_predefined_type_for_member_access = true:suggestion
59+
60+
# Suggest more modern language features when available
61+
dotnet_style_object_initializer = true:suggestion
62+
dotnet_style_collection_initializer = true:suggestion
63+
dotnet_style_coalesce_expression = true:suggestion
64+
dotnet_style_null_propagation = true:suggestion
65+
dotnet_style_explicit_tuple_names = true:suggestion
66+
67+
# Prefix private members with underscore
68+
dotnet_naming_rule.private_members_with_underscore.symbols = private_fields
69+
dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore
70+
dotnet_naming_rule.private_members_with_underscore.severity = suggestion
71+
72+
dotnet_naming_symbols.private_fields.applicable_kinds = field
73+
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
74+
75+
dotnet_naming_style.prefix_underscore.capitalization = camel_case
76+
dotnet_naming_style.prefix_underscore.required_prefix = _
77+
78+
# Async methods should have "Async" suffix
79+
dotnet_naming_rule.async_methods_end_in_async.symbols = any_async_methods
80+
dotnet_naming_rule.async_methods_end_in_async.style = end_in_async
81+
dotnet_naming_rule.async_methods_end_in_async.severity = suggestion
82+
83+
dotnet_naming_symbols.any_async_methods.applicable_kinds = method
84+
dotnet_naming_symbols.any_async_methods.applicable_accessibilities = *
85+
dotnet_naming_symbols.any_async_methods.required_modifiers = async
86+
87+
dotnet_naming_style.end_in_async.required_prefix =
88+
dotnet_naming_style.end_in_async.required_suffix = Async
89+
dotnet_naming_style.end_in_async.capitalization = pascal_case
90+
dotnet_naming_style.end_in_async.word_separator =
91+
92+
# Obsolete warnings, this should be removed or changed to warning once we address some of the obsolete items.
93+
dotnet_diagnostic.CS0618.severity = suggestion
94+
95+
# Obsolete warnings, this should be removed or changed to warning once we address some of the obsolete items.
96+
dotnet_diagnostic.CS0612.severity = suggestion
97+
98+
# Remove unnecessary using directives https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0005
99+
dotnet_diagnostic.IDE0005.severity = warning
100+
101+
# CSharp code style settings:
102+
[*.cs]
103+
# Prefer "var" everywhere
104+
csharp_style_var_for_built_in_types = true:suggestion
105+
csharp_style_var_when_type_is_apparent = true:suggestion
106+
csharp_style_var_elsewhere = true:suggestion
107+
108+
# Prefer method-like constructs to have a expression-body
109+
csharp_style_expression_bodied_methods = true:none
110+
csharp_style_expression_bodied_constructors = true:none
111+
csharp_style_expression_bodied_operators = true:none
112+
113+
# Prefer property-like constructs to have an expression-body
114+
csharp_style_expression_bodied_properties = true:none
115+
csharp_style_expression_bodied_indexers = true:none
116+
csharp_style_expression_bodied_accessors = true:none
117+
118+
# Suggest more modern language features when available
119+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
120+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
121+
csharp_style_inlined_variable_declaration = true:suggestion
122+
csharp_style_throw_expression = true:suggestion
123+
csharp_style_conditional_delegate_call = true:suggestion
124+
125+
# Newline settings
126+
csharp_new_line_before_open_brace = all
127+
csharp_new_line_before_else = true
128+
csharp_new_line_before_catch = true
129+
csharp_new_line_before_finally = true
130+
csharp_new_line_before_members_in_object_initializers = true
131+
csharp_new_line_before_members_in_anonymous_types = true
132+
133+
# Namespace settings
134+
csharp_style_namespace_declarations = file_scoped:warning
135+
136+
# Switch expression
137+
dotnet_diagnostic.CS8509.severity = error # missing switch case for named enum value
138+
dotnet_diagnostic.CS8524.severity = none # missing switch case for unnamed enum value

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/CODEOWNERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Please sort into logical groups with comment headers. Sort groups in order of specificity.
2+
# For example, default owners should always be the first group.
3+
# Sort lines alphabetically within these groups to avoid accidentally adding duplicates.
4+
#
5+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
6+
7+
# Default file owners
8+
* @bitwarden/tech-leads

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Feature Requests
4+
url: https://community.bitwarden.com/c/feature-requests/
5+
about: Request new features using the Community Forums. Please search existing feature requests before making a new one.
6+
- name: Bitwarden Community Forums
7+
url: https://community.bitwarden.com
8+
about: Please visit the community forums for general community discussion, support and the development roadmap.
9+
- name: Customer Support
10+
url: https://bitwarden.com/contact/
11+
about: Please contact our customer support for account issues and general customer support.
12+
- name: Security Issues
13+
url: https://hackerone.com/bitwarden
14+
about: We use HackerOne to manage security disclosures.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## 🎟️ Tracking
2+
3+
<!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. -->
4+
5+
## 📔 Objective
6+
7+
<!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. -->
8+
9+
## 📸 Screenshots
10+
11+
<!-- Required for any UI changes; delete if not applicable. Use fixed width images for better display. -->
12+
13+
## ⏰ Reminders before review
14+
15+
- Contributor guidelines followed
16+
- All formatters and local linters executed and passed
17+
- Written new unit and / or integration tests where applicable
18+
- Protected functional changes with optionality (feature flags)
19+
- Used internationalization (i18n) for all UI strings
20+
- CI builds passed
21+
- Communicated to DevOps any deployment requirements
22+
- Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team
23+
24+
## 🦮 Reviewer guidelines
25+
26+
<!-- Suggested interactions but feel free to use (or not) as you desire! -->
27+
28+
- 👍 (`:+1:`) or similar for great changes
29+
- 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info
30+
- ❓ (`:question:`) for questions
31+
- 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
32+
- 🎨 (`:art:`) for suggestions / improvements
33+
- ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention
34+
- 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt
35+
- ⛏ (`:pick:`) for minor or nitpick changes

.github/renovate.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["github>bitwarden/renovate-config"],
4+
"enabledManagers": ["cargo", "github-actions", "npm", "nuget"],
5+
"packageRules": [
6+
{
7+
"groupName": "cargo minor",
8+
"matchManagers": ["cargo"],
9+
"matchUpdateTypes": ["minor", "patch"]
10+
},
11+
{
12+
"groupName": "gh minor",
13+
"matchManagers": ["github-actions"],
14+
"matchUpdateTypes": ["minor", "patch"]
15+
},
16+
{
17+
"groupName": "npm minor",
18+
"matchManagers": ["npm"],
19+
"matchUpdateTypes": ["minor", "patch"]
20+
},
21+
{
22+
"groupName": "nuget minor",
23+
"matchManagers": ["nuget"],
24+
"matchUpdateTypes": ["minor", "patch"]
25+
}
26+
]
27+
}

.github/workflows/scan.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Scan
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- "main"
8+
- "rc"
9+
- "hotfix-rc"
10+
pull_request_target:
11+
types: [opened, synchronize]
12+
13+
# TODO: see https://bitwarden.atlassian.net/l/cp/SLtTZJ90 for configuration tips
14+
jobs:
15+
check-run:
16+
name: Check PR run
17+
uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main
18+
19+
sast:
20+
name: SAST scan
21+
runs-on: ubuntu-22.04
22+
needs: check-run
23+
permissions:
24+
contents: read
25+
pull-requests: write
26+
security-events: write
27+
28+
steps:
29+
- name: Check out repo
30+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
31+
with:
32+
ref: ${{ github.event.pull_request.head.sha }}
33+
34+
- name: Scan with Checkmarx
35+
uses: checkmarx/ast-github-action@b74e8d514feae4ad5ad2b43e72590935bd2daf5f # 2.0.39
36+
env:
37+
INCREMENTAL: "${{ contains(github.event_name, 'pull_request') && '--sast-incremental' || '' }}"
38+
with:
39+
project_name: ${{ github.repository }}
40+
cx_tenant: ${{ secrets.CHECKMARX_TENANT }}
41+
base_uri: https://ast.checkmarx.net/
42+
cx_client_id: ${{ secrets.CHECKMARX_CLIENT_ID }}
43+
cx_client_secret: ${{ secrets.CHECKMARX_SECRET }}
44+
additional_params: |
45+
--report-format sarif \
46+
--filter "state=TO_VERIFY;PROPOSED_NOT_EXPLOITABLE;CONFIRMED;URGENT" \
47+
--output-path . ${{ env.INCREMENTAL }}
48+
49+
- name: Upload Checkmarx results to GitHub
50+
uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6
51+
with:
52+
sarif_file: cx_result.sarif
53+
54+
quality:
55+
name: Quality scan
56+
runs-on: ubuntu-22.04
57+
needs: check-run
58+
permissions:
59+
contents: read
60+
pull-requests: write
61+
62+
steps:
63+
- name: Check out repo
64+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
65+
with:
66+
fetch-depth: 0
67+
ref: ${{ github.event.pull_request.head.sha }}
68+
69+
- name: Scan with SonarCloud
70+
uses: sonarsource/sonarcloud-github-action@02ef91109b2d589e757aefcfb2854c2783fd7b19 # v4.0.0
71+
env:
72+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
with:
75+
args: >
76+
-Dsonar.organization=${{ github.repository_owner }}
77+
-Dsonar.projectKey=${{ github.repository_owner }}_${{ github.event.repository.name }}

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# General
2+
.DS_Store
3+
Thumbs.db
4+
5+
# IDEs and editors
6+
.idea/
7+
.project
8+
.classpath
9+
.c9/
10+
*.launch
11+
.settings/
12+
*.sublime-workspace
13+
14+
# Visual Studio Code
15+
.vscode/*
16+
!.vscode/settings.json
17+
!.vscode/tasks.json
18+
!.vscode/launch.json
19+
!.vscode/extensions.json
20+
.history/*
21+
22+
# Node
23+
node_modules
24+
npm-debug.log

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# How to Contribute
2+
3+
Our [Contributing Guidelines](https://contributing.bitwarden.com/contributing/) are located in our [Contributing Documentation](https://contributing.bitwarden.com/). The documentation also includes recommended tooling, code style tips, and lots of other great information to get you started.

LICENSE.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Source code in this repository is covered by one of two licenses: (i) the
2+
GNU General Public License (GPL) v3.0 (ii) the Bitwarden License v1.0. The
3+
default license throughout the repository is GPL v3.0 unless the header
4+
specifies another license. Bitwarden Licensed code is found only in the
5+
/bitwarden_license directory.
6+
7+
GPL v3.0:
8+
https://github.com/bitwarden/server/blob/main/LICENSE_GPL.txt
9+
10+
Bitwarden License v1.0:
11+
https://github.com/bitwarden/server/blob/main/LICENSE_BITWARDEN.txt
12+
13+
No grant of any rights in the trademarks, service marks, or logos of Bitwarden is
14+
made (except as may be necessary to comply with the notice requirements as
15+
applicable), and use of any Bitwarden trademarks must comply with Bitwarden
16+
Trademark Guidelines
17+
<https://github.com/bitwarden/server/blob/main/TRADEMARK_GUIDELINES.md>.

0 commit comments

Comments
 (0)