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

Function UserLogCtx

base/logging_context.go:276–287  ·  view source on GitHub ↗

real_userid for admin API requests when admin auth is disabled

(parent context.Context, username string, domain UserIDDomain, roles []string)

Source from the content-addressed store, hash-verified

274const UserSyncGatewayAdmin = "admin_noauth" // real_userid for admin API requests when admin auth is disabled
275
276func UserLogCtx(parent context.Context, username string, domain UserIDDomain, roles []string) context.Context {
277 newCtx := getLogCtx(parent)
278 newCtx.Username = username
279 newCtx.UserDomain = domain
280 if len(roles) > 0 {
281 newCtx.UserRolesForAuditFiltering = make(map[string]struct{}, len(roles))
282 for _, role := range roles {
283 newCtx.UserRolesForAuditFiltering[role] = struct{}{}
284 }
285 }
286 return LogContextWith(parent, &newCtx)
287}
288
289type RequestData struct {
290 CorrelationID string

Callers 9

checkPublicAuthMethod · 0.92
getCollectionMethod · 0.92
createNewTestDocumentFunction · 0.92
connectFunction · 0.92
BenchmarkAuditFieldworkFunction · 0.85

Calls 2

getLogCtxFunction · 0.85
LogContextWithFunction · 0.85

Tested by 3

getCollectionMethod · 0.74
createNewTestDocumentFunction · 0.74
BenchmarkAuditFieldworkFunction · 0.68