Skip to main content

validate_requested_scopes

Function validate_requested_scopes 

Source
pub fn validate_requested_scopes(
    requested: &[String],
    server_supported: &[String],
    client_declared: Option<&[String]>,
    require_atproto: bool,
) -> Result<Vec<String>, ScopeError>
Expand description

Validate a requested scope set against the server-supported and (optionally) client-declared scopes (#1113 rev2 finding 4).

Returns the actual granted set (the intersection of requested with the server-supported set, intersected with client_declared when provided), preserving the server’s canonical ordering of the supported scopes.