feat(phase-5): WS1 — Rust SDK

Implements the sentryagent-idp Rust SDK crate (sdk-rust/) with:
- TokenManager with Arc<Mutex<TokenCache>> for thread-safe token caching
- AgentIdPClient with full method coverage: agents, oauth2, credentials, audit, marketplace, delegation
- Error hierarchy via thiserror (AgentIdPError enum)
- All model types with serde derive
- 429 RateLimited handling with Retry-After parsing; zero unwrap() calls
- Unit tests (mockito), doc tests, and integration tests (#[ignore])
- quickstart example, full README, cargo doc clean

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
SentryAgent.ai Developer
2026-04-03 02:48:14 +00:00
parent fec1801e8c
commit a4aab1b5b3
17 changed files with 4874 additions and 0 deletions

28
sdk-rust/Cargo.toml Normal file
View File

@@ -0,0 +1,28 @@
[package]
name = "sentryagent-idp"
version = "1.0.0"
edition = "2021"
description = "Production-grade Rust SDK for SentryAgent.ai AgentIdP — agent identity, credentials, and A2A delegation"
authors = ["SentryAgent.ai <sdk@sentryagent.ai>"]
license = "MIT"
repository = "https://github.com/sentryagent/sentryagent-idp"
documentation = "https://docs.rs/sentryagent-idp"
keywords = ["agent", "identity", "oauth2", "ai", "oidc"]
categories = ["authentication", "web-programming::http-client"]
[dependencies]
tokio = { version = "1.35", features = ["full"] }
reqwest = { version = "0.11", features = ["json", "rustls-tls"], default-features = false }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
uuid = { version = "1.6", features = ["v4"] }
thiserror = "1.0"
async-trait = "0.1"
[dev-dependencies]
tokio-test = "0.4"
mockito = "1.2"
[[example]]
name = "quickstart"
path = "examples/quickstart.rs"