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

Method WithScope

http/oauth2/authorizer.go:45–47  ·  view source on GitHub ↗

WithScope returns a new Authorizer with the same TokenIntrospecter and the same Config that also checks the scope of a request

(tok string)

Source from the content-addressed store, hash-verified

43
44// WithScope returns a new Authorizer with the same TokenIntrospecter and the same Config that also checks the scope of a request
45func (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

Implementers 2

Authorizerhttp/security/apikey/authorizer.go
Authorizerhttp/oauth2/authorizer.go

Calls 1

ScopeTypeAlias · 0.85

Tested by 2