MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / NewAuthenticator

Function NewAuthenticator

auth/auth.go:85–100  ·  view source on GitHub ↗

Creates a new Authenticator that stores user info in the given Bucket. Uses the default metadataKeys format

(datastore base.DataStore, channelComputer ChannelComputer, options AuthenticatorOptions)

Source from the content-addressed store, hash-verified

83
84// Creates a new Authenticator that stores user info in the given Bucket. Uses the default metadataKeys format
85func NewAuthenticator(datastore base.DataStore, channelComputer ChannelComputer, options AuthenticatorOptions) *Authenticator {
86
87 if len(options.Collections) == 0 {
88 options.Collections = defaultCollectionMap
89 }
90
91 if options.MetaKeys == nil {
92 options.MetaKeys = base.DefaultMetadataKeys
93 }
94
95 return &Authenticator{
96 datastore: datastore,
97 channelComputer: channelComputer,
98 AuthenticatorOptions: options,
99 }
100}
101
102func DefaultAuthenticatorOptions(ctx context.Context) AuthenticatorOptions {
103 return AuthenticatorOptions{

Callers 15

TestCustomCookieNameFunction · 0.92
TestStarAccessFunction · 0.92
TestAllDocsAccessControlFunction · 0.92
AuthenticatorMethod · 0.92
TestGetDeletedFunction · 0.92
TestGetRemovedAsUserFunction · 0.92
TestUpdateDesignDocFunction · 0.92
TestUserFunctionAllowFunction · 0.92

Calls

no outgoing calls

Tested by 14

TestCustomCookieNameFunction · 0.74
TestStarAccessFunction · 0.74
TestAllDocsAccessControlFunction · 0.74
TestGetDeletedFunction · 0.74
TestGetRemovedAsUserFunction · 0.74
TestUpdateDesignDocFunction · 0.74
TestUserFunctionAllowFunction · 0.74