MCPcopy Create free account
hub / github.com/cloudbase/garm / UserID

Function UserID

auth/context.go:304–310  ·  view source on GitHub ↗

UserID returns the userID from the context

(ctx context.Context)

Source from the content-addressed store, hash-verified

302
303// UserID returns the userID from the context
304func UserID(ctx context.Context) string {
305 userID := ctx.Value(UserIDFlag)
306 if userID == nil {
307 return ""
308 }
309 return userID.(string)
310}
311
312// GetAdminContext will return an admin context. This can be used internally
313// when fetching users.

Callers 7

SetupTestMethod · 0.92
SetupTestMethod · 0.92
getUIDFromContextFunction · 0.92
SetupTestMethod · 0.92
NewClientFunction · 0.92
NewHandlerFunction · 0.92
GetJWTTokenMethod · 0.85

Calls

no outgoing calls

Tested by 3

SetupTestMethod · 0.74
SetupTestMethod · 0.74
SetupTestMethod · 0.74