Skip to content

Commit ae583cf

Browse files
committed
chore: update dependencies
1 parent fea65fb commit ae583cf

16 files changed

Lines changed: 82 additions & 122 deletions

File tree

Cargo.toml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ axum = { version = "0.8", features = [
3737
"query",
3838
], default-features = true }
3939
async-trait = "0.1"
40-
arc-swap = "1.7"
40+
anda_db = { version = "0.4", features = ["full"] }
41+
anda_db_tfs = { version = "0.4", features = ["full"] }
4142
bytes = "1"
4243
base64 = "0.22"
4344
candid = "0.10"
@@ -48,15 +49,16 @@ http = "1.3"
4849
serde = { version = "1", features = ["derive"] }
4950
serde_json = "1"
5051
serde_bytes = "0.11"
51-
ic_cose_types = "0.8"
52-
ic_cose = "0.8"
52+
ic_cose_types = "0.8.11"
53+
ic_cose = "0.8.11"
5354
ic_object_store = "1.1"
54-
ic-agent = "0.40"
55-
ic_auth_types = "0.4"
56-
ic_auth_verifier = "0.4"
57-
ic_tee_cdk = "0.5"
58-
ic_tee_agent = "0.5"
59-
ic_tee_gateway_sdk = "0.5"
55+
ic-agent = "0.41"
56+
ic_auth_types = "0.5"
57+
ic_auth_verifier = "0.5"
58+
ic_tee_cdk = "0.6"
59+
ic_tee_agent = "0.6"
60+
ic_tee_gateway_sdk = "0.6"
61+
ic-oss-types = "1.1"
6062
anda_cloud_cdk = "0.1"
6163
num-traits = "0.2"
6264
object_store = { version = "0.12" }
@@ -77,15 +79,14 @@ thiserror = "2"
7779
moka = { version = "0.12", features = ["future"] }
7880
xid = "1.1"
7981
toml = "0.8"
80-
ed25519-consensus = "2.1"
8182
k256 = { version = "0.13", features = ["ecdsa"] }
8283
log = "0.4"
8384
dotenv = "0.15"
8485
schemars = { version = "0.9" }
8586
clap = { version = "4.5", features = ["derive", "env"] }
8687
idna = "1.0" # https://github.com/ldclabs/anda/security/dependabot/1
8788
url = "2.5"
88-
const-hex = "1"
89+
hex = "0.4"
8990

9091
# [patch.crates-io]
9192
# candid = { git = "https://github.com/ldclabs/candid.git", rev = "4cf7d02bad9530172cb4cafe733cb1e80689b793" } # remove check_recursion on stack for TEE

agents/anda_bot/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ http = { workspace = true }
2525
ic_cose = { workspace = true }
2626
ic_cose_types = { workspace = true }
2727
ic_object_store = { workspace = true }
28+
ic-oss-types = { workspace = true }
2829
ic-agent = { workspace = true }
2930
ic_tee_agent = { workspace = true }
3031
tokio-util = { workspace = true }
3132
structured-logger = { workspace = true }
3233
toml = { workspace = true }
3334
tokio = { workspace = true }
3435
log = { workspace = true }
35-
ed25519-consensus = { workspace = true }
36-
const-hex = { workspace = true }
36+
hex = { workspace = true }
3737
ic_auth_verifier = { workspace = true, features = ["full"] }
3838
config = "0.15"
3939
anda_object_store = "0.1"

agents/anda_bot/src/handler.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ use axum::{
55
response::IntoResponse,
66
};
77
use candid::Principal;
8-
use ic_auth_verifier::envelope::{ANONYMOUS_PRINCIPAL, SignedEnvelope, extract_user, unix_ms};
8+
use ic_auth_verifier::{
9+
envelope::{ANONYMOUS_PRINCIPAL, SignedEnvelope, extract_user},
10+
unix_timestamp,
11+
};
912
use ic_cose::client::CoseSDK;
1013
use ic_cose_types::to_cbor_bytes;
1114
use ic_tee_agent::{RPCRequest, RPCResponse, http::Content};
@@ -44,7 +47,11 @@ impl AppState {
4447
let caller = if let Some(se) = SignedEnvelope::from_authorization(headers)
4548
.or_else(|| SignedEnvelope::from_headers(headers))
4649
{
47-
match se.verify(unix_ms(), Some(self.info.id), None) {
50+
match se.verify(
51+
unix_timestamp().as_millis() as u64,
52+
Some(self.info.id),
53+
None,
54+
) {
4855
Ok(_) => se.sender(),
4956
Err(_) => {
5057
return false;

agents/anda_bot/src/main.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,17 @@ use anda_web3_client::client::{Client as Web3Client, load_identity};
2323
use axum::{Router, routing};
2424
use candid::Principal;
2525
use clap::{Parser, Subcommand};
26-
use ed25519_consensus::SigningKey;
2726
use ic_agent::{
2827
Agent,
2928
identity::{BasicIdentity, Identity},
3029
};
3130
use ic_cose::client::CoseSDK;
32-
use ic_cose_types::{
33-
CanisterCaller,
34-
types::{object_store::CHUNK_SIZE, setting::SettingPath},
35-
};
31+
use ic_cose_types::{CanisterCaller, types::setting::SettingPath};
3632
use ic_object_store::{
3733
agent::build_agent,
3834
client::{Client, ObjectStoreClient},
3935
};
36+
use ic_oss_types::object_store::CHUNK_SIZE;
4037
use ic_tee_agent::setting::decrypt_payload;
4138
use std::collections::{BTreeMap, BTreeSet};
4239
use std::{net::SocketAddr, sync::Arc, time::Duration};
@@ -202,7 +199,7 @@ async fn bootstrap(cli: Cli) -> Result<(), BoxError> {
202199
}) => {
203200
let cfg = config::Conf::from_file(&config)?;
204201
log::debug!("{:?}", cfg);
205-
let root_secret = const_hex::decode(root_secret)?;
202+
let root_secret = hex::decode(root_secret)?;
206203
let root_secret: [u8; 48] =
207204
root_secret.try_into().map_err(|_| "invalid root_secret")?;
208205

@@ -261,7 +258,7 @@ async fn bootstrap_tee(
261258
vec![default_agent_path.as_bytes().to_vec()],
262259
))
263260
.await?;
264-
let my_id = BasicIdentity::from_signing_key(SigningKey::from(id_secret));
261+
let my_id = BasicIdentity::from_raw_key(&id_secret);
265262
let my_principal = my_id.sender()?;
266263
log::info!("sign_in, principal: {:?}", my_principal.to_text());
267264

anda_cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ clap = { workspace = true }
1717
dotenv = { workspace = true }
1818
serde_json = { workspace = true }
1919
tokio = { workspace = true }
20-
const-hex = { workspace = true }
20+
hex = { workspace = true }
2121
rand = { workspace = true }
2222
ciborium = { workspace = true }
2323

anda_cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ async fn main() -> Result<(), BoxError> {
8787
rng.fill_bytes(&mut bytes);
8888
match format.as_str() {
8989
"hex" => {
90-
println!("{}", const_hex::encode(&bytes));
90+
println!("{}", hex::encode(&bytes));
9191
}
9292
"base64" => {
9393
println!("{}", BASE64_URL_SAFE.encode(&bytes));

anda_core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ thiserror = { workspace = true }
2323
object_store = { workspace = true }
2424
ic_auth_types = { workspace = true }
2525
ic_cose_types = { workspace = true }
26+
ic-oss-types = { workspace = true }
2627
tokio-util = { workspace = true }
2728
reqwest = { workspace = true }
2829
schemars = { workspace = true }

anda_core/src/context.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ use serde::{Deserialize, Serialize, de::DeserializeOwned};
4040
use std::{future::Future, sync::Arc, time::Duration};
4141

4242
pub use candid::Principal;
43-
pub use ic_cose_types::{CanisterCaller, types::object_store::UpdateVersion};
43+
pub use ic_cose_types::CanisterCaller;
44+
pub use ic_oss_types::object_store::UpdateVersion;
4445
pub use object_store::{ObjectMeta, PutMode, PutResult, UpdateVersion as OsVersion, path::Path};
4546
pub use serde_json::Value;
4647
pub use tokio_util::sync::CancellationToken;

anda_engine_server/src/handler.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ use axum::{
77
};
88
use candid::Principal;
99
use ciborium::from_reader;
10-
use ic_auth_verifier::envelope::{ANONYMOUS_PRINCIPAL, SignedEnvelope, unix_ms};
10+
use ic_auth_verifier::{
11+
envelope::{ANONYMOUS_PRINCIPAL, SignedEnvelope},
12+
unix_timestamp,
13+
};
1114
use ic_cose_types::to_cbor_bytes;
1215
use ic_tee_agent::{
1316
RPCRequest, RPCResponse,
@@ -33,7 +36,7 @@ pub async fn get_information(
3336
let caller = if let Some(se) = SignedEnvelope::from_authorization(&headers)
3437
.or_else(|| SignedEnvelope::from_headers(&headers))
3538
{
36-
match se.verify(unix_ms(), None, None) {
39+
match se.verify(unix_timestamp().as_millis() as u64, None, None) {
3740
Ok(_) => se.sender(),
3841
Err(_) => ANONYMOUS_PRINCIPAL,
3942
}
@@ -115,7 +118,11 @@ pub async fn anda_engine(
115118
let caller = if let Some(se) = SignedEnvelope::from_authorization(&headers)
116119
.or_else(|| SignedEnvelope::from_headers(&headers))
117120
{
118-
match se.verify(unix_ms(), Some(id), Some(hash.as_slice())) {
121+
match se.verify(
122+
unix_timestamp().as_millis() as u64,
123+
Some(id),
124+
Some(hash.as_slice()),
125+
) {
119126
Ok(_) => se.sender(),
120127
Err(_) => ANONYMOUS_PRINCIPAL,
121128
}

anda_kdb/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ license.workspace = true
1212
[dependencies]
1313
anda_core = { path = "../anda_core", version = "0.6" }
1414
anda_engine = { path = "../anda_engine", version = "0.6" }
15+
anda_db = { workspace = true }
16+
anda_db_tfs = { workspace = true }
1517
object_store = { workspace = true }
1618
serde = { workspace = true }
1719
serde_json = { workspace = true }
1820
xid = { workspace = true }
19-
anda_db = { version = "0.3", features = ["full"] }
20-
anda_db_tfs = { version = "0.4", features = ["full"] }
2121

2222
[dev-dependencies]

0 commit comments

Comments
 (0)