Package io.quarkus.vault.runtime
Class VaultTOTPManager
- java.lang.Object
-
- io.quarkus.vault.runtime.VaultTOTPManager
-
- All Implemented Interfaces:
VaultTOTPSecretReactiveEngine
@ApplicationScoped public class VaultTOTPManager extends Object implements VaultTOTPSecretReactiveEngine
-
-
Constructor Summary
Constructors Constructor Description VaultTOTPManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.smallrye.mutiny.Uni<Optional<KeyDefinition>>createKey(String name, CreateKeyParameters createKeyParameters)Creates or updates a key definition.io.smallrye.mutiny.Uni<Void>deleteKey(String name)Deletes the key definition.io.smallrye.mutiny.Uni<String>generateCode(String name)Generates a new time-based one-time use password based on the named key.io.smallrye.mutiny.Uni<List<String>>listKeys()Returns a list of available keys.io.smallrye.mutiny.Uni<KeyConfiguration>readKey(String name)Queries the key definition.io.smallrye.mutiny.Uni<Boolean>validateCode(String name, String code)Validates a time-based one-time use password generated from the named key.
-
-
-
Method Detail
-
createKey
public io.smallrye.mutiny.Uni<Optional<KeyDefinition>> createKey(String name, CreateKeyParameters createKeyParameters)
Description copied from interface:VaultTOTPSecretReactiveEngineCreates or updates a key definition.- Specified by:
createKeyin interfaceVaultTOTPSecretReactiveEngine- Parameters:
name- of the key.createKeyParameters- required to create or update a key.- Returns:
- Barcode and/or URL of the created OTP key.
-
readKey
public io.smallrye.mutiny.Uni<KeyConfiguration> readKey(String name)
Description copied from interface:VaultTOTPSecretReactiveEngineQueries the key definition.- Specified by:
readKeyin interfaceVaultTOTPSecretReactiveEngine- Parameters:
name- of the key.- Returns:
- The key configuration.
-
listKeys
public io.smallrye.mutiny.Uni<List<String>> listKeys()
Description copied from interface:VaultTOTPSecretReactiveEngineReturns a list of available keys. Only the key names are returned, not any values.- Specified by:
listKeysin interfaceVaultTOTPSecretReactiveEngine- Returns:
- List of available keys.
-
deleteKey
public io.smallrye.mutiny.Uni<Void> deleteKey(String name)
Description copied from interface:VaultTOTPSecretReactiveEngineDeletes the key definition.- Specified by:
deleteKeyin interfaceVaultTOTPSecretReactiveEngine- Parameters:
name- of the key.
-
generateCode
public io.smallrye.mutiny.Uni<String> generateCode(String name)
Description copied from interface:VaultTOTPSecretReactiveEngineGenerates a new time-based one-time use password based on the named key.- Specified by:
generateCodein interfaceVaultTOTPSecretReactiveEngine- Parameters:
name- of the key.- Returns:
- The Code.
-
validateCode
public io.smallrye.mutiny.Uni<Boolean> validateCode(String name, String code)
Description copied from interface:VaultTOTPSecretReactiveEngineValidates a time-based one-time use password generated from the named key.- Specified by:
validateCodein interfaceVaultTOTPSecretReactiveEngine- Parameters:
name- of the key.code- to validate.- Returns:
- True if valid, false otherwise.
-
-