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.
|
Future<String> |
createHashedUser(String username,
String hash) |
default MongoUserUtil |
createHashedUser(String username,
String hash,
Handler<AsyncResult<String>> resultHandler)
Insert a user into a database.
|
Future<String> |
createUser(String username,
String password) |
default MongoUserUtil |
createUser(String username,
String password,
Handler<AsyncResult<String>> resultHandler)
Insert a user into a database.
|
Future<String> |
createUserRolesAndPermissions(String user,
List<String> roles,
List<String> permissions) |
default 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.default MongoUserUtil createUser(String username, String password, Handler<AsyncResult<String>> resultHandler)
username
- the username to be setpassword
- the password 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 identifierFuture<String> createUser(String username, String password)
createUser(String, String, Handler).
default 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 identifierdefault MongoUserUtil 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 © 2023 Eclipse. All rights reserved.