Files
threshold/internal/auth/testing.go
T

12 lines
459 B
Go
Raw Normal View History

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
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
reqInfo.userIdOverride = opts.withUserId
return NewVerifierContext(context.Background(), nil, nil, nil, nil, opts.withKms, reqInfo)
2020-07-22 00:14:28 -04:00
}