get_roles

Function get_roles 

Source
pub fn get_roles(token: &str) -> Result<Vec<String>, MantaError>
Expand description

Extract the realm_access.roles claim from a JWT token.

Returns an empty Vec when the claim is absent or is not a JSON array of strings. Used by is_user_admin and (downstream) by the per-handler authorization checks in service::authorization inside manta-server.

ยงErrors

Returns MantaError::JwtMalformed when token does not parse as header.payload.signature Base64, or when the payload is not valid UTF-8 JSON.