Class VaultAppRoleAuthService


  • @ApplicationScoped
    public class VaultAppRoleAuthService
    extends Object
    This service provides programmatic access to the AppRole auth method. This may be used by admin clients that provision Vault for use from Kubernetes.
    • Method Detail

      • getAppRoles

        public List<String> getAppRoles()
        Get the names of the existing AppRole vault roles.
        Returns:
        the role names
      • createOrUpdateAppRole

        public void createOrUpdateAppRole​(String name,
                                          VaultAppRoleAuthRole appRole)
        Create or update a vault appRole.
        Parameters:
        name - appRole name
        appRole - appRole attributes
      • deleteAppRole

        public void deleteAppRole​(String name)
        Delete a vault appRole through its name.
        Parameters:
        name - appRole name to delete
      • getAppRole

        public VaultAppRoleAuthRole getAppRole​(String name)
        Returns the definition of a vault appRole.
        Parameters:
        name - appRole name
        Returns:
        the vault appRole
      • getAppRoleRoleId

        public String getAppRoleRoleId​(String name)
        Get vault approle role id.
        Parameters:
        name - appRole name
        Returns:
        the appRole role Id
      • setAppRoleRoleId

        public void setAppRoleRoleId​(String name,
                                     String roleId)
        Set vault approle role id.
        Parameters:
        name - appRole name
        roleId - appRole roleId
      • createNewSecretId

        public VaultAppRoleSecretId createNewSecretId​(String name,
                                                      VaultAppRoleSecretIdRequest newSecretIdRequest)
        Generate a new secretId for vault appRole with given name.
        Parameters:
        name - appRole name
        newSecretIdRequest - new secretId attributes
        Returns:
        the newly created secretId
      • createCustomSecretId

        public VaultAppRoleSecretId createCustomSecretId​(String name,
                                                         VaultAppRoleSecretIdRequest newSecretIdRequest)
        Create a custom secretId for vault appRole with given name.
        Parameters:
        name - appRole name
        newSecretIdRequest - new secretId attributes
        Returns:
        the newly created secretId
      • getSecretIdAccessors

        public List<String> getSecretIdAccessors​(String name)
        Get the keys of existing AppRole secretId accessors for vault appRole with given name.
        Parameters:
        name - appRole name
        Returns:
        the secretId accessors keys
      • getSecretIdAccessor

        public VaultAppRoleSecretIdAccessor getSecretIdAccessor​(String name,
                                                                String accessorId)
        Get AppRole secretId accessor for vault appRole with given name and secret accessor id.
        Parameters:
        name - the name appRole name
        accessorId - the secret accessor id
        Returns:
        the SecretId accessor details
      • deleteSecretIdAccessor

        public void deleteSecretIdAccessor​(String name,
                                           String accessorId)
        Delete AppRole secretId accessor for given vault appRole name and secret accessor id.
        Parameters:
        name - the name appRole name
        accessorId - the secret accessor id
      • getSecretId

        public VaultAppRoleSecretIdAccessor getSecretId​(String name,
                                                        String secretId)
        Get AppRole secretId for vault appRole with given name and secret id.
        Parameters:
        name - the name appRole name
        secretId - the secret id
        Returns:
        the SecretId accessor details
      • deleteSecretId

        public void deleteSecretId​(String name,
                                   String secretId)
        Delete AppRole secretId for given vault appRole name and secret Id.
        Parameters:
        name - the name appRole name
        secretId - the secret id