Class ReactiveCredHubCredentialTemplate

java.lang.Object
org.springframework.credhub.core.credential.ReactiveCredHubCredentialTemplate
All Implemented Interfaces:
ReactiveCredHubCredentialOperations

public class ReactiveCredHubCredentialTemplate extends Object implements ReactiveCredHubCredentialOperations
Implements the interactions with CredHub to save, retrieve, and delete credentials.
Author:
Scott Frederick
  • Constructor Details

  • Method Details

    • write

      public <T> reactor.core.publisher.Mono<CredentialDetails<T>> write(CredentialRequest<T> credentialRequest)
      Description copied from interface: ReactiveCredHubCredentialOperations
      Write a new credential to CredHub, or overwrite an existing credential with a new value.
      Specified by:
      write in interface ReactiveCredHubCredentialOperations
      Type Parameters:
      T - the credential implementation type
      Parameters:
      credentialRequest - the credential to write to CredHub; must not be null
      Returns:
      the details of the written credential
    • generate

      public <T, P> reactor.core.publisher.Mono<CredentialDetails<T>> generate(ParametersRequest<P> parametersRequest, Class<T> credentialType)
      Description copied from interface: ReactiveCredHubCredentialOperations
      Generate a new credential in CredHub, or overwrite an existing credential with a new generated value.
      Specified by:
      generate in interface ReactiveCredHubCredentialOperations
      Type Parameters:
      T - the credential implementation type
      P - the credential parameter implementation type
      Parameters:
      parametersRequest - the parameters of the new credential to generate in CredHub; must not be null
      credentialType - the type of the credential to be regenerated; must not be null
      Returns:
      the details of the generated credential
    • regenerate

      public <T> reactor.core.publisher.Mono<CredentialDetails<T>> regenerate(CredentialName name, Class<T> credentialType)
      Description copied from interface: ReactiveCredHubCredentialOperations
      Regenerate a credential in CredHub. Only credentials that were previously generated can be re-generated.
      Specified by:
      regenerate in interface ReactiveCredHubCredentialOperations
      Type Parameters:
      T - the credential implementation type
      Parameters:
      name - the name of the credential; must not be null
      credentialType - the type of the credential to be regenerated; must not be null
      Returns:
      the details of the regenerated credential
    • getById

      public <T> reactor.core.publisher.Mono<CredentialDetails<T>> getById(String id, Class<T> credentialType)
      Description copied from interface: ReactiveCredHubCredentialOperations
      Retrieve a credential using its ID, as returned in a write request.
      Specified by:
      getById in interface ReactiveCredHubCredentialOperations
      Type Parameters:
      T - the credential implementation type
      Parameters:
      id - the ID of the credential; must not be null
      credentialType - the type of the credential to be retrieved; must not be null
      Returns:
      the details of the retrieved credential
    • getByName

      public <T> reactor.core.publisher.Mono<CredentialDetails<T>> getByName(CredentialName name, Class<T> credentialType)
      Description copied from interface: ReactiveCredHubCredentialOperations
      Retrieve a credential using its name, as passed to a write request. Only the current credential value will be returned.
      Specified by:
      getByName in interface ReactiveCredHubCredentialOperations
      Type Parameters:
      T - the credential implementation type
      Parameters:
      name - the name of the credential; must not be null
      credentialType - the type of credential expected to be returned
      Returns:
      the details of the retrieved credential
    • getByNameWithHistory

      public <T> reactor.core.publisher.Flux<CredentialDetails<T>> getByNameWithHistory(CredentialName name, Class<T> credentialType)
      Description copied from interface: ReactiveCredHubCredentialOperations
      Retrieve a credential using its name, as passed to a write request. A collection of all stored values for the named credential will be returned, including historical values.
      Specified by:
      getByNameWithHistory in interface ReactiveCredHubCredentialOperations
      Type Parameters:
      T - the credential implementation type
      Parameters:
      name - the name of the credential; must not be null
      credentialType - the type of credential expected to be returned
      Returns:
      the details of the retrieved credential, including history
    • getByNameWithHistory

      public <T> reactor.core.publisher.Flux<CredentialDetails<T>> getByNameWithHistory(CredentialName name, int versions, Class<T> credentialType)
      Description copied from interface: ReactiveCredHubCredentialOperations
      Retrieve a credential using its name, as passed to a write request. A collection of stored values for the named credential will be returned, with the specified number of historical values.
      Specified by:
      getByNameWithHistory in interface ReactiveCredHubCredentialOperations
      Type Parameters:
      T - the credential implementation type
      Parameters:
      name - the name of the credential; must not be null
      versions - the number of historical versions to retrieve
      credentialType - the type of credential expected to be returned
      Returns:
      the details of the retrieved credential, including history
    • findByName

      public reactor.core.publisher.Flux<CredentialSummary> findByName(CredentialName name)
      Description copied from interface: ReactiveCredHubCredentialOperations
      Find a credential using a full or partial name.
      Specified by:
      findByName in interface ReactiveCredHubCredentialOperations
      Parameters:
      name - the name of the credential; must not be null
      Returns:
      a summary of the credential search results
    • findByPath

      public reactor.core.publisher.Flux<CredentialSummary> findByPath(String path)
      Description copied from interface: ReactiveCredHubCredentialOperations
      Find a credential using a path.
      Specified by:
      findByPath in interface ReactiveCredHubCredentialOperations
      Parameters:
      path - the path to the credential; must not be null
      Returns:
      a summary of the credential search results
    • deleteByName

      public reactor.core.publisher.Mono<Void> deleteByName(CredentialName name)
      Description copied from interface: ReactiveCredHubCredentialOperations
      Delete a credential by its full name.
      Specified by:
      deleteByName in interface ReactiveCredHubCredentialOperations
      Parameters:
      name - the name of the credential; must not be null
      Returns:
      an empty Mono