pub enum RoutePosture {
Public {
reason: String,
},
Authenticated,
Permission {
area: String,
operation: String,
},
Owner {
field: String,
},
Internal {
callers: Vec<String>,
},
ApiKey {
scope: String,
},
Scoped {
area: String,
operation: String,
owner_field: Option<String>,
},
}Expand description
The authorization posture of a custom route, enforced by the platform so a guest handler cannot forget it.
Variants§
Public
Deliberately anonymous. reason is mandatory so every public route is
greppable and reviewable (third-party webhooks, signup, public profiles).
Authenticated
Any authenticated tenant principal.
Permission
Authenticated and holding the {area}:{operation} permission.
Owner
Authenticated; the guest scopes the operation to rows whose field
equals the caller’s subject. The platform enforces authentication.
Internal
Only another service of the tenant, calling through the platform
with a platform-minted identity: callers names the services
allowed, or is ["*"] for any. User credentials are not accepted.
ApiKey
Only a partner key (X-Api-Key) of the tenant holding a scope that
covers scope (resource[:action], resource:* covering every
action). User credentials are not accepted.
Scoped
Authenticated and holding a grant on {area}:{operation}; the
platform resolves the grants’ scopes (@own, @field(…), @all)
into the rows the guest may reach, @own meaning owner_field
holds the caller’s subject.
Implementations§
Source§impl RoutePosture
impl RoutePosture
Sourcepub fn is_anonymous(&self) -> bool
pub fn is_anonymous(&self) -> bool
Whether a caller with no credentials can reach this route.
Sourcepub fn feature(&self) -> Option<&'static str>
pub fn feature(&self) -> Option<&'static str>
The platform feature this posture needs beyond route_posture.
Sourcepub fn admits_caller(callers: &[String], service: &str) -> bool
pub fn admits_caller(callers: &[String], service: &str) -> bool
Whether service may call a route of this posture: listed, or any
service when callers is ["*"].