Interface UserApiKeyAuthProviderClient
-
- All Known Implementing Classes:
UserApiKeyAuthProviderClientImpl
public interface UserApiKeyAuthProviderClient
The user API key authentication provider client. This client is used to manage API keys.
-
-
Field Summary
Fields Modifier and Type Field Description static AuthProviderClientFactory<UserApiKeyAuthProviderClient>
factory
-
Method Summary
Modifier and Type Method Description Task<UserApiKey>
createApiKey(String name)
Creates a user API key that can be used to authenticate as the current user.Task<Void>
deleteApiKey(ObjectId id)
Deletes a user API key associated with the current user.Task<Void>
disableApiKey(ObjectId id)
Disables a user API key associated with the current user.Task<Void>
enableApiKey(ObjectId id)
Enables a user API key associated with the current user.Task<UserApiKey>
fetchApiKey(ObjectId id)
Fetches a user API key associated with the current user.Task<List<UserApiKey>>
fetchApiKeys()
Fetches the user API keys associated with the current user.
-
-
-
Field Detail
-
factory
static final AuthProviderClientFactory<UserApiKeyAuthProviderClient> factory
-
-
Method Detail
-
createApiKey
Task<UserApiKey> createApiKey(@NonNull String name)
Creates a user API key that can be used to authenticate as the current user.- Parameters:
name
- The name of the API key to be created- Returns:
- A
Task
that contains the created API key.
-
fetchApiKey
Task<UserApiKey> fetchApiKey(@NonNull ObjectId id)
Fetches a user API key associated with the current user.- Parameters:
id
- The id of the API key to fetch- Returns:
- A
Task
that contains the fetched API key.
-
fetchApiKeys
Task<List<UserApiKey>> fetchApiKeys()
Fetches the user API keys associated with the current user.- Returns:
- A
Task
that contains the list of the fetched API keys.
-
deleteApiKey
Task<Void> deleteApiKey(@NonNull ObjectId id)
Deletes a user API key associated with the current user.- Parameters:
id
- The id of the API key to delete.- Returns:
- A
Task
that completes when the API key is deleted.
-
enableApiKey
Task<Void> enableApiKey(@NonNull ObjectId id)
Enables a user API key associated with the current user.- Parameters:
id
- The id of the API key to enable.- Returns:
- A
Task
that completes when the API key is enabled.
-
-