MCPcopy Create free account
hub / github.com/clouditor/clouditor / NewOAuthAuthorizerFromConfig

Function NewOAuthAuthorizerFromConfig

api/authorizer.go:72–78  ·  view source on GitHub ↗

NewOAuthAuthorizerFromConfig creates a new authorizer based on an OAuth 2.0 config.

(config *oauth2.Config, token *oauth2.Token)

Source from the content-addressed store, hash-verified

70
71// NewOAuthAuthorizerFromConfig creates a new authorizer based on an OAuth 2.0 config.
72func NewOAuthAuthorizerFromConfig(config *oauth2.Config, token *oauth2.Token) Authorizer {
73 var authorizer = &oauthAuthorizer{
74 TokenSource: config.TokenSource(context.Background(), token),
75 }
76
77 return authorizer
78}
79
80// GetRequestMetadata is an implementation for credentials.PerRPCCredentials. It is called before
81// each RPC request and is used to inject our client credentials into the context of the RPC call.

Callers 3

NewSessionFunction · 0.92
UnmarshalJSONMethod · 0.92
PrepareSessionFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected