jwtTokenFileCallCreds provides JWT token-based PerRPCCredentials that reads tokens from a file. This implementation follows the A97 JWT Call Credentials specification.
| 37 | // tokens from a file. |
| 38 | // This implementation follows the A97 JWT Call Credentials specification. |
| 39 | type 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. |
nothing calls this directly
no outgoing calls
no test coverage detected