Skip to main content

narrow_scope

Function narrow_scope 

Source
pub fn narrow_scope(
    requested: &str,
    strict: bool,
) -> Result<(String, Option<String>)>
Expand description

Narrow a requested scope to the granted scope (RFC 6749 §3.3): keep the tokens this server recognises and return them alongside the MSC2967 device id, when one was requested. Unrecognised tokens are dropped, or rejected when strict is set. A request carrying more than one device scope, or a device id outside the RFC 3986 unreserved set, is always rejected.