NewOAuthAuthorizerFromConfig creates a new authorizer based on an OAuth 2.0 config.
(config *oauth2.Config, token *oauth2.Token)
| 70 | |
| 71 | // NewOAuthAuthorizerFromConfig creates a new authorizer based on an OAuth 2.0 config. |
| 72 | func 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. |
no outgoing calls
no test coverage detected