Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
9 changes: 5 additions & 4 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ reqwest = { version = ">=0.12.5, <0.13", features = [
"multipart",
"http2",
], default-features = false }
schemars = { version = ">=0.8.9, <0.9", features = ["uuid1", "chrono"] }
schemars = { version = ">=1.0.0, <2.0", features = ["uuid1", "chrono04"] }
serde = { version = ">=1.0, <2.0", features = ["derive"] }
serde_bytes = { version = ">=0.11.17, <0.12.0" }
serde_json = ">=1.0.96, <2.0"
Expand Down
10 changes: 5 additions & 5 deletions crates/bitwarden-crypto/src/enc_string/asymmetric.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{fmt::Display, str::FromStr};
use std::{borrow::Cow, fmt::Display, str::FromStr};

use base64::{engine::general_purpose::STANDARD, Engine};
pub use internal::UnsignedSharedKey;
Expand Down Expand Up @@ -227,11 +227,11 @@ impl UnsignedSharedKey {
/// But during the transition phase we will expose endpoints using the UnsignedSharedKey
/// type.
impl schemars::JsonSchema for UnsignedSharedKey {
fn schema_name() -> String {
"UnsignedSharedKey".to_string()
fn schema_name() -> Cow<'static, str> {
"UnsignedSharedKey".into()
}

fn json_schema(generator: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
fn json_schema(generator: &mut schemars::generate::SchemaGenerator) -> schemars::Schema {
generator.subschema_for::<String>()
}
}
Expand Down Expand Up @@ -355,7 +355,7 @@ XKZBokBGnjFnTnKcs7nv/O8=

assert_eq!(
serde_json::to_string(&schema).unwrap(),
r#"{"$schema":"http://json-schema.org/draft-07/schema#","title":"UnsignedSharedKey","type":"string"}"#
r#"{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"UnsignedSharedKey","type":"string"}"#
);
}
}
10 changes: 5 additions & 5 deletions crates/bitwarden-crypto/src/enc_string/symmetric.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::str::FromStr;
use std::{borrow::Cow, str::FromStr};

use base64::{engine::general_purpose::STANDARD, Engine};
use coset::CborSerializable;
Expand Down Expand Up @@ -342,11 +342,11 @@ impl KeyDecryptable<SymmetricCryptoKey, String> for EncString {
/// Usually we wouldn't want to expose EncStrings in the API or the schemas.
/// But during the transition phase we will expose endpoints using the EncString type.
impl schemars::JsonSchema for EncString {
fn schema_name() -> String {
"EncString".to_string()
fn schema_name() -> Cow<'static, str> {
"EncString".into()
}

fn json_schema(generator: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
fn json_schema(generator: &mut schemars::generate::SchemaGenerator) -> schemars::Schema {
generator.subschema_for::<String>()
}
}
Expand Down Expand Up @@ -514,7 +514,7 @@ mod tests {

assert_eq!(
serde_json::to_string(&schema).unwrap(),
r#"{"$schema":"http://json-schema.org/draft-07/schema#","title":"EncString","type":"string"}"#
r#"{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"EncString","type":"string"}"#
);
}
}
8 changes: 4 additions & 4 deletions crates/bitwarden-crypto/src/keys/signed_public_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! identity, which is provided by a signature keypair. This is done by signing the public key, and
//! requiring consumers to verify the public key before consumption by using unwrap_and_verify.

use std::str::FromStr;
use std::{borrow::Cow, str::FromStr};

use base64::{engine::general_purpose::STANDARD, Engine};
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -152,11 +152,11 @@ impl serde::Serialize for SignedPublicKey {
}

impl schemars::JsonSchema for SignedPublicKey {
fn schema_name() -> String {
"SignedPublicKey".to_string()
fn schema_name() -> Cow<'static, str> {
"SignedPublicKey".into()
}

fn json_schema(generator: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
fn json_schema(generator: &mut schemars::generate::SchemaGenerator) -> schemars::Schema {
generator.subschema_for::<String>()
}
}
Expand Down
Loading