public interface SqlUserUtil
Modifier and Type | Method and Description |
---|---|
static SqlUserUtil |
create(SqlClient client)
Create an instance of the user helper.
|
static SqlUserUtil |
create(SqlClient client,
String insertUserSQL,
String insertUserRoleSQL,
String insertRolePermissionSQL)
Create an instance of the user helper with custom queries.
|
default Future<Void> |
createHashedUser(String username,
String hash) |
SqlUserUtil |
createHashedUser(String username,
String hash,
Handler<AsyncResult<Void>> resultHandler)
Insert a user into a database.
|
default Future<Void> |
createRolePermission(String role,
String permission) |
SqlUserUtil |
createRolePermission(String role,
String permission,
Handler<AsyncResult<Void>> resultHandler)
Insert a role permission into a database.
|
default Future<Void> |
createUser(String username,
String password) |
SqlUserUtil |
createUser(String username,
String password,
Handler<AsyncResult<Void>> resultHandler)
Insert a user into a database.
|
default Future<Void> |
createUserRole(String user,
String role) |
SqlUserUtil |
createUserRole(String username,
String role,
Handler<AsyncResult<Void>> resultHandler)
Insert a user role into a database.
|
static SqlUserUtil create(SqlClient client)
client
- the client with write rights to the database.static SqlUserUtil create(SqlClient client, String insertUserSQL, String insertUserRoleSQL, String insertRolePermissionSQL)
client
- the client with write rights to the database.SqlUserUtil createUser(String username, String password, Handler<AsyncResult<Void>> 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 operationdefault Future<Void> createUser(String username, String password)
createUser(String, String, Handler).
SqlUserUtil createHashedUser(String username, String hash, Handler<AsyncResult<Void>> 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 operationSqlUserUtil createUserRole(String username, String role, Handler<AsyncResult<Void>> resultHandler)
username
- the username to be setrole
- a to be setresultHandler
- the ResultHandler will be provided with the result of the operationdefault Future<Void> createUserRole(String user, String role)
createUserRole(String, String, Handler).
SqlUserUtil createRolePermission(String role, String permission, Handler<AsyncResult<Void>> resultHandler)
role
- a to be setpermission
- the permission to be setresultHandler
- the ResultHandler will be provided with the result of the operationCopyright © 2022 Eclipse. All rights reserved.