WithScope returns a new Authorizer with the same TokenIntrospecter and the same Config that also checks the scope of a request
(tok string)
| 43 | |
| 44 | // WithScope returns a new Authorizer with the same TokenIntrospecter and the same Config that also checks the scope of a request |
| 45 | func (a *Authorizer) WithScope(tok string) *Authorizer { |
| 46 | return &Authorizer{introspection: a.introspection, config: a.config, scope: Scope(tok)} |
| 47 | } |
| 48 | |
| 49 | // Authorize authorizes a request with an introspection and validates the scope |
| 50 | // Success: returns context with the introspection result and true |