(ctx context.Context, scope string)
| 170 | } |
| 171 | |
| 172 | func 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 |
| 183 | func ClientID(ctx context.Context) (string, bool) { |
searching dependent graphs…