diff --git a/Cargo.lock b/Cargo.lock index 4fcd17bf1c61f..e7284ffb7e5dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,6 +23,17 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.7.7" @@ -1647,6 +1658,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block-padding" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" +dependencies = [ + "generic-array", +] + [[package]] name = "blocking" version = "1.3.1" @@ -1926,6 +1946,15 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" +[[package]] +name = "cbc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" +dependencies = [ + "cipher", +] + [[package]] name = "cc" version = "1.0.83" @@ -2040,6 +2069,16 @@ dependencies = [ "half 1.8.2", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + [[package]] name = "clang-sys" version = "1.6.1" @@ -5253,6 +5292,16 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "block-padding", + "generic-array", +] + [[package]] name = "inquire" version = "0.7.0" @@ -7303,6 +7352,16 @@ dependencies = [ "prost-types 0.11.9", ] +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest", + "hmac", +] + [[package]] name = "peeking_take_while" version = "0.1.2" @@ -7475,6 +7534,21 @@ dependencies = [ "spki 0.7.2", ] +[[package]] +name = "pkcs5" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e847e2c91a18bfa887dd028ec33f2fe6f25db77db3619024764914affe8b69a6" +dependencies = [ + "aes", + "cbc", + "der 0.7.8", + "pbkdf2", + "scrypt", + "sha2", + "spki 0.7.2", +] + [[package]] name = "pkcs8" version = "0.9.0" @@ -7492,6 +7566,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ "der 0.7.8", + "pkcs5", + "rand_core", "spki 0.7.2", ] @@ -8506,13 +8582,12 @@ dependencies = [ [[package]] name = "reqsign" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce87f66ba6c6acef277a729f989a0eca946cb9ce6a15bcc036bda0f72d4b9fd" +version = "0.14.9" +source = "git+https://github.com/wcy-fdu/reqsign.git?rev=e6cb304#e6cb3048581033275f4525431b757c8c612d37db" dependencies = [ "anyhow", "async-trait", - "base64 0.21.7", + "base64 0.22.0", "chrono", "form_urlencoded", "getrandom", @@ -8533,7 +8608,6 @@ dependencies = [ "serde_json", "sha1", "sha2", - "tokio", ] [[package]] @@ -10422,6 +10496,7 @@ dependencies = [ "pkcs1", "pkcs8 0.10.2", "rand_core", + "sha2", "signature 2.0.0", "spki 0.7.2", "subtle", @@ -10702,6 +10777,15 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +[[package]] +name = "salsa20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" +dependencies = [ + "cipher", +] + [[package]] name = "same-file" version = "1.0.6" @@ -10768,6 +10852,17 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" +[[package]] +name = "scrypt" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" +dependencies = [ + "pbkdf2", + "salsa20", + "sha2", +] + [[package]] name = "sct" version = "0.7.0" diff --git a/Cargo.toml b/Cargo.toml index b4adc376372bc..e4d079adf0f58 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -301,6 +301,8 @@ tokio-postgres = { git = "https://github.com/madsim-rs/rust-postgres.git", rev = futures-timer = { git = "https://github.com/madsim-rs/futures-timer.git", rev = "05b33b4" } # patch: unlimit 4MB message size for grpc client etcd-client = { git = "https://github.com/risingwavelabs/etcd-client.git", rev = "4e84d40" } +# todo(wcy-fdu): remove this patch fork after opendal release a new version to apply azure workload identity change. +reqsign = { git = "https://github.com/wcy-fdu/reqsign.git", rev = "e6cb304" } [workspace.metadata.dylint] libraries = [{ path = "./lints" }] diff --git a/risedev.yml b/risedev.yml index 53eda3ec3c2ca..82be3912842a2 100644 --- a/risedev.yml +++ b/risedev.yml @@ -1378,4 +1378,4 @@ template: port: 6379 # address of redis - address: "127.0.0.1" + address: "127.0.0.1" \ No newline at end of file diff --git a/src/object_store/src/object/opendal_engine/azblob.rs b/src/object_store/src/object/opendal_engine/azblob.rs index b446a2885a691..ae09a0fe2d333 100644 --- a/src/object_store/src/object/opendal_engine/azblob.rs +++ b/src/object_store/src/object/opendal_engine/azblob.rs @@ -18,6 +18,8 @@ use opendal::Operator; use super::{EngineType, OpendalObjectStore}; use crate::object::ObjectResult; + +const AZBLOB_ENDPOINT: &str = "AZBLOB_ENDPOINT"; impl OpendalObjectStore { /// create opendal azblob engine. pub fn new_azblob_engine(container_name: String, root: String) -> ObjectResult { @@ -26,16 +28,10 @@ impl OpendalObjectStore { builder.root(&root); builder.container(&container_name); - let endpoint = std::env::var("AZBLOB_ENDPOINT") + let endpoint = std::env::var(AZBLOB_ENDPOINT) .unwrap_or_else(|_| panic!("AZBLOB_ENDPOINT not found from environment variables")); - let account_name = std::env::var("AZBLOB_ACCOUNT_NAME") - .unwrap_or_else(|_| panic!("AZBLOB_ACCOUNT_NAME not found from environment variables")); - let account_key = std::env::var("AZBLOB_ACCOUNT_KEY") - .unwrap_or_else(|_| panic!("AZBLOB_ACCOUNT_KEY not found from environment variables")); builder.endpoint(&endpoint); - builder.account_name(&account_name); - builder.account_key(&account_key); let op: Operator = Operator::new(builder)? .layer(LoggingLayer::default()) .layer(RetryLayer::default())