iet-auth-rbac
feature policy official
Decides permissions from a selected role store; no embedded storage.
CoreFeaturesIntegrationsStacksTooling
Used bynothing in the repository
iet-auth-rbacpolicyRBAC policyDepends oniet-telemetrycontractiet-corecontractiet-authzcontract
How to use it
iet-auth-rbac is an Authorizer that decides named permissions from a selected role store. It extracts the Principal from the CallContext and delegates the allow/deny decision to a RoleStore, so role storage lives in a separate adapter crate and can be swapped without touching call sites.
// crates/features/iet-auth-rbac/tests/rbac.rs
use Rbac;
use ;
use ;
;
let context = CallContext ;
Rbac.authorize.await?;
assert!;
- No principal (or an empty subject) fails with
auth.required; a denied permission yieldsauthz.denied(Forbidden). - A store error remains an error rather than a denial, so callers can tell "no" apart from "backend down".
- Composes with
iet_authz::{All, Any}and the default-denyDenyPermissions.
How it works
authorize resolves the Principal from the CallContext, rejects an empty or oversized permission, and delegates the allow-or-deny decision to the RoleStore; a store error stays an error.
sequenceDiagram
participant C as "Caller"
participant R as "Rbac"
participant S as "RoleStore"
C->>R: "authorize context permission"
alt "checks fail"
R-->>C: "auth.required or authz.denied"
else "checks pass"
R->>S: "allows identity permission"
S-->>R: "bool"
alt "allowed"
R-->>C: "Ok"
else "denied or error"
R-->>C: "authz.denied or error"
end
endWhat it implements
- Implements
iet_authz::Authorizerfromiet-authz.
What's inside
Modules
src/lib.rs
Public API
(root)
- struct
Rbac
Impl map
Authorizer for Rbac<S>RoleStore for Store
Depends on
Used by
- No other framework crate depends on it directly.
In this repository
- Not used by a checked-in example yet.
Source: crates/features/iet-auth-rbac