pub struct ScopeAuthorizer { /* private fields */ }Expand description
Coarse ADK scope gate. The runtime policy engine still evaluates the exact action.
Implementations§
Source§impl ScopeAuthorizer
impl ScopeAuthorizer
Sourcepub fn new(scopes: impl IntoIterator<Item = impl Into<String>>) -> Self
pub fn new(scopes: impl IntoIterator<Item = impl Into<String>>) -> Self
Construct a scope gate from verified JWT/OIDC request scopes.
Sourcepub fn from_verified_identity(
principal_id: impl Into<String>,
tenant_id: Option<String>,
scopes: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn from_verified_identity( principal_id: impl Into<String>, tenant_id: Option<String>, scopes: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Construct from identity already verified by adk-auth JWT/OIDC middleware.
Sourcepub fn verified_tenant_id(&self) -> Option<&str>
pub fn verified_tenant_id(&self) -> Option<&str>
Tenant identity already verified by adk-auth middleware. Graph/model state is never consulted for this value.
Verify coarse entitlement without treating it as runtime action approval.
§Errors
Returns AuthorizationError::PrincipalMismatch or
AuthorizationError::TenantMismatch when the context identity differs
from the verified identity, or AuthorizationError::MissingScope when
the required computer:* scope for the requested mode is absent.
Trait Implementations§
Source§impl Clone for ScopeAuthorizer
impl Clone for ScopeAuthorizer
Source§impl Debug for ScopeAuthorizer
impl Debug for ScopeAuthorizer
Auto Trait Implementations§
impl Freeze for ScopeAuthorizer
impl RefUnwindSafe for ScopeAuthorizer
impl Send for ScopeAuthorizer
impl Sync for ScopeAuthorizer
impl Unpin for ScopeAuthorizer
impl UnsafeUnpin for ScopeAuthorizer
impl UnwindSafe for ScopeAuthorizer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more