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

Function AddScope

http/oauth2/oauth2.go:172–180  ·  view source on GitHub ↗
(ctx context.Context, scope string)

Source from the content-addressed store, hash-verified

170}
171
172func AddScope(ctx context.Context, scope string) context.Context {
173 tok, _ := security.GetTokenFromContext(ctx)
174 oauth2token, ok := tok.(*token)
175 if !ok {
176 return ctx
177 }
178 oauth2token.scope = oauth2token.scope.Add(scope)
179 return security.ContextWithToken(ctx, oauth2token)
180}
181
182// ClientID returns the clientID stored in ctx
183func ClientID(ctx context.Context) (string, bool) {

Callers 1

TestAddScopeFunction · 0.85

Calls 3

GetTokenFromContextFunction · 0.92
ContextWithTokenFunction · 0.92
AddMethod · 0.65

Tested by 1

TestAddScopeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…