Package io.vertx.rxjava.ext.auth.mongo
Class MongoAuth
- java.lang.Object
-
- io.vertx.rxjava.ext.auth.authentication.AuthenticationProvider
-
- io.vertx.rxjava.ext.auth.AuthProvider
-
- io.vertx.rxjava.ext.auth.mongo.MongoAuth
-
public class MongoAuth extends AuthProvider
An extension of AuthProvider which is using as store NOTE: This class has been automatically generated from theoriginal
non RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<MongoAuth>
__TYPE_ARG
static String
DEFAULT_COLLECTION_NAME
The default name of the collection to be usedstatic String
DEFAULT_CREDENTIAL_PASSWORD_FIELD
The default name of the property for the password, like it is transported in credentials by methodAuthenticationProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>)
static String
DEFAULT_CREDENTIAL_USERNAME_FIELD
The default name of the property for the username, like it is transported in credentials by methodAuthenticationProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>)
static String
DEFAULT_PASSWORD_FIELD
The default name of the property for the password, like it is stored in mongodbstatic String
DEFAULT_PERMISSION_FIELD
The default name of the property for the permissions, like it is stored in mongodb.static String
DEFAULT_ROLE_FIELD
The default name of the property for the roles, like it is stored in mongodb.static String
DEFAULT_SALT_FIELD
The default name of the property for the salt fieldstatic String
DEFAULT_USERNAME_FIELD
The default name of the property for the username, like it is stored in mongodbstatic String
PROPERTY_COLLECTION_NAME
The property name to be used to set the name of the collection inside the configstatic String
PROPERTY_CREDENTIAL_PASSWORD_FIELD
The property name to be used to set the name of the field, where the password for the credentials is stored insidestatic String
PROPERTY_CREDENTIAL_USERNAME_FIELD
The property name to be used to set the name of the field, where the username for the credentials is stored insidestatic String
PROPERTY_PASSWORD_FIELD
The property name to be used to set the name of the field, where the password is stored insidestatic String
PROPERTY_PERMISSION_FIELD
The property name to be used to set the name of the field, where the permissions are stored insidestatic String
PROPERTY_ROLE_FIELD
The property name to be used to set the name of the field, where the roles are stored insidestatic String
PROPERTY_SALT_FIELD
The property name to be used to set the name of the field, where the SALT is stored insidestatic String
PROPERTY_SALT_STYLE
The property name to be used to set the name of the field, where the salt style is stored insidestatic String
PROPERTY_USERNAME_FIELD
The property name to be used to set the name of the field, where the username is stored insidestatic String
ROLE_PREFIX
The prefix which is used by the method when checking for role access
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static MongoAuth
create(MongoClient mongoClient, io.vertx.core.json.JsonObject config)
Deprecated.boolean
equals(Object o)
String
getCollectionName()
Deprecated.io.vertx.ext.auth.mongo.MongoAuth
getDelegate()
HashStrategy
getHashStrategy()
Deprecated.String
getPasswordCredentialField()
Deprecated.String
getPasswordField()
Deprecated.String
getPermissionField()
Deprecated.String
getRoleField()
Deprecated.String
getSaltField()
Deprecated.String
getUsernameCredentialField()
Deprecated.String
getUsernameField()
Deprecated.int
hashCode()
void
insertUser(String username, String password, List<String> roles, List<String> permissions)
Deprecated.void
insertUser(String username, String password, List<String> roles, List<String> permissions, io.vertx.core.Handler<io.vertx.core.AsyncResult<String>> resultHandler)
Deprecated.static MongoAuth
newInstance(io.vertx.ext.auth.mongo.MongoAuth arg)
rx.Single<String>
rxInsertUser(String username, String password, List<String> roles, List<String> permissions)
Deprecated.MongoAuth
setCollectionName(String collectionName)
Deprecated.MongoAuth
setHashAlgorithm(io.vertx.ext.auth.mongo.HashAlgorithm hashAlgorithm)
Deprecated.MongoAuth
setHashStrategy(HashStrategy hashStrategy)
Deprecated.MongoAuth
setPasswordCredentialField(String fieldName)
Deprecated.MongoAuth
setPasswordField(String fieldName)
Deprecated.MongoAuth
setPermissionField(String fieldName)
Deprecated.MongoAuth
setRoleField(String fieldName)
Deprecated.MongoAuth
setSaltField(String fieldName)
Deprecated.MongoAuth
setUsernameCredentialField(String fieldName)
Deprecated.MongoAuth
setUsernameField(String fieldName)
Deprecated.String
toString()
-
Methods inherited from class io.vertx.rxjava.ext.auth.AuthProvider
newInstance
-
Methods inherited from class io.vertx.rxjava.ext.auth.authentication.AuthenticationProvider
authenticate, authenticate, authenticate, authenticate, newInstance, rxAuthenticate, rxAuthenticate
-
-
-
-
Field Detail
-
PROPERTY_COLLECTION_NAME
public static final String PROPERTY_COLLECTION_NAME
The property name to be used to set the name of the collection inside the config- See Also:
- Constant Field Values
-
PROPERTY_USERNAME_FIELD
public static final String PROPERTY_USERNAME_FIELD
The property name to be used to set the name of the field, where the username is stored inside- See Also:
- Constant Field Values
-
PROPERTY_ROLE_FIELD
public static final String PROPERTY_ROLE_FIELD
The property name to be used to set the name of the field, where the roles are stored inside- See Also:
- Constant Field Values
-
PROPERTY_PERMISSION_FIELD
public static final String PROPERTY_PERMISSION_FIELD
The property name to be used to set the name of the field, where the permissions are stored inside- See Also:
- Constant Field Values
-
PROPERTY_PASSWORD_FIELD
public static final String PROPERTY_PASSWORD_FIELD
The property name to be used to set the name of the field, where the password is stored inside- See Also:
- Constant Field Values
-
PROPERTY_CREDENTIAL_USERNAME_FIELD
public static final String PROPERTY_CREDENTIAL_USERNAME_FIELD
The property name to be used to set the name of the field, where the username for the credentials is stored inside- See Also:
- Constant Field Values
-
PROPERTY_CREDENTIAL_PASSWORD_FIELD
public static final String PROPERTY_CREDENTIAL_PASSWORD_FIELD
The property name to be used to set the name of the field, where the password for the credentials is stored inside- See Also:
- Constant Field Values
-
PROPERTY_SALT_FIELD
public static final String PROPERTY_SALT_FIELD
The property name to be used to set the name of the field, where the SALT is stored inside- See Also:
- Constant Field Values
-
PROPERTY_SALT_STYLE
public static final String PROPERTY_SALT_STYLE
The property name to be used to set the name of the field, where the salt style is stored inside- See Also:
- Constant Field Values
-
DEFAULT_COLLECTION_NAME
public static final String DEFAULT_COLLECTION_NAME
The default name of the collection to be used- See Also:
- Constant Field Values
-
DEFAULT_USERNAME_FIELD
public static final String DEFAULT_USERNAME_FIELD
The default name of the property for the username, like it is stored in mongodb- See Also:
- Constant Field Values
-
DEFAULT_PASSWORD_FIELD
public static final String DEFAULT_PASSWORD_FIELD
The default name of the property for the password, like it is stored in mongodb- See Also:
- Constant Field Values
-
DEFAULT_ROLE_FIELD
public static final String DEFAULT_ROLE_FIELD
The default name of the property for the roles, like it is stored in mongodb. Roles are expected to be saved as JsonArray- See Also:
- Constant Field Values
-
DEFAULT_PERMISSION_FIELD
public static final String DEFAULT_PERMISSION_FIELD
The default name of the property for the permissions, like it is stored in mongodb. Permissions are expected to be saved as JsonArray- See Also:
- Constant Field Values
-
DEFAULT_CREDENTIAL_USERNAME_FIELD
public static final String DEFAULT_CREDENTIAL_USERNAME_FIELD
The default name of the property for the username, like it is transported in credentials by methodAuthenticationProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>)
- See Also:
- Constant Field Values
-
DEFAULT_CREDENTIAL_PASSWORD_FIELD
public static final String DEFAULT_CREDENTIAL_PASSWORD_FIELD
The default name of the property for the password, like it is transported in credentials by methodAuthenticationProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>)
- See Also:
- Constant Field Values
-
DEFAULT_SALT_FIELD
public static final String DEFAULT_SALT_FIELD
The default name of the property for the salt field- See Also:
- Constant Field Values
-
ROLE_PREFIX
public static final String ROLE_PREFIX
The prefix which is used by the method when checking for role access- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MongoAuth
public MongoAuth(io.vertx.ext.auth.mongo.MongoAuth delegate)
-
MongoAuth
public MongoAuth(Object delegate)
-
-
Method Detail
-
toString
public String toString()
- Overrides:
toString
in classAuthProvider
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classAuthProvider
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAuthProvider
-
getDelegate
public io.vertx.ext.auth.mongo.MongoAuth getDelegate()
- Overrides:
getDelegate
in classAuthProvider
-
create
@Deprecated public static MongoAuth create(MongoClient mongoClient, io.vertx.core.json.JsonObject config)
Deprecated.Creates an instance of MongoAuth by using the given and configuration object. An example for a configuration object:JsonObject js = new JsonObject(); js.put(MongoAuth.PROPERTY_COLLECTION_NAME, createCollectionName(MongoAuth.DEFAULT_COLLECTION_NAME));
- Parameters:
mongoClient
- an instance of to be used for data storage and retrivalconfig
- the configuration object for the current instance. By this- Returns:
- the created instance of
MongoAuth
s
-
setCollectionName
@Deprecated public MongoAuth setCollectionName(String collectionName)
Deprecated.Set the name of the collection to be used. Defaults toMongoAuth
- Parameters:
collectionName
- the name of the collection to be used for storing and reading user data- Returns:
- the current instance itself for fluent calls
-
setUsernameField
@Deprecated public MongoAuth setUsernameField(String fieldName)
Deprecated.Set the name of the field to be used for the username. Defaults toMongoAuth
- Parameters:
fieldName
- the name of the field to be used- Returns:
- the current instance itself for fluent calls
-
setPasswordField
@Deprecated public MongoAuth setPasswordField(String fieldName)
Deprecated.Set the name of the field to be used for the password Defaults toMongoAuth
- Parameters:
fieldName
- the name of the field to be used- Returns:
- the current instance itself for fluent calls
-
setRoleField
@Deprecated public MongoAuth setRoleField(String fieldName)
Deprecated.Set the name of the field to be used for the roles. Defaults toMongoAuth
. Roles are expected to be saved as JsonArray- Parameters:
fieldName
- the name of the field to be used- Returns:
- the current instance itself for fluent calls
-
setPermissionField
@Deprecated public MongoAuth setPermissionField(String fieldName)
Deprecated.Set the name of the field to be used for the permissions. Defaults toMongoAuth
. Permissions are expected to be saved as JsonArray- Parameters:
fieldName
- the name of the field to be used- Returns:
- the current instance itself for fluent calls
-
setUsernameCredentialField
@Deprecated public MongoAuth setUsernameCredentialField(String fieldName)
Deprecated.Set the name of the field to be used as property for the username in the methodAuthenticationProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>)
. Defaults toMongoAuth
- Parameters:
fieldName
- the name of the field to be used- Returns:
- the current instance itself for fluent calls
-
setPasswordCredentialField
@Deprecated public MongoAuth setPasswordCredentialField(String fieldName)
Deprecated.Set the name of the field to be used as property for the password of credentials in the methodAuthenticationProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>)
. Defaults toMongoAuth
- Parameters:
fieldName
- the name of the field to be used- Returns:
- the current instance itself for fluent calls
-
setSaltField
@Deprecated public MongoAuth setSaltField(String fieldName)
Deprecated.Set the name of the field to be used for the salt. Only used whenHashStrategy.setSaltStyle(io.vertx.ext.auth.mongo.HashSaltStyle)
is set to- Parameters:
fieldName
- the name of the field to be used- Returns:
- the current instance itself for fluent calls
-
getCollectionName
@Deprecated public String getCollectionName()
Deprecated.The name of the collection used to store User objects inside. Defaults toMongoAuth
- Returns:
- the collectionName
-
getUsernameField
@Deprecated public String getUsernameField()
Deprecated.Get the name of the field to be used for the username. Defaults toMongoAuth
- Returns:
- the usernameField
-
getPasswordField
@Deprecated public String getPasswordField()
Deprecated.Get the name of the field to be used for the password Defaults toMongoAuth
- Returns:
- the passwordField
-
getRoleField
@Deprecated public String getRoleField()
Deprecated.Get the name of the field to be used for the roles. Defaults toMongoAuth
. Roles are expected to be saved as JsonArray- Returns:
- the roleField
-
getPermissionField
@Deprecated public String getPermissionField()
Deprecated.Get the name of the field to be used for the permissions. Defaults toMongoAuth
. Permissions are expected to be saved as JsonArray- Returns:
- the permissionField
-
getUsernameCredentialField
@Deprecated public String getUsernameCredentialField()
Deprecated.Get the name of the field to be used as property for the username in the methodAuthenticationProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>)
. Defaults toMongoAuth
- Returns:
- the usernameCredentialField
-
getPasswordCredentialField
@Deprecated public String getPasswordCredentialField()
Deprecated.Get the name of the field to be used as property for the password of credentials in the methodAuthenticationProvider.authenticate(io.vertx.core.json.JsonObject, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.ext.auth.User>>)
. Defaults toMongoAuth
- Returns:
- the passwordCredentialField
-
getSaltField
@Deprecated public String getSaltField()
Deprecated.Get the name of the field to be used for the salt. Only used whenHashStrategy.setSaltStyle(io.vertx.ext.auth.mongo.HashSaltStyle)
is set to- Returns:
- the saltField
-
setHashStrategy
@Deprecated public MongoAuth setHashStrategy(HashStrategy hashStrategy)
Deprecated.The HashStrategy which is used by the current instance- Parameters:
hashStrategy
- theHashStrategy
to be set- Returns:
- the current instance itself for fluent calls
-
getHashStrategy
@Deprecated public HashStrategy getHashStrategy()
Deprecated.The HashStrategy which is used by the current instance- Returns:
- the defined instance of
HashStrategy
-
setHashAlgorithm
@Deprecated public MongoAuth setHashAlgorithm(io.vertx.ext.auth.mongo.HashAlgorithm hashAlgorithm)
Deprecated.The Hash Algorithm which is used by the current instance- Parameters:
hashAlgorithm
- theHashAlgorithm
to be set- Returns:
- the current instance itself for fluent calls
-
insertUser
@Deprecated public void insertUser(String username, String password, List<String> roles, List<String> permissions, io.vertx.core.Handler<io.vertx.core.AsyncResult<String>> resultHandler)
Deprecated.- Parameters:
username
- the username to be setpassword
- the passsword in clear text, will be adapted following the definitions of the definedHashStrategy
roles
- a list of roles to be setpermissions
- a list of permissions to be setresultHandler
- the ResultHandler will be provided with the id of the generated record
-
insertUser
@Deprecated public void insertUser(String username, String password, List<String> roles, List<String> permissions)
Deprecated.- Parameters:
username
- the username to be setpassword
- the passsword in clear text, will be adapted following the definitions of the definedHashStrategy
roles
- a list of roles to be setpermissions
- a list of permissions to be set
-
rxInsertUser
@Deprecated public rx.Single<String> rxInsertUser(String username, String password, List<String> roles, List<String> permissions)
Deprecated.- Parameters:
username
- the username to be setpassword
- the passsword in clear text, will be adapted following the definitions of the definedHashStrategy
roles
- a list of roles to be setpermissions
- a list of permissions to be set- Returns:
-
newInstance
public static MongoAuth newInstance(io.vertx.ext.auth.mongo.MongoAuth arg)
-
-