added permissive option
This commit is contained in:
parent
70cb4a47ab
commit
0a5b59aa0b
1 changed files with 8 additions and 0 deletions
|
|
@ -45,6 +45,7 @@ type Options struct {
|
|||
TokenString [][]TokenStringOption
|
||||
ClaimsContextKeyName ClaimsContextKeyName
|
||||
ErrorHandler ErrorHandler
|
||||
Permissive bool
|
||||
}
|
||||
|
||||
// New takes Option setters and returns an Options pointer.
|
||||
|
|
@ -262,3 +263,10 @@ func WithErrorHandler(opt ErrorHandler) Option {
|
|||
opts.ErrorHandler = opt
|
||||
}
|
||||
}
|
||||
|
||||
// WithPermissive allows incoming requests to pass even if the client does not provide a token.
|
||||
func WithPermissive(opt bool) Option {
|
||||
return func(opts *Options) {
|
||||
opts.Permissive = opt
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue