Skip to content

Commit e65a3d4

Browse files
committed
Merge branch 'km/beeep/safe-password-protected-key-envelope' of github.com:bitwarden/sdk-internal into km/beeep/safe-password-protected-key-envelope
2 parents 8ff72f3 + f685b35 commit e65a3d4

File tree

154 files changed

+10919
-1691
lines changed

Some content is hidden

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

154 files changed

+10919
-1691
lines changed

.github/workflows/build-android.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ jobs:
7171
fetch-depth: 0
7272
ref: ${{ github.event.pull_request.head.ref }}
7373

74-
- name: Checkout repo (Push)
74+
- name: Checkout repo (Push or manual run)
7575
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
76-
if: github.event_name == 'push'
76+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
7777
with:
7878
fetch-depth: 0
7979

.github/workflows/scan.yml

Lines changed: 14 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -26,100 +26,30 @@ jobs:
2626
contents: read
2727

2828
sast:
29-
name: SAST scan
30-
runs-on: ubuntu-24.04
29+
name: Checkmarx
30+
uses: bitwarden/gh-actions/.github/workflows/_checkmarx.yml@main
3131
needs: check-run
32+
secrets:
33+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
34+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
35+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
3236
permissions:
3337
contents: read
3438
pull-requests: write
3539
security-events: write
3640
id-token: write
3741

38-
steps:
39-
- name: Check out repo
40-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
41-
with:
42-
ref: ${{ github.event.pull_request.head.sha }}
43-
44-
- name: Log in to Azure
45-
uses: bitwarden/gh-actions/azure-login@main
46-
with:
47-
subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
48-
tenant_id: ${{ secrets.AZURE_TENANT_ID }}
49-
client_id: ${{ secrets.AZURE_CLIENT_ID }}
50-
51-
- name: Get Azure Key Vault secrets
52-
id: get-kv-secrets
53-
uses: bitwarden/gh-actions/get-keyvault-secrets@main
54-
with:
55-
keyvault: gh-org-bitwarden
56-
secrets: "CHECKMARX-TENANT,CHECKMARX-CLIENT-ID,CHECKMARX-SECRET"
57-
58-
- name: Log out from Azure
59-
uses: bitwarden/gh-actions/azure-logout@main
60-
61-
- name: Scan with Checkmarx
62-
uses: checkmarx/ast-github-action@9fda4ab4c1b67c35de380552a972a82997d97731 # 2.0.42
63-
env:
64-
INCREMENTAL: "${{ contains(github.event_name, 'pull_request') && '--sast-incremental' || '' }}"
65-
with:
66-
project_name: ${{ github.repository }}
67-
cx_tenant: ${{ steps.get-kv-secrets.outputs.CHECKMARX-TENANT }}
68-
base_uri: https://ast.checkmarx.net/
69-
cx_client_id: ${{ steps.get-kv-secrets.outputs.CHECKMARX-CLIENT-ID }}
70-
cx_client_secret: ${{ steps.get-kv-secrets.outputs.CHECKMARX-SECRET }}
71-
additional_params: |
72-
--report-format sarif \
73-
--filter "state=TO_VERIFY;PROPOSED_NOT_EXPLOITABLE;CONFIRMED;URGENT" \
74-
--output-path . ${{ env.INCREMENTAL }}
75-
76-
- name: Upload Checkmarx results to GitHub
77-
uses: github/codeql-action/upload-sarif@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
78-
with:
79-
sarif_file: cx_result.sarif
80-
sha: ${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.sha || github.sha }}
81-
ref: ${{ contains(github.event_name, 'pull_request') && format('refs/pull/{0}/head', github.event.pull_request.number) || github.ref }}
82-
8342
quality:
84-
name: Quality scan
85-
runs-on: ubuntu-24.04
43+
name: Sonar
44+
uses: bitwarden/gh-actions/.github/workflows/_sonar.yml@main
8645
needs: check-run
46+
secrets:
47+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
48+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
49+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
8750
permissions:
8851
contents: read
8952
pull-requests: write
9053
id-token: write
91-
92-
steps:
93-
- name: Check out repo
94-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
95-
with:
96-
fetch-depth: 0
97-
ref: ${{ github.event.pull_request.head.sha }}
98-
99-
- name: Log in to Azure
100-
uses: bitwarden/gh-actions/azure-login@main
101-
with:
102-
subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
103-
tenant_id: ${{ secrets.AZURE_TENANT_ID }}
104-
client_id: ${{ secrets.AZURE_CLIENT_ID }}
105-
106-
- name: Get Azure Key Vault secrets
107-
id: get-kv-secrets
108-
uses: bitwarden/gh-actions/get-keyvault-secrets@main
109-
with:
110-
keyvault: gh-org-bitwarden
111-
secrets: "SONAR-TOKEN"
112-
113-
- name: Log out from Azure
114-
uses: bitwarden/gh-actions/azure-logout@main
115-
116-
- name: Scan with SonarCloud
117-
uses: sonarsource/sonarqube-scan-action@2500896589ef8f7247069a56136f8dc177c27ccf # v5.2.0
118-
env:
119-
SONAR_TOKEN: ${{ steps.get-kv-secrets.outputs.SONAR-TOKEN }}
120-
with:
121-
args: >
122-
-Dsonar.organization=${{ github.repository_owner }}
123-
-Dsonar.projectKey=${{ github.repository_owner }}_${{ github.event.repository.name }}
124-
-Dsonar.exclusions=crates/bitwarden-uniffi/kotlin/**,crates/bitwarden-uniffi/swift/**
125-
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
54+
with:
55+
sonar-exclusions: "crates/bitwarden-uniffi/kotlin/**,crates/bitwarden-uniffi/swift/**"

Cargo.lock

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ bitwarden-api-api = { path = "crates/bitwarden-api-api", version = "=1.0.0" }
2323
bitwarden-api-identity = { path = "crates/bitwarden-api-identity", version = "=1.0.0" }
2424
bitwarden-auth = { path = "crates/bitwarden-auth", version = "=1.0.0" }
2525
bitwarden-cli = { path = "crates/bitwarden-cli", version = "=1.0.0" }
26+
bitwarden-collections = { path = "crates/bitwarden-collections", version = "=1.0.0" }
2627
bitwarden-core = { path = "crates/bitwarden-core", version = "=1.0.0" }
2728
bitwarden-crypto = { path = "crates/bitwarden-crypto", version = "=1.0.0" }
2829
bitwarden-error = { path = "crates/bitwarden-error", version = "=1.0.0" }

README.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,20 @@ You can also browse the latest published documentation:
5252
The project is structured as a monorepo using cargo workspaces. Some of the more noteworthy crates
5353
are:
5454

55-
- [`bitwarden-api-api`](./crates/bitwarden-api-api/): Auto-generated API bindings for the API
56-
server.
57-
- [`bitwarden-api-identity`](./crates/bitwarden-api-identity/): Auto-generated API bindings for the
55+
- [`bitwarden-api-api`](./crates/bitwarden-api-api): Auto-generated API bindings for the API server.
56+
- [`bitwarden-api-identity`](./crates/bitwarden-api-identity): Auto-generated API bindings for the
5857
Identity server.
59-
- [`bitwarden-core`](./crates/bitwarden-core/): The core functionality consumed by the other crates.
60-
- [`bitwarden-crypto`](./crates/bitwarden-crypto/): Crypto library.
61-
- [`bitwarden-wasm-internal`](./crates/bitwarden-wasm-internal/): WASM bindings for the internal
62-
SDK.
63-
- [`bitwarden-uniffi`](./crates/bitwarden-uniffi/): Mobile bindings for swift and kotlin using
58+
- [`bitwarden-core`](./crates/bitwarden-core): The core functionality consumed by the other crates.
59+
- [`bitwarden-crypto`](./crates/bitwarden-crypto): Crypto library.
60+
- [`bitwarden-wasm-internal`](./crates/bitwarden-wasm-internal): WASM bindings for the internal SDK.
61+
- [`bitwarden-uniffi`](./crates/bitwarden-uniffi): Mobile bindings for swift and kotlin using
6462
[UniFFI](https://github.com/mozilla/uniffi-rs/).
6563

6664
## API Bindings
6765

68-
We autogenerate the server bindings using
69-
[openapi-generator](https://github.com/OpenAPITools/openapi-generator). To do this we first need to
70-
build the internal swagger documentation.
66+
We autogenerate the server bindings
67+
using[openapi-generator](https://github.com/OpenAPITools/openapi-generator). To do this, we first
68+
need to build the internal swagger documentation.
7169

7270
### Swagger generation
7371

@@ -83,15 +81,16 @@ ASPNETCORE_ENVIRONMENT=development dotnet swagger tofile --output ../../identity
8381

8482
### OpenApi Generator
8583

86-
To generate a new version of the bindings run the following script from the root of the SDK project.
84+
To generate a new version of the bindings, run the following script from the root of the SDK
85+
project.
8786

8887
```bash
8988
./support/build-api.sh
9089
```
9190

92-
This project uses customized templates which lives in the `support/openapi-templates` directory.
93-
These templates resolves some outstanding issues we've experienced with the rust generator. But we
94-
strive towards modifying the templates as little as possible to ease future upgrades.
91+
This project uses customized templates that live in the `support/openapi-templates` directory. These
92+
templates resolve some outstanding issues we've experienced with the rust generator. But we strive
93+
towards modifying the templates as little as possible to ease future upgrades.
9594

9695
### Note
9796

@@ -102,9 +101,9 @@ strive towards modifying the templates as little as possible to ease future upgr
102101

103102
## Developer tools
104103

105-
This project recommends the use of certain developer tools, and also includes configurations for
106-
them to make developers lives easier. The use of these tools is optional and they might require a
107-
separate installation step.
104+
This project recommends the use of certain developer tools and includes configurations for them to
105+
make developers' lives easier. The use of these tools is optional, and they might require a separate
106+
installation step.
108107

109108
The list of developer tools is:
110109

@@ -122,11 +121,11 @@ The list of developer tools is:
122121
## Formatting & Linting
123122

124123
This repository uses various tools to check formatting and linting before it's merged. It's
125-
recommended to run the checks prior to submitting a PR.
124+
recommended to run the checks before submitting a PR.
126125

127126
### Installation
128127

129-
Please see the [lint.yml](./.github/workflows/lint.yml) file for example installation commands &
128+
Please see the [lint.yml](./.github/workflows/lint.yml) file, for example, installation commands and
130129
versions. Here are the cli tools we use:
131130

132131
- Nightly [cargo fmt](https://github.com/rust-lang/rustfmt) and

0 commit comments

Comments
 (0)