MCPcopy Create free account
hub / github.com/brimdata/super / AuthTokenFromContext

Function AuthTokenFromContext

service/auth/auth.go:36–39  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

34type authTokenKey struct{}
35
36func AuthTokenFromContext(ctx context.Context) (string, bool) {
37 token, ok := ctx.Value(authTokenKey{}).(string)
38 return token, ok
39}
40
41func ContextWithAuthToken(ctx context.Context, token string) context.Context {
42 return context.WithValue(ctx, authTokenKey{}, token)

Callers

nothing calls this directly

Calls 1

ValueMethod · 0.45

Tested by

no test coverage detected