Expand description
§adk-auth
Access control and authentication for ADK-Rust.
§Overview
This crate provides enterprise-grade access control:
Permission- Tool and agent permissionsRole- Role with allow/deny rulesAccessControl- Permission checkingScopeGuard- Declarative scope-based tool authorizationAuditSink- Audit logging trait
§Features
sso- Enable SSO/OAuth/OIDC supportauth-bridge- Enable JWT request context extraction foradk-server
§Quick Start
ⓘ
use adk_auth::{Permission, Role, AccessControl};
let admin = Role::new("admin")
.allow(Permission::AllTools)
.allow(Permission::AllAgents);
let user = Role::new("user")
.allow(Permission::Tool("search".into()))
.deny(Permission::Tool("code_exec".into()));
let ac = AccessControl::builder()
.role(admin)
.role(user)
.assign("alice@example.com", "admin")
.build()?;
ac.check("alice@example.com", &Permission::AllTools)?;Re-exports§
pub use scope::ContextScopeResolver;pub use scope::ScopeDenied;pub use scope::ScopeGuard;pub use scope::ScopeResolver;pub use scope::ScopeToolExt;pub use scope::ScopedTool;pub use scope::ScopedToolDyn;pub use scope::StaticScopeResolver;pub use scope::check_scopes;
Modules§
- scope
- Scope-based access control for tools.
Structs§
- Access
Control - Access control for checking permissions.
- Access
Control Builder - Builder for AccessControl.
- Access
Denied - Error returned when access is denied.
- Audit
Event - An audit event.
- Auth
Middleware - A collection of auth utilities for integrating with ADK.
- File
Audit Sink - File-based audit sink that writes JSONL.
- Protected
Tool - A tool wrapper that enforces access control and optionally logs audit events.
- Protected
Tool Dyn - Dynamic version of
ProtectedToolforArc<dyn Tool>. - Role
- A role with a set of allowed and denied permissions.
Enums§
- Audit
Event Type - Type of audit event.
- Audit
Outcome - Outcome of an audit event.
- Auth
Error - General auth error.
- Permission
- Permission for accessing tools or agents.