Class CredentialStorage
- java.lang.Object
-
- io.vertx.rxjava3.ext.auth.webauthn4j.CredentialStorage
-
public class CredentialStorage extends Object
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 RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<CredentialStorage>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description CredentialStorage(CredentialStorage delegate)
CredentialStorage(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Single<List<Authenticator>>
find(String userName, String credentialId)
Finds an existing list of credentials for a given user name and credential ID.CredentialStorage
getDelegate()
int
hashCode()
static CredentialStorage
newInstance(CredentialStorage arg)
Single<List<Authenticator>>
rxFind(String userName, String credentialId)
Finds an existing list of credentials for a given user name and credential ID.Completable
rxStoreCredential(Authenticator authenticator)
Persists a new credential, bound by its user name (may benull
) and credential ID (cannot benull
, must be unique).Completable
rxUpdateCounter(Authenticator authenticator)
Updates a previously stored credential counter, as identified by its user name (may benull
) and credential ID (cannot benull
, must be unique).Completable
storeCredential(Authenticator authenticator)
Persists a new credential, bound by its user name (may benull
) and credential ID (cannot benull
, must be unique).String
toString()
Completable
updateCounter(Authenticator authenticator)
Updates a previously stored credential counter, as identified by its user name (may benull
) and credential ID (cannot benull
, must be unique).
-
-
-
Field Detail
-
__TYPE_ARG
public static final io.vertx.lang.rx.TypeArg<CredentialStorage> __TYPE_ARG
-
-
Constructor Detail
-
CredentialStorage
public CredentialStorage(CredentialStorage delegate)
-
CredentialStorage
public CredentialStorage(Object delegate)
-
-
Method Detail
-
getDelegate
public CredentialStorage getDelegate()
-
find
public Single<List<Authenticator>> find(String userName, String credentialId)
Finds an existing list of credentials for a given user name and credential ID. Both theuserName
andcredentialId
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.- Parameters:
userName
- the user name (may benull
, but must match if specified)credentialId
- the credential ID (must match the results)- Returns:
- the list of authenticators allowed for the given userName and credential ID, or an empty list.
-
rxFind
public Single<List<Authenticator>> rxFind(String userName, String credentialId)
Finds an existing list of credentials for a given user name and credential ID. Both theuserName
andcredentialId
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.- Parameters:
userName
- the user name (may benull
, but must match if specified)credentialId
- the credential ID (must match the results)- Returns:
- the list of authenticators allowed for the given userName and credential ID, or an empty list.
-
storeCredential
public Completable storeCredential(Authenticator authenticator)
Persists a new credential, bound by its user name (may benull
) and credential ID (cannot benull
, must be unique). If attempting to store a credential with acredId
that is not unique, you should return a failedFuture
. If attempting to store a credential with auserName
that already exists, you should first make sure that the current user is already logged in under the sameuserName
, 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 auserName
that already exists, and the current user is not logged in, or the logged in user does not have the sameuserName
, you should return a failedFuture
.- Parameters:
authenticator
- the new credential to persist- Returns:
- a future of nothing, or a failed future if the
credId
already exists, or if theuserName
already exists and does not represent the currently logged in user.
-
rxStoreCredential
public Completable rxStoreCredential(Authenticator authenticator)
Persists a new credential, bound by its user name (may benull
) and credential ID (cannot benull
, must be unique). If attempting to store a credential with acredId
that is not unique, you should return a failedFuture
. If attempting to store a credential with auserName
that already exists, you should first make sure that the current user is already logged in under the sameuserName
, 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 auserName
that already exists, and the current user is not logged in, or the logged in user does not have the sameuserName
, you should return a failedFuture
.- Parameters:
authenticator
- the new credential to persist- Returns:
- a future of nothing, or a failed future if the
credId
already exists, or if theuserName
already exists and does not represent the currently logged in user.
-
updateCounter
public Completable updateCounter(Authenticator authenticator)
Updates a previously stored credential counter, as identified by its user name (may benull
) and credential ID (cannot benull
, must be unique).- Parameters:
authenticator
- the credential to update- Returns:
- a future of nothing
-
rxUpdateCounter
public Completable rxUpdateCounter(Authenticator authenticator)
Updates a previously stored credential counter, as identified by its user name (may benull
) and credential ID (cannot benull
, must be unique).- Parameters:
authenticator
- the credential to update- Returns:
- a future of nothing
-
newInstance
public static CredentialStorage newInstance(CredentialStorage arg)
-
-