MCPcopy Create free account
hub / github.com/pace/bricks / Scopes

Function Scopes

http/oauth2/oauth2.go:163–170  ·  view source on GitHub ↗

Scopes returns the scopes stored in ctx

(ctx context.Context)

Source from the content-addressed store, hash-verified

161
162// Scopes returns the scopes stored in ctx
163func Scopes(ctx context.Context) []string {
164 tok, _ := security.GetTokenFromContext(ctx)
165 oauth2token, ok := tok.(*token)
166 if !ok {
167 return []string{}
168 }
169 return oauth2token.scope.toSlice()
170}
171
172func AddScope(ctx context.Context, scope string) context.Context {
173 tok, _ := security.GetTokenFromContext(ctx)

Callers 3

getEventFunction · 0.92
TestSuccessfulAccessorsFunction · 0.85

Calls 2

GetTokenFromContextFunction · 0.92
toSliceMethod · 0.80

Tested by 2

TestSuccessfulAccessorsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…