Skip to content

Commit 3a973a5

Browse files
zenshanda-ai
andcommitted
release: prepare anda-cloud 0.5.0
- Bump workspace and canister crates to 0.5.0 - Replace direct ciborium usage with cbor2 helpers - Upgrade IC/auth/attestation dependencies and adapt raw_rand calls Co-Authored-By: Anda Bot <noreply@anda.bot>
1 parent e538e63 commit 3a973a5

15 files changed

Lines changed: 151 additions & 134 deletions

File tree

Cargo.lock

Lines changed: 100 additions & 70 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ strip = true
1313
opt-level = 's'
1414

1515
[workspace.package]
16-
version = "0.4.4"
16+
version = "0.5.0"
1717
edition = "2024"
1818
repository = "https://github.com/ldclabs/anda-cloud"
1919
keywords = ["anda", "agent", "icp", "cloud"]
@@ -23,21 +23,21 @@ license = "MIT"
2323
[workspace.dependencies]
2424
base64 = "0.22"
2525
candid = "0.10"
26-
ciborium = "0.2"
26+
cbor2 = "1"
2727
hex = "0.4"
2828
serde = "1"
2929
serde_bytes = "0.11"
3030
serde_json = "1.0"
3131
sha3 = "0.11"
32-
ic-cdk = "0.19"
32+
ic-cdk = "0.20"
3333
ic-cdk-timers = "1.0"
3434
ic-agent = "0.47"
35-
icrc-ledger-types = "0.1"
35+
icrc-ledger-types = "0.2"
3636
ic-http-certification = "3"
3737
ic-stable-structures = "0.7"
38-
ic_auth_types = { version = "0.8" }
39-
ic_auth_verifier = { version = "0.8" }
40-
ic_tee_nitro_attestation = { version = "0.6" }
38+
ic_auth_types = { version = "0.9" }
39+
ic_auth_verifier = { version = "0.9" }
40+
ic_tee_nitro_attestation = { version = "0.7" }
4141
num-traits = "0.2"
4242
lazy_static = "1.5"
4343
once_cell = "1.21"

rs/anda_cloud_cdk/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ name = "anda_cloud_cdk"
33
description = "A Canister Development Kit for the Anda Cloud"
44
repository = "https://github.com/ldclabs/anda-cloud/tree/main/src/anda_cloud_cdk"
55
publish = true
6-
version = "0.4.6"
6+
version = "0.5.0"
77
edition.workspace = true
88
keywords.workspace = true
99
categories.workspace = true
1010
license.workspace = true
1111

1212
[dependencies]
1313
candid = { workspace = true }
14-
ciborium = { workspace = true }
14+
cbor2 = { workspace = true }
1515
serde = { workspace = true }
1616
serde_json = { workspace = true }
1717
sha3 = { workspace = true }

rs/anda_cloud_cdk/src/tee.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl TEEInfo {
8686
#[cfg(test)]
8787
mod tests {
8888
use super::*;
89-
use ciborium::Value;
89+
use cbor2::Value;
9090

9191
#[test]
9292
fn test_tee_protocol() {

rs/anda_discovery_service/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ license.workspace = true
1515
crate-type = ["cdylib"]
1616

1717
[dependencies]
18-
anda_cloud_cdk = { path = "../anda_cloud_cdk", version = "0.4" }
18+
anda_cloud_cdk = { path = "../anda_cloud_cdk", version = "0.5" }
1919
base64 = { workspace = true }
2020
candid = { workspace = true, features = ["value", "printer"] }
21-
ciborium = { workspace = true }
21+
cbor2 = { workspace = true }
2222
ic-cdk = { workspace = true }
2323
serde = { workspace = true }
2424
serde_bytes = { workspace = true }

rs/anda_gateway_service/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ license.workspace = true
1515
crate-type = ["cdylib"]
1616

1717
[dependencies]
18-
anda_cloud_cdk = { path = "../anda_cloud_cdk", version = "0.4" }
18+
anda_cloud_cdk = { path = "../anda_cloud_cdk", version = "0.5" }
1919
base64 = { workspace = true }
2020
candid = { workspace = true, features = ["value", "printer"] }
21-
ciborium = { workspace = true }
21+
cbor2 = { workspace = true }
2222
ic-cdk = { workspace = true }
2323
serde = { workspace = true }
2424
serde_bytes = { workspace = true }

rs/anda_payment_service/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ license.workspace = true
1515
crate-type = ["cdylib"]
1616

1717
[dependencies]
18-
anda_cloud_cdk = { path = "../anda_cloud_cdk", version = "0.4" }
18+
anda_cloud_cdk = { path = "../anda_cloud_cdk", version = "0.5" }
1919
base64 = { workspace = true }
2020
candid = { workspace = true, features = ["value", "printer"] }
21-
ciborium = { workspace = true }
21+
cbor2 = { workspace = true }
2222
ic-cdk = { workspace = true }
2323
serde = { workspace = true }
2424
serde_bytes = { workspace = true }

rs/anda_registry_canister/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ license.workspace = true
1515
crate-type = ["cdylib"]
1616

1717
[dependencies]
18-
anda_cloud_cdk = { path = "../anda_cloud_cdk", version = "0.4" }
18+
anda_cloud_cdk = { path = "../anda_cloud_cdk", version = "0.5" }
1919
base64 = { workspace = true }
2020
candid = { workspace = true, features = ["value", "printer"] }
21-
ciborium = { workspace = true }
21+
cbor2 = { workspace = true }
2222
ic-cdk = { workspace = true }
2323
serde = { workspace = true }
2424
serde_bytes = { workspace = true }

rs/anda_registry_canister/src/api_http.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use anda_cloud_cdk::{agent::ChallengeEnvelope, registry::RegistryError};
22
use base64::{Engine, engine::general_purpose::STANDARD as BASE64};
33
use candid::{CandidType, Principal};
4-
use ciborium::from_reader;
4+
use cbor2::from_slice;
55
use ic_auth_types::cbor_into_vec;
66
use ic_http_certification::{HeaderField, HttpRequest, HttpUpdateRequest};
77
use serde::{Deserialize, Serialize};
@@ -236,7 +236,7 @@ fn lookup(url: Url, in_cbor: bool) -> Result<Vec<u8>, RegistryError> {
236236

237237
async fn register(body: &[u8], in_cbor: bool) -> Result<Vec<u8>, RegistryError> {
238238
let envelope: ChallengeEnvelope = if in_cbor {
239-
from_reader(body).map_err(|err| RegistryError::BadRequest {
239+
from_slice(body).map_err(|err| RegistryError::BadRequest {
240240
error: format!("failed to decode AgentEnvelope from CBOR, error: {err}"),
241241
})?
242242
} else {
@@ -251,7 +251,7 @@ async fn register(body: &[u8], in_cbor: bool) -> Result<Vec<u8>, RegistryError>
251251

252252
async fn challenge(body: &[u8], in_cbor: bool) -> Result<Vec<u8>, RegistryError> {
253253
let envelope: ChallengeEnvelope = if in_cbor {
254-
from_reader(body).map_err(|err| RegistryError::BadRequest {
254+
from_slice(body).map_err(|err| RegistryError::BadRequest {
255255
error: format!("failed to decode AgentEnvelope from CBOR, error: {err}"),
256256
})?
257257
} else {

rs/anda_registry_canister/src/lib.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,14 @@ fn validate_principals(principals: &BTreeSet<Principal>) -> Result<(), String> {
3737
}
3838

3939
async fn rand_bytes<const N: usize>() -> Result<[u8; N], String> {
40-
let mut data = ic_cdk::management_canister::raw_rand()
41-
.await
42-
.map_err(|err| format!("{err:?}"))?;
40+
let mut data: Vec<u8> = ic_cdk::call::Call::bounded_wait(
41+
Principal::management_canister(),
42+
"raw_rand",
43+
)
44+
.await
45+
.map_err(|err| format!("{err:?}"))?
46+
.candid()
47+
.map_err(|err| format!("{err:?}"))?;
4348
data.truncate(N);
4449
data.try_into().map_err(|err| format!("{err:?}"))
4550
}

0 commit comments

Comments
 (0)