Class CredentialStorage

java.lang.Object
io.vertx.mutiny.ext.auth.webauthn4j.CredentialStorage
All Implemented Interfaces:
MutinyDelegate

public class CredentialStorage extends Object implements MutinyDelegate
Used to represent persistent storage of credentials, this gives you a way to abstract how you want to store them (in memory, database, other).

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

See Also:
  • CredentialStorage
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    CredentialStorage(io.vertx.ext.auth.webauthn4j.CredentialStorage delegate)
    Create a new instance of CredentialStorage delegating to the given (non-null) instance of CredentialStorage.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    io.smallrye.mutiny.Uni<List<io.vertx.ext.auth.webauthn4j.Authenticator>>
    find(String userName, String credentialId)
    Finds an existing list of credentials for a given user name and credential ID.
    List<io.vertx.ext.auth.webauthn4j.Authenticator>
    findAndAwait(String userName, String credentialId)
    Finds an existing list of credentials for a given user name and credential ID.
    findAndForget(String userName, String credentialId)
    Finds an existing list of credentials for a given user name and credential ID.
    io.vertx.ext.auth.webauthn4j.CredentialStorage
    Get the delegate instance.
    int
     
    newInstance(io.vertx.ext.auth.webauthn4j.CredentialStorage delegate)
    Creates a new instance of the CredentialStorage.
    io.smallrye.mutiny.Uni<Void>
    storeCredential(io.vertx.ext.auth.webauthn4j.Authenticator authenticator)
    Persists a new credential, bound by its user name (may be null) and credential ID (cannot be null, must be unique).
    void
    storeCredentialAndAwait(io.vertx.ext.auth.webauthn4j.Authenticator authenticator)
    Persists a new credential, bound by its user name (may be null) and credential ID (cannot be null, must be unique).
    storeCredentialAndForget(io.vertx.ext.auth.webauthn4j.Authenticator authenticator)
    Persists a new credential, bound by its user name (may be null) and credential ID (cannot be null, must be unique).
     
    io.smallrye.mutiny.Uni<Void>
    updateCounter(io.vertx.ext.auth.webauthn4j.Authenticator authenticator)
    Updates a previously stored credential counter, as identified by its user name (may be null) and credential ID (cannot be null, must be unique).
    void
    updateCounterAndAwait(io.vertx.ext.auth.webauthn4j.Authenticator authenticator)
    Updates a previously stored credential counter, as identified by its user name (may be null) and credential ID (cannot be null, must be unique).
    updateCounterAndForget(io.vertx.ext.auth.webauthn4j.Authenticator authenticator)
    Updates a previously stored credential counter, as identified by its user name (may be null) and credential ID (cannot be null, must be unique).

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • CredentialStorage

      public CredentialStorage(io.vertx.ext.auth.webauthn4j.CredentialStorage delegate)
      Create a new instance of CredentialStorage delegating to the given (non-null) instance of CredentialStorage.
    • CredentialStorage

      public CredentialStorage(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.ext.auth.webauthn4j.CredentialStorage getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • find

      @CheckReturnValue public io.smallrye.mutiny.Uni<List<io.vertx.ext.auth.webauthn4j.Authenticator>> find(String userName, String credentialId)
      Finds an existing list of credentials for a given user name and credential ID. Both the userName and credentialId parameters are optional but at least one of them must be specified. If only one is specified, it must match the results. If both are specified, then both must match the result at the same time. This may return more than one element if one of the parameters is not set. If both are set, then the returned list of credentials must contain at maximum 1 element. If the user is not known or does not allow any authenticator, returns an empty list.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      userName - the user name (may be null, but must match if specified)
      credentialId - the credential ID (must match the results). Can be null.
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • CredentialStorage.find(String, String)
    • findAndAwait

      public List<io.vertx.ext.auth.webauthn4j.Authenticator> findAndAwait(String userName, String credentialId)
      Finds an existing list of credentials for a given user name and credential ID. Both the userName and credentialId parameters are optional but at least one of them must be specified. If only one is specified, it must match the results. If both are specified, then both must match the result at the same time. This may return more than one element if one of the parameters is not set. If both are set, then the returned list of credentials must contain at maximum 1 element. If the user is not known or does not allow any authenticator, returns an empty list.

      Unlike the bare Vert.x variant, this method returns a List<io.vertx.ext.auth.webauthn4j.Authenticator>. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      userName - the user name (may be null, but must match if specified)
      credentialId - the credential ID (must match the results)
      Returns:
      The operation result
      See Also:
      • CredentialStorage.find(String, String)
    • findAndForget

      public CredentialStorage findAndForget(String userName, String credentialId)
      Finds an existing list of credentials for a given user name and credential ID. Both the userName and credentialId parameters are optional but at least one of them must be specified. If only one is specified, it must match the results. If both are specified, then both must match the result at the same time. This may return more than one element if one of the parameters is not set. If both are set, then the returned list of credentials must contain at maximum 1 element. If the user is not known or does not allow any authenticator, returns an empty list.

      Unlike the bare Vert.x variant, this method ignores the List<io.vertx.ext.auth.webauthn4j.Authenticator> result or any failure.

      Parameters:
      userName - the user name (may be null, but must match if specified)
      credentialId - the credential ID (must match the results)
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • CredentialStorage.find(String, String)
    • storeCredential

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> storeCredential(io.vertx.ext.auth.webauthn4j.Authenticator authenticator)
      Persists a new credential, bound by its user name (may be null) and credential ID (cannot be null, must be unique). If attempting to store a credential with a credId that is not unique, you should return a failed Future. If attempting to store a credential with a userName that already exists, you should first make sure that the current user is already logged in under the same userName, because this will in practice add a new credential to identify the existing user, so this must be restricted to the already existing user, otherwise you will allow anyone to gain access to existing users. If attempting to store a credential with a userName that already exists, and the current user is not logged in, or the logged in user does not have the same userName, you should return a failed Future.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      authenticator - the new credential to persist
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • CredentialStorage.storeCredential(Authenticator)
    • storeCredentialAndAwait

      public void storeCredentialAndAwait(io.vertx.ext.auth.webauthn4j.Authenticator authenticator)
      Persists a new credential, bound by its user name (may be null) and credential ID (cannot be null, must be unique). If attempting to store a credential with a credId that is not unique, you should return a failed Future. If attempting to store a credential with a userName that already exists, you should first make sure that the current user is already logged in under the same userName, because this will in practice add a new credential to identify the existing user, so this must be restricted to the already existing user, otherwise you will allow anyone to gain access to existing users. If attempting to store a credential with a userName that already exists, and the current user is not logged in, or the logged in user does not have the same userName, you should return a failed Future.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      authenticator - the new credential to persist
      See Also:
      • CredentialStorage.storeCredential(Authenticator)
    • storeCredentialAndForget

      public CredentialStorage storeCredentialAndForget(io.vertx.ext.auth.webauthn4j.Authenticator authenticator)
      Persists a new credential, bound by its user name (may be null) and credential ID (cannot be null, must be unique). If attempting to store a credential with a credId that is not unique, you should return a failed Future. If attempting to store a credential with a userName that already exists, you should first make sure that the current user is already logged in under the same userName, because this will in practice add a new credential to identify the existing user, so this must be restricted to the already existing user, otherwise you will allow anyone to gain access to existing users. If attempting to store a credential with a userName that already exists, and the current user is not logged in, or the logged in user does not have the same userName, you should return a failed Future.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      authenticator - the new credential to persist
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • CredentialStorage.storeCredential(Authenticator)
    • updateCounter

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> updateCounter(io.vertx.ext.auth.webauthn4j.Authenticator authenticator)
      Updates a previously stored credential counter, as identified by its user name (may be null) and credential ID (cannot be null, must be unique).

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      authenticator - the credential to update
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • CredentialStorage.updateCounter(Authenticator)
    • updateCounterAndAwait

      public void updateCounterAndAwait(io.vertx.ext.auth.webauthn4j.Authenticator authenticator)
      Updates a previously stored credential counter, as identified by its user name (may be null) and credential ID (cannot be null, must be unique).

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      authenticator - the credential to update
      See Also:
      • CredentialStorage.updateCounter(Authenticator)
    • updateCounterAndForget

      public CredentialStorage updateCounterAndForget(io.vertx.ext.auth.webauthn4j.Authenticator authenticator)
      Updates a previously stored credential counter, as identified by its user name (may be null) and credential ID (cannot be null, must be unique).

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      authenticator - the credential to update
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • CredentialStorage.updateCounter(Authenticator)
    • newInstance

      public static CredentialStorage newInstance(io.vertx.ext.auth.webauthn4j.CredentialStorage delegate)
      Creates a new instance of the CredentialStorage.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object