Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryPolicy ¶
type BinaryPolicy bool
BinaryPolicy will make client-id either completely required or completely optional.
func (BinaryPolicy) OnExtraction ¶
func (enforced BinaryPolicy) OnExtraction(ctx context.Context, err error) error
func (BinaryPolicy) OnRetrieval ¶
func (enforced BinaryPolicy) OnRetrieval(ctx context.Context, err error) error
func (BinaryPolicy) OnValidation ¶
func (enforced BinaryPolicy) OnValidation(ctx context.Context, err error) error
type Policy ¶
type Policy interface { // OnExtraction is run after the identifier is extracted from the request OnExtraction(context.Context, error) error // OnRetrieval is run after searching for the identifier in the specificed store OnRetrieval(context.Context, error) error // OnValidation is run after all specified validation steps is run on the found client id OnValidation(context.Context, error) error }
Policy which decides on how errors should be enforced by the middleware. The policy can decide if no error should be returned, or to decorate problems with specific comments that might help the API consumer.
var Default Policy = BinaryPolicy(false)
Default policy is making client id completely optional.
Click to show internal directories.
Click to hide internal directories.