-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add auto generated Api bindings * Expose new endpoint methods in SDK * Use in bws CLI * Expose new command in JSON schemas * restructure and rename response * Expose getByIds in napi * fix cargo check * Add openapi auto generation * Regenerated open api doc * revert back to original binding.js * remove .clone() * Add to changelog * run cargo fmt
- Loading branch information
1 parent
8941a8a
commit 76865d9
Showing
10 changed files
with
120 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
crates/bitwarden/src/secrets_manager/secrets/get_by_ids.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use bitwarden_api_api::models::GetSecretsRequestModel; | ||
use schemars::JsonSchema; | ||
use serde::{Deserialize, Serialize}; | ||
use uuid::Uuid; | ||
|
||
use super::SecretsResponse; | ||
use crate::{client::Client, error::Result}; | ||
|
||
#[derive(Serialize, Deserialize, Debug, JsonSchema)] | ||
#[serde(rename_all = "camelCase", deny_unknown_fields)] | ||
pub struct SecretsGetRequest { | ||
/// IDs of the secrets to retrieve | ||
pub ids: Vec<Uuid>, | ||
} | ||
|
||
pub(crate) async fn get_secrets_by_ids( | ||
client: &mut Client, | ||
input: SecretsGetRequest, | ||
) -> Result<SecretsResponse> { | ||
let request = Some(GetSecretsRequestModel { ids: input.ids }); | ||
|
||
let config = client.get_api_configurations().await; | ||
|
||
let res = | ||
bitwarden_api_api::apis::secrets_api::secrets_get_by_ids_post(&config.api, request).await?; | ||
|
||
let enc = client.get_encryption_settings()?; | ||
|
||
SecretsResponse::process_response(res, enc) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters