Expand description
Central, fail-closed scope enforcement for scoped credentials.
Two unrelated credential families carry a scope string:
- Delegated tokens — share links (
file:{file_id}:{R|C|W}) and app publishing (apkg:publish), parsed bycloudillo_types::types::TokenScope. - Capability scopes — the comma-separated
carddav:*/caldav:*list a user types into thescopesfield ofPOST /api/auth/api-keys.
scope_permits is the single decision point for both, called from
crate::middleware::require_auth on every protected request.
Functions§
- has_
scope - Returns
trueiffscopes(comma-separated) contains an exact-match token forneeded. Whitespace around each token is trimmed. - scope_
permits - Whether a credential carrying
scopemay performmethodonpath.