added permissive option
This commit is contained in:
parent
70cb4a47ab
commit
0a5b59aa0b
@ -45,6 +45,7 @@ type Options struct {
|
|||||||
TokenString [][]TokenStringOption
|
TokenString [][]TokenStringOption
|
||||||
ClaimsContextKeyName ClaimsContextKeyName
|
ClaimsContextKeyName ClaimsContextKeyName
|
||||||
ErrorHandler ErrorHandler
|
ErrorHandler ErrorHandler
|
||||||
|
Permissive bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// New takes Option setters and returns an Options pointer.
|
// New takes Option setters and returns an Options pointer.
|
||||||
@ -262,3 +263,10 @@ func WithErrorHandler(opt ErrorHandler) Option {
|
|||||||
opts.ErrorHandler = opt
|
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…
Reference in New Issue
Block a user