Interface CredentialsProvider
Quarkus extensions MUST invoke the asynchronous variant. that is getCredentialsAsync(String).
The default implementation of asynchronous variant invokes the synchronous getCredentials(String) on a worker
thread.
Note that there is a price to pay for offloading a task to a worker thread.
Nevertheless, if the implementation of the synchronous getCredentials(String) involves blocking APIs, it is the
right thing to do.
Otherwise, it could block an event-loop thread, which
MUST be avoided.
When the implementation does not invoke blocking APIs, prefer overriding the asynchronous
getCredentialsAsync(String), instead of the synchronous variant.
For example, if a provider caches credentials in memory and refreshes them in the background, it is not necessary to switch
to a worker thread to read them.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetCredentials(String credentialsProviderName) Returns the credentials for a given credentials provider.getCredentialsAsync(String credentialsProviderName) Returns the credentials for a given credentials provider.
-
Field Details
-
USER_PROPERTY_NAME
- See Also:
-
PASSWORD_PROPERTY_NAME
- See Also:
-
EXPIRATION_TIMESTAMP_PROPERTY_NAME
- See Also:
-
-
Method Details
-
getCredentials
Returns the credentials for a given credentials provider.- Parameters:
credentialsProviderName- the name of the credentials provider, which can be used to retrieve custom configuration- Returns:
- the credentials
-
getCredentialsAsync
default io.smallrye.mutiny.Uni<Map<String,String>> getCredentialsAsync(String credentialsProviderName) Returns the credentials for a given credentials provider.- Parameters:
credentialsProviderName- the name of the credentials provider, which can be used to retrieve custom configuration- Returns:
- a
Unicompleted with the credentials, or failed
-