Net.HTTP.Credentials
What an Authorization header carries (RFC 9110 ยง11.4): a scheme, and the
scheme's own data.
field(Authorization, Option.expect(Credentials.bearer(token), "a token68"))
Credentials never show: show gives <credentials> and debug gives
<Credentials>, so a request that is printed or logged does not leak
them, and the header value they are written as is marked sensitive.
scheme is lowercase, since schemes are case-insensitive. data is the
rest of the field after the space that ends the scheme: a token68 or a list
of parameters, as the scheme defines.
Returns bearer credentials (RFC 6750) for token, which must be a
token68: letters, digits and -._~+/, then perhaps some =.
Returns basic credentials (RFC 7617) for a user and password, encoded as
UTF-8 and then base64. Returns None if user holds a colon, which would
end it early, or either holds a control byte.
credentials = auth-scheme [ 1*SP ( token68 / #auth-param ) ]
The data after the scheme is checked to be a field value, and is kept as
it is; reading it is the scheme's business, as bearerToken and
basicPair do.
Returns the credentials as they are written in the header.
Returns the user and password of basic credentials.