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

Method AddBucketUserLogContext

db/database.go:2173–2182  ·  view source on GitHub ↗

AddBucketUserLogContext adds bucket user to the parent context for logging. This is used to mark actions not caused by a user.

(ctx context.Context)

Source from the content-addressed store, hash-verified

2171
2172// AddBucketUserLogContext adds bucket user to the parent context for logging. This is used to mark actions not caused by a user.
2173func (dbCtx *DatabaseContext) AddBucketUserLogContext(ctx context.Context) context.Context {
2174 spec := dbCtx.BucketSpec
2175 // Server is empty in testing only
2176 if spec.Server == "" || spec.IsWalrusBucket() {
2177 return base.UserLogCtx(ctx, "rosmar_noauth", base.UserDomainBuiltin, nil)
2178 }
2179 username, _, _ := dbCtx.BucketSpec.Auth.GetCredentials()
2180 return base.UserLogCtx(ctx, username, base.UserDomainBuiltin, nil)
2181
2182}
2183
2184// onlyDefaultCollection is true if the database is only configured with default collection.
2185func (dbCtx *DatabaseContext) OnlyDefaultCollection() bool {

Callers 2

StartOnlineProcessesMethod · 0.95
connectFunction · 0.80

Calls 3

UserLogCtxFunction · 0.92
IsWalrusBucketMethod · 0.80
GetCredentialsMethod · 0.65

Tested by

no test coverage detected