public interface MongoUserUtil
Modifier and Type | Method and Description |
---|---|
static MongoUserUtil |
create(MongoClient client)
Create an instance of the user helper.
|
static MongoUserUtil |
create(MongoClient client,
MongoAuthenticationOptions authenticationOptions,
MongoAuthorizationOptions authorizationOptions)
Create an instance of the user helper with custom queries.
|
default Future<String> |
createHashedUser(String username,
String hash) |
MongoUserUtil |
createHashedUser(String username,
String hash,
Handler<AsyncResult<String>> resultHandler)
Insert a user into a database.
|
default Future<String> |
createUser(String username,
String password) |
MongoUserUtil |
createUser(String username,
String password,
Handler<AsyncResult<String>> resultHandler)
Insert a user into a database.
|
default Future<String> |
createUserRolesAndPermissions(String user,
List<String> roles,
List<String> permissions) |
MongoUserUtil |
createUserRolesAndPermissions(String username,
List<String> roles,
List<String> permissions,
Handler<AsyncResult<String>> resultHandler)
Insert a user role into a database.
|
static MongoUserUtil create(MongoClient client)
client
- the client with write rights to the database.static MongoUserUtil create(MongoClient client, MongoAuthenticationOptions authenticationOptions, MongoAuthorizationOptions authorizationOptions)
client
- the client with write rights to the database.MongoUserUtil createUser(String username, String password, Handler<AsyncResult<String>> resultHandler)
username
- the username to be setpassword
- the passsword in clear text, will be adapted following the definitions of the defined strategyresultHandler
- the ResultHandler will be provided with the result of the operation and the created user document identifierdefault Future<String> createUser(String username, String password)
createUser(String, String, Handler).
MongoUserUtil createHashedUser(String username, String hash, Handler<AsyncResult<String>> resultHandler)
username
- the username to be sethash
- the password hash, as result of HashingStrategy.hash(String, Map, String, String)
resultHandler
- the ResultHandler will be provided with the result of the operation and the created user document identifierMongoUserUtil createUserRolesAndPermissions(String username, List<String> roles, List<String> permissions, Handler<AsyncResult<String>> resultHandler)
username
- the username to be setroles
- a to be setpermissions
- a to be setresultHandler
- the ResultHandler will be provided with the result of the operation and the created user document identifierCopyright © 2022 Eclipse. All rights reserved.