oauth2CCAuth implements the OAuth2 client_credentials grant. The token endpoint receives a form-encoded POST with grant_type=client_credentials plus client_id, client_secret, and (optionally) scope. The response must be JSON with at minimum an "access_token" field; "expires_in" (seconds) drives the
| 19 | // must be JSON with at minimum an "access_token" field; "expires_in" |
| 20 | // (seconds) drives the cache TTL when present. |
| 21 | type oauth2CCAuth struct { |
| 22 | cfg AuthConfig |
| 23 | http *http.Client |
| 24 | tok *cachedToken |
| 25 | } |
| 26 | |
| 27 | func (o *oauth2CCAuth) Apply(ctx context.Context, req *http.Request, _ http.Header) error { |
| 28 | tok, err := o.tok.get(ctx, o.fetch) |
nothing calls this directly
no outgoing calls
no test coverage detected