Description
Is your feature request related to a problem? Please describe.
I have a token
string and I would like to create TokenCredential
from it.
The proposed solution from the library is implementing a functional interface directly:
TokenCredential {
Mono.just(AccessToken(token, OffsetDateTime.parse(tokenExpiresAt)))
}
The problem is that we have to add Project Reactor to our dependencies. And we would like to avoid it.
Describe the solution you'd like
It will be good to utilize some builder to be consistent with other methods (e.g. ClientSecretCredentialBuilder
).
The solution is adding TokenCredentialBuilder
that we can import without importing Reactor directly. That can hide implementation details from client code.
TokenCredentialBuilder
should just provide methods to set the token:
val token: TokenCredential = TokenCredentialBuilder()
.token(token)
.expiresAt(expiresAt)
.build()
A similar request is described here: #7480 .
We don't need a TokenCredential we just need a convenient API that can encapsulate implementation details and don't force using Reactor lib in our services just to invoke Mono.just(AccessToken(token, OffsetDateTime.parse(tokenExpiresAt)))
once.
Metadata
Labels
Type
Projects
Status
Done