Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion crates/bitwarden-api-api/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ src/apis/organization_reports_api.rs
src/apis/organization_sponsorships_api.rs
src/apis/organization_users_api.rs
src/apis/organizations_api.rs
src/apis/phishing_domains_api.rs
src/apis/plans_api.rs
src/apis/policies_api.rs
src/apis/projects_api.rs
Expand Down
33 changes: 15 additions & 18 deletions crates/bitwarden-api-api/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
# Rust API client for bitwarden-api-api

No description provided (generated by Openapi Generator
https://github.com/openapitools/openapi-generator)
## Updating bindings after a server API change

## Overview
When a server API change is made, new bindings will need to be generated to reflect this change for
consumption in the SDK.

This can be done the following ways:

1. Wait for an automatic binding update to run, which is scheduled every 2 weeks.
2. Manually run the `Update API Bindings` workflow in the `sdk-internal` repo.

Both of these will generate a PR that will require approval from any teams whose owned code is
affected by the binding updates.

## Current binding details

This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By
using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API
Expand All @@ -12,20 +22,11 @@ client.
- API version: latest
- Package version: 2.0.0
- Server Git commit:
[`196e555116aba4666ae8c9cc9080291c42c1fe46`](https://github.com/bitwarden/server/commit/196e555116aba4666ae8c9cc9080291c42c1fe46)
[`d03277323fb9957c3d8cc5ae2d17f07efc9ad0f3`](https://github.com/bitwarden/server/commit/d03277323fb9957c3d8cc5ae2d17f07efc9ad0f3)
- Generator version: 7.15.0
- Build package: `org.openapitools.codegen.languages.RustClientCodegen`

## Installation

Put the package under your project folder in a directory named `bitwarden-api-api` and add the
following to `Cargo.toml` under `[dependencies]`:

```
bitwarden-api-api = { path = "./bitwarden-api-api" }
```

## Documentation for API Endpoints
## Documentation for API endpoints

All URIs are relative to *https://api.bitwarden.com*

Expand Down Expand Up @@ -342,8 +343,6 @@ All URIs are relative to *https://api.bitwarden.com*
| _OrganizationsApi_ | [**put**](docs/OrganizationsApi.md#organizations_put) | **PUT** /organizations/{organizationId} |
| _OrganizationsApi_ | [**put_collection_management**](docs/OrganizationsApi.md#organizations_put_collection_management) | **PUT** /organizations/{id}/collection-management |
| _OrganizationsApi_ | [**rotate_api_key**](docs/OrganizationsApi.md#organizations_rotate_api_key) | **POST** /organizations/{id}/rotate-api-key |
| _PhishingDomainsApi_ | [**get_checksum**](docs/PhishingDomainsApi.md#phishing_domains_get_checksum) | **GET** /phishing-domains/checksum |
| _PhishingDomainsApi_ | [**get_phishing_domains**](docs/PhishingDomainsApi.md#phishing_domains_get_phishing_domains) | **GET** /phishing-domains |
| _PlansApi_ | [**get**](docs/PlansApi.md#plans_get) | **GET** /plans |
| _PlansApi_ | [**get_premium_plan**](docs/PlansApi.md#plans_get_premium_plan) | **GET** /plans/premium |
| _PoliciesApi_ | [**get**](docs/PoliciesApi.md#policies_get) | **GET** /organizations/{orgId}/policies/{type} |
Expand Down Expand Up @@ -992,5 +991,3 @@ To get access to the crate's generated documentation, use:
```
cargo doc --open
```

## Author
12 changes: 0 additions & 12 deletions crates/bitwarden-api-api/src/apis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ pub mod organization_reports_api;
pub mod organization_sponsorships_api;
pub mod organization_users_api;
pub mod organizations_api;
pub mod phishing_domains_api;
pub mod plans_api;
pub mod policies_api;
pub mod projects_api;
Expand Down Expand Up @@ -226,7 +225,6 @@ struct ApiClientReal {
organization_sponsorships_api: organization_sponsorships_api::OrganizationSponsorshipsApiClient,
organization_users_api: organization_users_api::OrganizationUsersApiClient,
organizations_api: organizations_api::OrganizationsApiClient,
phishing_domains_api: phishing_domains_api::PhishingDomainsApiClient,
plans_api: plans_api::PlansApiClient,
policies_api: policies_api::PoliciesApiClient,
projects_api: projects_api::ProjectsApiClient,
Expand Down Expand Up @@ -304,7 +302,6 @@ pub struct ApiClientMock {
organization_sponsorships_api::MockOrganizationSponsorshipsApi,
pub organization_users_api: organization_users_api::MockOrganizationUsersApi,
pub organizations_api: organizations_api::MockOrganizationsApi,
pub phishing_domains_api: phishing_domains_api::MockPhishingDomainsApi,
pub plans_api: plans_api::MockPlansApi,
pub policies_api: policies_api::MockPoliciesApi,
pub projects_api: projects_api::MockProjectsApi,
Expand Down Expand Up @@ -379,7 +376,6 @@ impl ApiClient {
organization_sponsorships_api: organization_sponsorships_api::OrganizationSponsorshipsApiClient::new(configuration.clone()),
organization_users_api: organization_users_api::OrganizationUsersApiClient::new(configuration.clone()),
organizations_api: organizations_api::OrganizationsApiClient::new(configuration.clone()),
phishing_domains_api: phishing_domains_api::PhishingDomainsApiClient::new(configuration.clone()),
plans_api: plans_api::PlansApiClient::new(configuration.clone()),
policies_api: policies_api::PoliciesApiClient::new(configuration.clone()),
projects_api: projects_api::ProjectsApiClient::new(configuration.clone()),
Expand Down Expand Up @@ -451,7 +447,6 @@ impl ApiClient {
organization_sponsorships_api: organization_sponsorships_api::MockOrganizationSponsorshipsApi::new(),
organization_users_api: organization_users_api::MockOrganizationUsersApi::new(),
organizations_api: organizations_api::MockOrganizationsApi::new(),
phishing_domains_api: phishing_domains_api::MockPhishingDomainsApi::new(),
plans_api: plans_api::MockPlansApi::new(),
policies_api: policies_api::MockPoliciesApi::new(),
projects_api: projects_api::MockProjectsApi::new(),
Expand Down Expand Up @@ -737,13 +732,6 @@ impl ApiClient {
ApiClient::Mock(mock) => &mock.organizations_api,
}
}
pub fn phishing_domains_api(&self) -> &dyn phishing_domains_api::PhishingDomainsApi {
match self {
ApiClient::Real(real) => &real.phishing_domains_api,
#[cfg(feature = "mockall")]
ApiClient::Mock(mock) => &mock.phishing_domains_api,
}
}
pub fn plans_api(&self) -> &dyn plans_api::PlansApi {
match self {
ApiClient::Real(real) => &real.plans_api,
Expand Down
170 changes: 0 additions & 170 deletions crates/bitwarden-api-api/src/apis/phishing_domains_api.rs

This file was deleted.

7 changes: 7 additions & 0 deletions crates/bitwarden-api-api/src/models/keys_request_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@ pub struct KeysRequestModel {
pub public_key: String,
#[serde(rename = "encryptedPrivateKey", alias = "EncryptedPrivateKey")]
pub encrypted_private_key: String,
#[serde(
rename = "accountKeys",
alias = "AccountKeys",
skip_serializing_if = "Option::is_none"
)]
pub account_keys: Option<Box<models::AccountKeysRequestModel>>,
}

impl KeysRequestModel {
pub fn new(public_key: String, encrypted_private_key: String) -> KeysRequestModel {
KeysRequestModel {
public_key,
encrypted_private_key,
account_keys: None,
}
}
}
9 changes: 9 additions & 0 deletions crates/bitwarden-api-api/src/models/keys_response_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ pub struct KeysResponseModel {
skip_serializing_if = "Option::is_none"
)]
pub object: Option<String>,
/// The master key wrapped user key. The master key can either be a master-password master key
/// or a key-connector master key.
#[serde(rename = "key", alias = "Key", skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(
Expand All @@ -34,6 +36,12 @@ pub struct KeysResponseModel {
skip_serializing_if = "Option::is_none"
)]
pub private_key: Option<String>,
#[serde(
rename = "accountKeys",
alias = "AccountKeys",
skip_serializing_if = "Option::is_none"
)]
pub account_keys: Option<Box<models::PrivateKeysResponseModel>>,
}

impl KeysResponseModel {
Expand All @@ -43,6 +51,7 @@ impl KeysResponseModel {
key: None,
public_key: None,
private_key: None,
account_keys: None,
}
}
}
4 changes: 4 additions & 0 deletions crates/bitwarden-api-identity/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ src/apis/info_api.rs
src/apis/mod.rs
src/apis/sso_api.rs
src/lib.rs
src/models/account_keys_request_model.rs
src/models/assertion_options.rs
src/models/authentication_extensions_client_inputs.rs
src/models/authenticator_transport.rs
Expand All @@ -18,10 +19,13 @@ src/models/product_tier_type.rs
src/models/product_type.rs
src/models/public_key_credential_descriptor.rs
src/models/public_key_credential_type.rs
src/models/public_key_encryption_key_pair_request_model.rs
src/models/register_finish_request_model.rs
src/models/register_finish_response_model.rs
src/models/register_send_verification_email_request_model.rs
src/models/register_verification_email_clicked_request_model.rs
src/models/security_state_model.rs
src/models/signature_key_pair_request_model.rs
src/models/trial_send_verification_email_request_model.rs
src/models/user_verification_requirement.rs
src/models/web_authn_login_assertion_options_response_model.rs
Loading
Loading