#[non_exhaustive]pub enum Scope {
Show 17 variants
ArchRead,
ArchWrite,
BoardRead,
BoardWrite,
CampRead,
CampAdmin,
CloudRead,
CloudDeploy,
CloudDestroy,
CloudAdmin,
PartyRead,
PartyWrite,
SubagentSpawn,
SubagentControl,
OwnershipWrite,
AuditRead,
AuditWrite,
}Expand description
The closed set of MCP scopes — verbatim with W159 §Scope vocabulary.
Each variant maps to one literal wire string via Scope::as_wire.
<category>:admin is distinct from <category>:read/<category>:write:
granting camp:admin does NOT imply camp:read (composition rule (3)).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ArchRead
ArchWrite
BoardRead
BoardWrite
CampRead
CampAdmin
CloudRead
CloudDeploy
CloudDestroy
CloudAdmin
Fleet-operator admin — sees every machine/workload in the cloud
snapshot (the yah-cloud-admin dashboard’s gate; R568-F5). Distinct
from CloudRead (which is the tenant-facing read scope, filtered by
principal ownership).
PartyRead
PartyWrite
SubagentSpawn
SubagentControl
OwnershipWrite
Service-principals only — see validate_grant.
AuditRead
AuditWrite
Service-principals only — see validate_grant.
Implementations§
Source§impl Scope
impl Scope
Sourcepub const ALL: &'static [Scope]
pub const ALL: &'static [Scope]
Every variant in the closed scope vocabulary.
cheers-axum’s OIDC discovery endpoint reads scopes_supported
straight from this constant so the discovery doc cannot drift from
what the mint path accepts. The companion scope_all_is_exhaustive
test below uses an exhaustive intra-crate match against
Scope (which is #[non_exhaustive] for external users but
fully matchable here) — adding a variant without listing it in
ALL either fails to compile (missing match arm) or fails the
per-arm assertion.
Sourcepub const fn is_service_only(self) -> bool
pub const fn is_service_only(self) -> bool
true iff this scope is grantable only to a PrincipalKind::Service
principal — composition rule (4).