real_userid for admin API requests when admin auth is disabled
(parent context.Context, username string, domain UserIDDomain, roles []string)
| 274 | const UserSyncGatewayAdmin = "admin_noauth" // real_userid for admin API requests when admin auth is disabled |
| 275 | |
| 276 | func 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 | |
| 289 | type RequestData struct { |
| 290 | CorrelationID string |