Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SKU SDK: use new item / request specific credential APIs (uplift to 1.62.x) #21571

Merged
merged 2 commits into from
Jan 17, 2024
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
2 changes: 1 addition & 1 deletion components/skus/browser/rs/lib/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ rust_static_library("rust_lib") {
"//brave/third_party/rust/sha2/v0_9:lib",
"//brave/third_party/rust/tracing/v0_1:lib",
"//brave/third_party/rust/urlencoding/v1:lib",
"//brave/third_party/rust/uuid/v0_8:lib",
"//brave/third_party/rust/uuid/v1:lib",
"//third_party/rust/base64/v0_13:lib",
"//third_party/rust/serde/v1:lib",
"//third_party/rust/serde_json/v1:lib",
Expand Down
2 changes: 1 addition & 1 deletion components/skus/browser/rs/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tracing = { version = "0.1", default-features = false }
bigdecimal = { version = "0.1", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
chrono = { version = "0.4", default-features = false, features = ["clock", "serde"] }
uuid = { version = "0.8", features = ["serde"] }
uuid = { version = "1", features = ["v4"] }
challenge-bypass-ristretto = { version = "1.0.1", features = ["serde_base64"] }
futures-retry = "0.5.0"
urlencoding = "1.1.1"
Expand Down
1 change: 1 addition & 0 deletions components/skus/browser/rs/lib/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ pub struct TimeLimitedV2Credentials {
pub creds: Vec<Token>,
pub unblinded_creds: Option<Vec<TimeLimitedV2Credential>>,
pub state: CredentialState,
pub request_id: Option<String>,
}

#[derive(Serialize, Deserialize, Debug)]
Expand Down
426 changes: 233 additions & 193 deletions components/skus/browser/rs/lib/src/sdk/credentials/fetch.rs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions components/skus/browser/rs/lib/src/storage/kv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ where
async fn upsert_time_limited_v2_item_creds(
&self,
item_id: &str,
request_id: &str,
creds: Vec<Token>,
) -> Result<(), InternalError> {
let mut store = self.get_store()?;
Expand All @@ -311,6 +312,7 @@ where
let tlv2_vec = Vec::new();
let tlv2_creds = Credentials::TimeLimitedV2(TimeLimitedV2Credentials {
item_id: item_id.to_string(),
request_id: Some(request_id.to_string()),
creds,
unblinded_creds: Some(tlv2_vec),
state: CredentialState::GeneratedCredentials,
Expand Down
1 change: 1 addition & 0 deletions components/skus/browser/rs/lib/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub trait StorageClient {
async fn upsert_time_limited_v2_item_creds(
&self,
item_id: &str,
request_id: &str,
creds: Vec<Token>,
) -> Result<(), InternalError>;
async fn append_time_limited_v2_item_unblinded_creds(
Expand Down
11 changes: 2 additions & 9 deletions third_party/rust/Cargo.lock

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

8 changes: 2 additions & 6 deletions third_party/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ version = "0.1"
build-script-outputs = ["tables.rs"]

[dependencies.uuid]
version = "0.8"
features = ["serde"]
version = "1"
features = ["v4"]
[patch.crates-io.adblock_v0_8]
path = "adblock/v0_8/crate"
package = "adblock"
Expand Down Expand Up @@ -1308,10 +1308,6 @@ package = "urlencoding"
path = "utf_8/v0_7/crate"
package = "utf-8"

[patch.crates-io.uuid_v0_8]
path = "uuid/v0_8/crate"
package = "uuid"

[patch.crates-io.uuid_v1]
path = "uuid/v1/crate"
package = "uuid"
Expand Down
2 changes: 1 addition & 1 deletion third_party/rust/third_party.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ data-encoding = "2.1.2"
bigdecimal = { version = "0.1", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
chrono = { version = "0.4", default-features = false, features = ["clock", "serde"] }
uuid = { version = "0.8", features = ["serde"] }
uuid = { version = "1", features = ["v4"] }
futures-retry = "0.5.0"
urlencoding = "1.1.1"
hmac = "0.10"
Expand Down
60 changes: 0 additions & 60 deletions third_party/rust/uuid/v0_8/BUILD.gn

This file was deleted.

7 changes: 0 additions & 7 deletions third_party/rust/uuid/v0_8/README.chromium

This file was deleted.

1 change: 0 additions & 1 deletion third_party/rust/uuid/v0_8/crate/.cargo/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions third_party/rust/uuid/v0_8/crate/.cargo_vcs_info.json

This file was deleted.

33 changes: 0 additions & 33 deletions third_party/rust/uuid/v0_8/crate/.gitignore

This file was deleted.

9 changes: 0 additions & 9 deletions third_party/rust/uuid/v0_8/crate/.rustfmt.toml

This file was deleted.

16 changes: 0 additions & 16 deletions third_party/rust/uuid/v0_8/crate/CODEOWNERS

This file was deleted.

77 changes: 0 additions & 77 deletions third_party/rust/uuid/v0_8/crate/CODE_OF_CONDUCT.md

This file was deleted.

Loading