chore: import upstream snapshot with attribution
FreeBSD Smoke / FreeBSD Smoke (x86_64) (push) Has been cancelled
CI / Quality Guardrails (push) Has been cancelled
CI / Build & Test (macos-latest) (push) Has been cancelled
CI / Build & Test (ubuntu-latest) (push) Has been cancelled
CI / Build & Test (windows-latest) (push) Has been cancelled
CI / Format (push) Has been cancelled
CI / PowerShell Syntax (push) Has been cancelled
CI / Windows Cross-Target Check (Linux) (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 13:10:34 +08:00
commit a789495a98
1551 changed files with 718128 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
[package]
name = "jcode-azure-auth"
version = "0.1.0"
edition = "2024"
[lib]
name = "jcode_azure_auth"
path = "src/lib.rs"
[dependencies]
anyhow = "1"
# Use rustls instead of native-tls so the whole binary stays OpenSSL-free
# (required for the BoringSSL-backed websearch client to link; see GH #270).
# azure 1.0 makes the reqwest TLS backend selectable; 0.24 hardcoded native-tls.
azure_core = { version = "1.0", default-features = false, features = ["reqwest_rustls", "reqwest_deflate", "reqwest_gzip", "tokio"] }
azure_identity = { version = "1.0", default-features = false, features = ["tokio"] }
+8
View File
@@ -0,0 +1,8 @@
use anyhow::Result;
use azure_core::credentials::TokenCredential;
pub async fn get_bearer_token(scope: &str) -> Result<String> {
let credential = azure_identity::DeveloperToolsCredential::new(None)?;
let token = credential.get_token(&[scope], None).await?;
Ok(token.token.secret().to_string())
}