Function rustream::squire::authenticator::extract_credentials
source · fn extract_credentials(
authorization: &HeaderValue,
) -> Result<Credentials, &'static str>Expand description
Extracts credentials from the authorization header in the following steps
§Arguments
authorization- An optionalHeaderValuecontaining the authorization header.
§See Also
- Decodes the base64 encoded header
- Splits it into 3 parts with first one being the username followed by the signature and timestamp
- Converts the username from hex into a string.
§Returns
Returns a Result containing the extracted Credentials or an error message if extraction fails.