Skip to content

Commit d7431f4

Browse files
Merge branch 'main' into auth/pm-30810/http-redirect-cloud
2 parents 36a5a4b + 902be7d commit d7431f4

File tree

459 files changed

+51158
-3972
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

459 files changed

+51158
-3972
lines changed

.checkmarx/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ checkmarx:
1111
filter: "!test"
1212
kics:
1313
filter: "!dev,!.devcontainer"
14+
sca:
15+
filter: "!dev,!.devcontainer"
16+
containers:
17+
filter: "!dev,!.devcontainer"

.claude/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extraKnownMarketplaces": {
3+
"bitwarden-marketplace": {
4+
"source": {
5+
"source": "github",
6+
"repo": "bitwarden/ai-plugins"
7+
}
8+
}
9+
}
10+
}

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"swashbuckle.aspnetcore.cli": {
6-
"version": "9.0.4",
6+
"version": "10.1.0",
77
"commands": ["swagger"]
88
},
99
"dotnet-ef": {

.devcontainer/community_dev/devcontainer.json

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
"dockerComposeFile": "../../.devcontainer/bitwarden_common/docker-compose.yml",
44
"service": "bitwarden_server",
55
"workspaceFolder": "/workspace",
6+
"initializeCommand": "mkdir -p dev/.data/keys dev/.data/mssql dev/.data/azurite dev/helpers/mssql",
67
"features": {
78
"ghcr.io/devcontainers/features/node:1": {
8-
"version": "16"
9-
}
9+
"version": "22"
10+
},
11+
"ghcr.io/devcontainers/features/rust:1": {}
1012
},
1113
"mounts": [
1214
{
@@ -21,5 +23,27 @@
2123
"extensions": ["ms-dotnettools.csdevkit"]
2224
}
2325
},
24-
"postCreateCommand": "bash .devcontainer/community_dev/postCreateCommand.sh"
26+
"postCreateCommand": "bash .devcontainer/community_dev/postCreateCommand.sh",
27+
"forwardPorts": [1080, 1433, 3306, 5432],
28+
"portsAttributes": {
29+
"default": {
30+
"onAutoForward": "ignore"
31+
},
32+
"1080": {
33+
"label": "Mail Catcher",
34+
"onAutoForward": "notify"
35+
},
36+
"1433": {
37+
"label": "SQL Server",
38+
"onAutoForward": "notify"
39+
},
40+
"3306": {
41+
"label": "MySQL",
42+
"onAutoForward": "notify"
43+
},
44+
"5432": {
45+
"label": "PostgreSQL",
46+
"onAutoForward": "notify"
47+
}
48+
}
2549
}

.devcontainer/community_dev/postCreateCommand.sh

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,46 @@ export DEV_DIR=/workspace/dev
33
export CONTAINER_CONFIG=/workspace/.devcontainer/community_dev
44
git config --global --add safe.directory /workspace
55

6+
if [[ -z "${CODESPACES}" ]]; then
7+
allow_interactive=1
8+
else
9+
echo "Doing non-interactive setup"
10+
allow_interactive=0
11+
fi
12+
13+
get_option() {
14+
# Helper function for reading the value of an environment variable
15+
# primarily but then falling back to an interactive question if allowed
16+
# and lastly falling back to a default value input when either other
17+
# option is available.
18+
name_of_var="$1"
19+
question_text="$2"
20+
default_value="$3"
21+
is_secret="$4"
22+
23+
if [[ -n "${!name_of_var}" ]]; then
24+
# If the env variable they gave us has a value, then use that value
25+
echo "${!name_of_var}"
26+
elif [[ "$allow_interactive" == 1 ]]; then
27+
# If we can be interactive, then use the text they gave us to request input
28+
if [[ "$is_secret" == 1 ]]; then
29+
read -r -s -p "$question_text" response
30+
echo "$response"
31+
else
32+
read -r -p "$question_text" response
33+
echo "$response"
34+
fi
35+
else
36+
# If no environment variable and not interactive, then just give back default value
37+
echo "$default_value"
38+
fi
39+
}
40+
641
get_installation_id_and_key() {
742
pushd ./dev >/dev/null || exit
843
echo "Please enter your installation id and key from https://bitwarden.com/host:"
9-
read -r -p "Installation id: " INSTALLATION_ID
10-
read -r -p "Installation key: " INSTALLATION_KEY
44+
INSTALLATION_ID="$(get_option "INSTALLATION_ID" "Installation id: " "00000000-0000-0000-0000-000000000001")"
45+
INSTALLATION_KEY="$(get_option "INSTALLATION_KEY" "Installation key: " "" 1)"
1146
jq ".globalSettings.installation.id = \"$INSTALLATION_ID\" |
1247
.globalSettings.installation.key = \"$INSTALLATION_KEY\"" \
1348
secrets.json.example >secrets.json # create/overwrite secrets.json
@@ -30,11 +65,10 @@ configure_other_vars() {
3065
}
3166

3267
one_time_setup() {
33-
read -r -p \
34-
"Would you like to configure your secrets and certificates for the first time?
68+
do_secrets_json_setup="$(get_option "SETUP_SECRETS_JSON" "Would you like to configure your secrets and certificates for the first time?
3569
WARNING: This will overwrite any existing secrets.json and certificate files.
36-
Proceed? [y/N] " response
37-
if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
70+
Proceed? [y/N] " "n")"
71+
if [[ "$do_secrets_json_setup" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
3872
echo "Running one-time setup script..."
3973
sleep 1
4074
get_installation_id_and_key
@@ -50,11 +84,4 @@ Proceed? [y/N] " response
5084
fi
5185
}
5286

53-
# main
54-
if [[ -z "${CODESPACES}" ]]; then
55-
one_time_setup
56-
else
57-
# Ignore interactive elements when running in codespaces since they are not supported there
58-
# TODO Write codespaces specific instructions and link here
59-
echo "Running in codespaces, follow instructions here: https://contributing.bitwarden.com/getting-started/server/guide/ to continue the setup"
60-
fi
87+
one_time_setup

.devcontainer/internal_dev/devcontainer.json

Lines changed: 79 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
],
77
"service": "bitwarden_server",
88
"workspaceFolder": "/workspace",
9+
"initializeCommand": "mkdir -p dev/.data/keys dev/.data/mssql dev/.data/azurite dev/helpers/mssql",
910
"features": {
1011
"ghcr.io/devcontainers/features/node:1": {
11-
"version": "16"
12-
}
12+
"version": "22"
13+
},
14+
"ghcr.io/devcontainers/features/rust:1": {}
1315
},
1416
"mounts": [
1517
{
@@ -24,9 +26,18 @@
2426
"extensions": ["ms-dotnettools.csdevkit"]
2527
}
2628
},
29+
"onCreateCommand": "bash .devcontainer/internal_dev/onCreateCommand.sh",
2730
"postCreateCommand": "bash .devcontainer/internal_dev/postCreateCommand.sh",
28-
"forwardPorts": [1080, 1433, 3306, 5432, 10000, 10001, 10002],
31+
"forwardPorts": [
32+
1080, 1433, 3306, 5432, 10000, 10001, 10002,
33+
4000, 4001, 33656, 33657, 44519, 44559,
34+
46273, 46274, 50024, 51822, 51823,
35+
54103, 61840, 61841, 62911, 62912
36+
],
2937
"portsAttributes": {
38+
"default": {
39+
"onAutoForward": "ignore"
40+
},
3041
"1080": {
3142
"label": "Mail Catcher",
3243
"onAutoForward": "notify"
@@ -48,12 +59,76 @@
4859
"onAutoForward": "notify"
4960
},
5061
"10001": {
51-
"label": "Azurite Storage Queue ",
62+
"label": "Azurite Storage Queue",
5263
"onAutoForward": "notify"
5364
},
5465
"10002": {
5566
"label": "Azurite Storage Table",
5667
"onAutoForward": "notify"
68+
},
69+
"4000": {
70+
"label": "Api (Cloud)",
71+
"onAutoForward": "notify"
72+
},
73+
"4001": {
74+
"label": "Api (SelfHost)",
75+
"onAutoForward": "notify"
76+
},
77+
"33656": {
78+
"label": "Identity (Cloud)",
79+
"onAutoForward": "notify"
80+
},
81+
"33657": {
82+
"label": "Identity (SelfHost)",
83+
"onAutoForward": "notify"
84+
},
85+
"44519": {
86+
"label": "Billing",
87+
"onAutoForward": "notify"
88+
},
89+
"44559": {
90+
"label": "Scim",
91+
"onAutoForward": "notify"
92+
},
93+
"46273": {
94+
"label": "Events (Cloud)",
95+
"onAutoForward": "notify"
96+
},
97+
"46274": {
98+
"label": "Events (SelfHost)",
99+
"onAutoForward": "notify"
100+
},
101+
"50024": {
102+
"label": "Icons",
103+
"onAutoForward": "notify"
104+
},
105+
"51822": {
106+
"label": "Sso (Cloud)",
107+
"onAutoForward": "notify"
108+
},
109+
"51823": {
110+
"label": "Sso (SelfHost)",
111+
"onAutoForward": "notify"
112+
},
113+
"54103": {
114+
"label": "EventsProcessor",
115+
"onAutoForward": "notify"
116+
},
117+
"61840": {
118+
"label": "Notifications (Cloud)",
119+
"onAutoForward": "notify"
120+
},
121+
"61841": {
122+
"label": "Notifications (SelfHost)",
123+
"onAutoForward": "notify"
124+
},
125+
"62911": {
126+
"label": "Admin (Cloud)",
127+
"onAutoForward": "notify"
128+
},
129+
"62912": {
130+
"label": "Admin (SelfHost)",
131+
"onAutoForward": "notify"
57132
}
58133
}
59134
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
export REPO_ROOT="$(git rev-parse --show-toplevel)"
3+
4+
file="$REPO_ROOT/dev/custom-root-ca.crt"
5+
6+
if [ -e "$file" ]; then
7+
echo "Adding custom root CA"
8+
sudo cp "$file" /usr/local/share/ca-certificates/
9+
sudo update-ca-certificates
10+
else
11+
echo "No custom root CA found, skipping..."
12+
fi

.devcontainer/internal_dev/postCreateCommand.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Press <Enter> to continue."
108108
fi
109109

110110
run_mssql_migrations="$(get_option "RUN_MSSQL_MIGRATIONS" "Would you like us to run MSSQL Migrations for you? [y/N] " "n")"
111-
if [[ "$do_azurite_setup" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
111+
if [[ "$run_mssql_migrations" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
112112
echo "Running migrations..."
113113
sleep 5 # wait for DB container to start
114114
dotnet run --project "$REPO_ROOT/util/MsSqlMigratorUtility" "$SQL_CONNECTION_STRING"

.github/CODEOWNERS

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
**/docker-compose.yml @bitwarden/team-appsec @bitwarden/dept-bre
1212
**/entrypoint.sh @bitwarden/team-appsec @bitwarden/dept-bre
1313

14+
# Scanning tools
15+
.checkmarx/ @bitwarden/team-appsec
16+
1417
## BRE team owns these workflows ##
1518
.github/workflows/publish.yml @bitwarden/dept-bre
1619

@@ -94,9 +97,7 @@ src/Admin/Views/Tools @bitwarden/team-billing-dev
9497
.github/workflows/test-database.yml @bitwarden/team-platform-dev
9598
.github/workflows/test.yml @bitwarden/team-platform-dev
9699
**/*Platform* @bitwarden/team-platform-dev
97-
**/.dockerignore @bitwarden/team-platform-dev
98-
**/Dockerfile @bitwarden/team-platform-dev
99-
**/entrypoint.sh @bitwarden/team-platform-dev
100+
100101
# The PushType enum is expected to be editted by anyone without need for Platform review
101102
src/Core/Platform/Push/PushType.cs
102103

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,3 @@
99
## 📸 Screenshots
1010

1111
<!-- 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

0 commit comments

Comments
 (0)