Reads a named token from a shared file cache and refreshes it through another bearer when required.
The first fetch prefers a valid cache entry. After an authentication error, the receiver checks the file again, then asks the wrapped bearer for a fresh token and writes it back. The wrapped bearer must have a stable name.
Returns a JSON-safe value for logs.
Creates a file-backed cache layer.
throttleMs limits how often this process checks the shared file.
safetyMarginMs rejects a token that is too close to expiration.
Optionallogger: LoggerOptionalmetrics: AuthMetricsInputOptionalprovider: stringReadonly$typeContains the fully qualified runtime type name.
ReadonlymetricsContains the metrics.
Minimum remaining lifetime required to accept the first cached token, in milliseconds.
Returns the provider name for authorization metrics.
Returns the stable credential name used by file-backed token caches.
Most bearers do not have a name. Wrappers can add one with NamedBearer.
Returns the wrapped bearer.
Returns a JSON-safe value for logs.
Stops owned background work and closes the wrapped bearer.
OptionalgraceMs: numberCreates a token receiver.
Reads a named token from a shared file cache and refreshes it through another bearer when required.
The first fetch prefers a valid cache entry. After an authentication error, the receiver checks the file again, then asks the wrapped bearer for a fresh token and writes it back. The wrapped bearer must have a stable name.