add new defaults

This commit is contained in:
Darko Luketic 2021-11-17 11:11:55 +01:00
parent b0d46aaec3
commit 80a4493f22

View File

@ -15,6 +15,9 @@ type ErrorsContextKeyName string
// DefaultClaimsContextKeyName is of type ClaimsContextKeyName and defaults to "claims"
const DefaultClaimsContextKeyName ClaimsContextKeyName = "claims"
// DefaultErrorsContextKeyName is of type ErrorsContextKeyName and defaults to "oidcerrors"
const DefaultErrorsContextKeyName ErrorsContextKeyName = "oidcerrors"
// ErrorHandler is called by the middleware if not nil
type ErrorHandler func(description ErrorDescription, err error)
@ -62,6 +65,8 @@ func New(setters ...Option) *Options {
AllowedTokenDrift: 10 * time.Second,
HttpClient: http.DefaultClient,
ClaimsContextKeyName: DefaultClaimsContextKeyName,
Permissive: false,
ErrorsContextKeyName: DefaultErrorsContextKeyName,
}
for _, setter := range setters {