Skip to content

Commit

Permalink
Merge branch 'master' into SM-989-create-build-and-publish-pipelines-…
Browse files Browse the repository at this point in the history
…for-the-python-language-wrapper
  • Loading branch information
tangowithfoxtrot committed Nov 30, 2023
1 parent ee2ce66 commit b238851
Show file tree
Hide file tree
Showing 76 changed files with 2,580 additions and 203 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/generate_schemas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ jobs:
path: ${{ github.workspace }}/support/schemas/*
if-no-files-found: error

- name: Upload Go schemas artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: schemas.go
path: ${{ github.workspace }}/languages/go/schema.go

- name: Upload java schemas artifact
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/golang-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Go Release

on:
workflow_dispatch:
inputs:
version_number:
description: "New Version"
required: true

env:
GO111MODULE: on
GO_VERSION: "^1.18"

jobs:
build_rust:
uses: ./.github/workflows/build-rust-cross-platform.yml

generate-schemas:
uses: ./.github/workflows/generate_schemas.yml

build:
name: Build
needs:
- build_rust
- generate-schemas
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup Go environment
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ env.GO_VERSION }}

- name: Cache dependencies
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...

release:
name: Release
needs: build
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup Go environment
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ env.GO_VERSION }}

- name: Set release version
run: echo "VERSION=${{ github.event.inputs.version_number }}" >> $GITHUB_ENV

- name: Install Goreleaser
run: go install github.com/goreleaser/[email protected]

- name: Run Goreleaser
run: goreleaser release --rm-dist --skip-validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ env.VERSION }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/target
.DS_Store
.pytest_cache
.vscode/c_cpp_properties.json

# Build results
[Dd]ebug/
Expand Down Expand Up @@ -49,4 +50,6 @@ crates/bitwarden-napi/src-ts/bitwarden_client/schemas.ts
languages/csharp/Bitwarden.Sdk/schemas.cs
languages/js_webassembly/bitwarden_client/schemas.ts
languages/python/bitwarden_sdk/schemas.py
languages/cpp/include/schemas.hpp
languages/go/schema.go
languages/java/src/main/java/com/bitwarden/sdk/schema
63 changes: 44 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ codegen-units = 1

# Using git dependency temporarily to add support for immutable records in generated code
[patch.crates-io]
uniffi = { git = "https://github.com/mozilla/uniffi-rs", rev = "0a03b713306d6ce3de033157fc2ce92a238c2e24" }
uniffi_build = { git = "https://github.com/mozilla/uniffi-rs", rev = "0a03b713306d6ce3de033157fc2ce92a238c2e24" }
uniffi_bindgen = { git = "https://github.com/mozilla/uniffi-rs", rev = "0a03b713306d6ce3de033157fc2ce92a238c2e24" }
uniffi_core = { git = "https://github.com/mozilla/uniffi-rs", rev = "0a03b713306d6ce3de033157fc2ce92a238c2e24" }
uniffi_macros = { git = "https://github.com/mozilla/uniffi-rs", rev = "0a03b713306d6ce3de033157fc2ce92a238c2e24" }
uniffi = { git = "https://github.com/mozilla/uniffi-rs", rev = "23711c8151bbb794369aa1f9d383db386792dff9" }
uniffi_build = { git = "https://github.com/mozilla/uniffi-rs", rev = "23711c8151bbb794369aa1f9d383db386792dff9" }
uniffi_bindgen = { git = "https://github.com/mozilla/uniffi-rs", rev = "23711c8151bbb794369aa1f9d383db386792dff9" }
uniffi_core = { git = "https://github.com/mozilla/uniffi-rs", rev = "23711c8151bbb794369aa1f9d383db386792dff9" }
uniffi_macros = { git = "https://github.com/mozilla/uniffi-rs", rev = "23711c8151bbb794369aa1f9d383db386792dff9" }
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,31 +57,31 @@ The first step is to generate the swagger documents from the server repository.

```bash
# src/Api
dotnet swagger tofile --output ../../api.json .\bin\Debug\net6.0\Api.dll internal
dotnet swagger tofile --output ../../api.json ./bin/Debug/net6.0/Api.dll internal

# src/Identity
dotnet swagger tofile --output ../../identity.json .\bin\Debug\net6.0\Identity.dll v1
ASPNETCORE_ENVIRONMENT=development dotnet swagger tofile --output ../../identity.json ./bin/Debug/net6.0/Identity.dll v1
```

### OpenApi Generator

Runs from the root of the SDK project.

```bash
npx openapi-generator-cli generate `
-i ../server/api.json `
-g rust `
-o crates/bitwarden-api-api `
--package-name bitwarden-api-api `
-t ./support/openapi-template `
npx openapi-generator-cli generate \
-i ../server/api.json \
-g rust \
-o crates/bitwarden-api-api \
--package-name bitwarden-api-api \
-t ./support/openapi-template \
--additional-properties=packageVersion=1.0.0

npx openapi-generator-cli generate `
-i ../server/identity.json `
-g rust `
-o crates/bitwarden-api-identity `
--package-name bitwarden-api-identity `
-t ./support/openapi-template `
npx openapi-generator-cli generate \
-i ../server/identity.json \
-g rust \
-o crates/bitwarden-api-identity \
--package-name bitwarden-api-identity \
-t ./support/openapi-template \
--additional-properties=packageVersion=1.0.0
```

Expand Down
11 changes: 9 additions & 2 deletions crates/bitwarden-api-api/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ src/models/authenticator_attestation_raw_response.rs
src/models/base_access_policy_response_model.rs
src/models/base_secret_response_model.rs
src/models/base_secret_response_model_list_response_model.rs
src/models/billing_customer_discount.rs
src/models/billing_history_response_model.rs
src/models/billing_invoice.rs
src/models/billing_payment_response_model.rs
Expand Down Expand Up @@ -122,6 +123,7 @@ src/models/collection_with_id_request_model.rs
src/models/config_response_model.rs
src/models/delete_recover_request_model.rs
src/models/device_keys_request_model.rs
src/models/device_keys_update_request_model.rs
src/models/device_request_model.rs
src/models/device_response_model.rs
src/models/device_response_model_list_response_model.rs
Expand Down Expand Up @@ -201,10 +203,10 @@ src/models/organization_domain_response_model.rs
src/models/organization_domain_response_model_list_response_model.rs
src/models/organization_domain_sso_details_request_model.rs
src/models/organization_domain_sso_details_response_model.rs
src/models/organization_enroll_secrets_manager_request_model.rs
src/models/organization_keys_request_model.rs
src/models/organization_keys_response_model.rs
src/models/organization_license.rs
src/models/organization_public_key_response_model.rs
src/models/organization_response_model.rs
src/models/organization_seat_request_model.rs
src/models/organization_sponsorship_create_request_model.rs
Expand Down Expand Up @@ -241,6 +243,7 @@ src/models/organization_user_update_request_model.rs
src/models/organization_user_user_details_response_model.rs
src/models/organization_user_user_details_response_model_list_response_model.rs
src/models/organization_verify_bank_request_model.rs
src/models/other_device_keys_update_request_model.rs
src/models/password_hint_request_model.rs
src/models/password_request_model.rs
src/models/payment_method_type.rs
Expand Down Expand Up @@ -272,6 +275,7 @@ src/models/project_create_request_model.rs
src/models/project_response_model.rs
src/models/project_response_model_list_response_model.rs
src/models/project_update_request_model.rs
src/models/protected_device_response_model.rs
src/models/provider_organization_add_request_model.rs
src/models/provider_organization_create_request_model.rs
src/models/provider_organization_organization_details_response_model.rs
Expand Down Expand Up @@ -316,6 +320,7 @@ src/models/secret_update_request_model.rs
src/models/secret_verification_request_model.rs
src/models/secret_with_projects_inner_project.rs
src/models/secret_with_projects_list_response_model.rs
src/models/secrets_manager_subscribe_request_model.rs
src/models/secrets_manager_subscription_update_request_model.rs
src/models/secrets_with_projects_inner_secret.rs
src/models/secure_note_type.rs
Expand All @@ -337,7 +342,8 @@ src/models/service_account_create_request_model.rs
src/models/service_account_project_access_policy_response_model.rs
src/models/service_account_project_access_policy_response_model_list_response_model.rs
src/models/service_account_response_model.rs
src/models/service_account_response_model_list_response_model.rs
src/models/service_account_secrets_details_response_model.rs
src/models/service_account_secrets_details_response_model_list_response_model.rs
src/models/service_account_update_request_model.rs
src/models/set_key_connector_key_request_model.rs
src/models/set_password_request_model.rs
Expand Down Expand Up @@ -370,6 +376,7 @@ src/models/two_factor_web_authn_request_model.rs
src/models/two_factor_web_authn_response_model.rs
src/models/two_factor_yubi_key_response_model.rs
src/models/update_avatar_request_model.rs
src/models/update_devices_trust_request_model.rs
src/models/update_domains_request_model.rs
src/models/update_key_request_model.rs
src/models/update_profile_request_model.rs
Expand Down
Loading

0 comments on commit b238851

Please sign in to comment.