Documentation
¶
Overview ¶
Package authn contains the bounded parsing primitives the jwt package shares. Protocol-specific algorithm and key policy does not belong in this package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidSize = errors.New("authn: invalid size") ErrInvalidEncoding = errors.New("authn: invalid encoding") ErrLimitExceeded = errors.New("authn: limit exceeded") )
var ( ErrMalformedJSON = errors.New("authn: malformed JSON") ErrDuplicateJSON = errors.New("authn: duplicate JSON member") )
Functions ¶
func DecodeBase64URL ¶
DecodeBase64URL strictly decodes canonical, unpadded Base64url.
Canonicality used to be checked by re-encoding the result and comparing, which copied every segment twice more. DecodeString already rejects padding, wrong lengths, and bytes outside the alphabet, with two exceptions this function closes itself: it skips \r and \n instead of failing, and it accepts a final quantum whose unused low bits are not zero. The exhaustive test in this package holds the sum of these checks equal to the re-encoding oracle.
func ValidateJSON ¶
func ValidateJSON(data []byte, options JSONOptions) error
ValidateJSON validates exactly one JSON value and rejects duplicate object members at every nesting level.