2020-07-22 00:14:28 -04:00
|
|
|
package auth
|
|
|
|
|
|
|
|
|
|
import "context"
|
|
|
|
|
|
|
|
|
|
// DisabledAuthTestContext is meant for testing, and uses a context that has auth checking entirely disabled
|
2020-07-22 15:10:44 -04:00
|
|
|
func DisabledAuthTestContext(opt ...Option) context.Context {
|
2020-07-22 00:14:28 -04:00
|
|
|
reqInfo := RequestInfo{DisableAuthEntirely: true}
|
|
|
|
|
opts := getOpts(opt...)
|
2020-09-14 12:30:11 -04:00
|
|
|
reqInfo.scopeIdOverride = opts.withScopeId
|
2020-08-13 17:39:48 -04:00
|
|
|
reqInfo.userIdOverride = opts.withUserId
|
2020-08-24 13:22:10 -04:00
|
|
|
return NewVerifierContext(context.Background(), nil, nil, nil, nil, opts.withKms, reqInfo)
|
2020-07-22 00:14:28 -04:00
|
|
|
}
|