Supplies the bearer token for each request, refreshing it as needed.
Stable since #1818: OpenAICompatibleClient.Credential.Dynamic takes one. An implementation should return a failure as a Left rather than throw; a client that calls it turns a thrown exception into an AuthenticationError all the same.
One of three sibling suppliers of a credential, each with the one method current(): ApiKeyProvider (an API key), this (a bearer token) and IdentityTokenProvider (the identity token a token exchange presents).
Reports that the server rejected rejected. A provider that caches drops the cached token only if it is that token, so concurrent calls that all saw a 401 for the same token cause one refresh, and a late report about an older token does not discard a newer one.
Reports that the server rejected rejected. A provider that caches drops the cached token only if it is that token, so concurrent calls that all saw a 401 for the same token cause one refresh, and a late report about an older token does not discard a newer one.
Does nothing by default, which suits a provider that caches nothing: every current call then asks afresh. With it defaulted the trait has one abstract method, so a lambda is a provider: () => readToken().map(Secret.token).