Skip to main content

check_authorization_tokens

Function check_authorization_tokens 

Source
fn check_authorization_tokens(
    parameters: &[KeyValuePair],
) -> Result<(), CodecError>
Expand description

Hold every AUTHORIZATION TOKEN parameter to the Token structure it names.

Draft-11 states the general rule alone, in Section 1.3.2: “If a receiver understands a Type, and the following Value or Length/Value does not match the serialization defined by that Type, the receiver MUST terminate the session with error code ‘Key-Value Formatting Error’.” The Token is the one value in this draft whose serialization is a structure rather than opaque bytes, so it is the one the rule has anything to say about.

The type is 0x01 here, and only in the version-specific namespace. A setup 0x01 on this draft is a PATH, whose value is opaque bytes; reading one as a Token would refuse paths the draft permits. Draft-12 renumbered the token to 0x03 and added it to the setup namespace, where the two stop colliding.

A type this draft cannot name is left alone. The rule is conditional on the receiver understanding the Type, and an extension’s parameter carries bytes no rule here describes.