Expand description
AXIAM SDK for Rust
This crate provides the official Rust client SDK for AXIAM
(Access eXtended Identity and Authorization Management), a multi-tenant
IAM solution. It conforms to the cross-language SDK behavioral contract
in ../CONTRACT.md §1–§11, and offers three interchangeable transports
behind Cargo features:
rest—client::AxiamClient, built onreqwest; cookie-based sessions with CSRF double-submit protection (§3/§4).grpc—grpc::AuthzGrpcClient, for low-latency authorization checks from a service mesh.amqp—amqp, a closure-handler consumer for HMAC-signed, replay-protected authorization/audit messages (§8), plusamqp::reactor— the §22 reactor runtime, where the same HMAC runs in both directions: the server signs the hook event, and the reactor signs the allow/deny/mutate reply.
An additional actix feature provides middleware::AxiamUser, an
Actix-Web extractor that verifies sessions locally against a cached JWKS
(§10). The macros feature adds the §11 declarative authorization
helpers — the require_access, require_auth and
require_role attribute macros — layered on top of that extractor.
All access/refresh tokens are wrapped in Sensitive so they are never
accidentally logged or displayed.
§Example: login then check access (REST transport)
use axiam_sdk::client::AxiamClient;
let client = AxiamClient::builder()
.base_url("https://axiam.example.com")?
.tenant_slug("acme")
.org_slug("acme")
.build()?;
client.login("user@example.com", "hunter2").await?;
let allowed = client
.can("read", "resource-uuid".parse().unwrap(), None)
.await?;Modules§
- amqp
- AMQP transport (owned by 16-04): HMAC sign/verify, closure-handler
consumer,
AuthzRequest/AuditEventMessageDTOs. - client
AxiamClient+ builder (owned by 16-02): tenant-scoped client construction, base URL, timeouts, custom CA.- cookies
- The per-client cookie store, and the one place a browser build differs. The cookie store, and the one place the browser’s differs from everyone else’s.
- grpc
- gRPC transport: shared
tonic::Channel, auth + tenant interceptor,check_access/batch_checkclient methods, and the build.rs/buf- generated stubs undersrc/gen/. - management
- The AXIAM management API — CONTRACT.md §27.
- middleware
- Actix-Web middleware (owned by 16-05):
FromRequestextractorAxiamUser. - oidc
- OIDC / SSO relying-party helpers — CONTRACT.md §12 (contract 1.38).
- rest
- REST transport (owned by 16-02):
AxiamClient+ builder, login/MFA/ refresh/logout,check_access/batch_check. - ssf
- The SSF receiver helper — CONTRACT.md §32.7 (contract 1.56).
- supported_
versions - The range of Rust toolchains this SDK is built and tested against.
- telemetry
- Telemetry hooks — CONTRACT.md §19.
- time
- CONTRACT.md §23 Secure Remote Password — the protocol half, with no I/O.
Clock types that work on wasm32 as well as native — see the module docs for
why
std::timecannot be used directly. Clock types that work on every target the SDK builds for. - token
- Token management (owned by 16-02):
TokenManager, single-flight refresh guard, and local JWKS verification. - uma
- UMA 2.0 — Protection API and ticket grant. CONTRACT.md §20 (contract 1.10).
- webhook
- Webhook signature verification (CONTRACT.md §13, T-145).
Macros§
- manifest
- Declare a
ManagementManifestas a flat list of statements.
Structs§
- OAuth
Protocol Error - An RFC 6749 protocol error returned by an
/oauth2/*endpoint as anOAuth2ErrorResponsebody (CONTRACT.md §2 sub-type table, §12.3 rule 3). - Sensitive
- Wraps a sensitive value (e.g. an access or refresh token) so it can never be printed, logged, or serialized in its raw form.
Enums§
- Authz
Kind - Why an
AxiamError::Authzwas raised (CONTRACT.md §27.4 rule 7). - Axiam
Error - The unified error type returned by all fallible operations in this SDK.
- IdToken
Failure Reason - The seven stable reason codes CONTRACT.md §12.3 rule 3 defines for
ID-token validation failures (§12.4 checklist), one per rule.
Surfaced via
AxiamError::id_token_failure_reason.Displayrenders the exact wire spelling the contract fixes (e.g.invalid_alg). - SetFailure
Reason - Why the CONTRACT.md §32.7 receiver helper refused a Security Event Token,
one code per step of its verification order. Surfaced via
AxiamError::set_failure_reason.
Attribute Macros§
- reactor_
handler - Bind an
async fnto one reactor hook event (CONTRACT.md §22.14). - require_
access - Require the authenticated caller to pass an AXIAM authorization check on an
Actix-Web handler (CONTRACT.md §11
require_access). - require_
auth - Require an authenticated AXIAM identity on an Actix-Web handler
(CONTRACT.md §11
require_auth). - require_
role - Require one of a set of roles on an Actix-Web handler (CONTRACT.md §11
require_role).