MCPcopy
hub / github.com/grpc/grpc-go / jwtTokenFileCallCreds

Struct jwtTokenFileCallCreds

credentials/jwt/token_file_call_creds.go:39–51  ·  view source on GitHub ↗

jwtTokenFileCallCreds provides JWT token-based PerRPCCredentials that reads tokens from a file. This implementation follows the A97 JWT Call Credentials specification.

Source from the content-addressed store, hash-verified

37// tokens from a file.
38// This implementation follows the A97 JWT Call Credentials specification.
39type jwtTokenFileCallCreds struct {
40 fileReader *jwtFileReader
41 backoffStrategy backoff.Strategy
42
43 // cached data protected by mu
44 mu sync.Mutex
45 cachedAuthHeader string // "Bearer " + token
46 cachedExpiry time.Time // Slightly less than actual expiration time
47 cachedError error // Error from last failed attempt
48 retryAttempt int // Current retry attempt number
49 nextRetryTime time.Time // When next retry is allowed
50 pendingRefresh bool // Whether a refresh is currently in progress
51}
52
53// NewTokenFileCallCredentials creates PerRPCCredentials that reads JWT tokens
54// from the specified file path.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected