MCPcopy
hub / github.com/dosco/graphjin / oauth2CCAuth

Struct oauth2CCAuth

core/openapi/auth_token.go:21–25  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

19// must be JSON with at minimum an "access_token" field; "expires_in"
20// (seconds) drives the cache TTL when present.
21type oauth2CCAuth struct {
22 cfg AuthConfig
23 http *http.Client
24 tok *cachedToken
25}
26
27func (o *oauth2CCAuth) Apply(ctx context.Context, req *http.Request, _ http.Header) error {
28 tok, err := o.tok.get(ctx, o.fetch)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected