public interface JDBCAuth extends AuthProvider
AuthProvider
instances that use the Vert.x JDBC clientModifier and Type | Field and Description |
---|---|
static String |
DEFAULT_AUTHENTICATE_QUERY
The default query to be used for authentication
|
static String |
DEFAULT_PERMISSIONS_QUERY
The default query to retrieve all permissions for the role
|
static String |
DEFAULT_ROLE_PREFIX
The default role prefix
|
static String |
DEFAULT_ROLES_QUERY
The default query to retrieve all roles for the user
|
Modifier and Type | Method and Description |
---|---|
default String |
computeHash(String password,
String salt)
Compute the hashed password given the unhashed password and the salt without nonce
The implementation relays to the JDBCHashStrategy provided.
|
String |
computeHash(String password,
String salt,
int version)
Compute the hashed password given the unhashed password and the salt
The implementation relays to the JDBCHashStrategy provided.
|
static JDBCAuth |
create(Vertx vertx,
JDBCClient client)
Create a JDBC auth provider implementation
|
String |
generateSalt()
Compute a salt string.
|
JDBCAuth |
setAuthenticationQuery(String authenticationQuery)
Set the authentication query to use.
|
JDBCAuth |
setHashStrategy(JDBCHashStrategy strategy)
Set the hash strategy to use.
|
JDBCAuth |
setNonces(JsonArray nonces)
Provide a application configuration level on hash nonce's as a ordered list of
nonces where each position corresponds to a version.
|
JDBCAuth |
setPermissionsQuery(String permissionsQuery)
Set the permissions query to use.
|
JDBCAuth |
setRolePrefix(String rolePrefix)
Set the role prefix to distinguish from permissions when checking for isPermitted requests.
|
JDBCAuth |
setRolesQuery(String rolesQuery)
Set the roles query to use.
|
authenticate
static final String DEFAULT_AUTHENTICATE_QUERY
static final String DEFAULT_ROLES_QUERY
static final String DEFAULT_PERMISSIONS_QUERY
static final String DEFAULT_ROLE_PREFIX
static JDBCAuth create(Vertx vertx, JDBCClient client)
client
- the JDBC client instanceJDBCAuth setAuthenticationQuery(String authenticationQuery)
authenticationQuery
- the authentication queryJDBCAuth setRolesQuery(String rolesQuery)
rolesQuery
- the roles queryJDBCAuth setPermissionsQuery(String permissionsQuery)
permissionsQuery
- the permissions queryJDBCAuth setRolePrefix(String rolePrefix)
rolePrefix
- a Prefix e.g.: "role:"JDBCAuth setHashStrategy(JDBCHashStrategy strategy)
strategy
- the strategydefault String computeHash(String password, String salt)
password
- the unhashed passwordsalt
- the saltString computeHash(String password, String salt, int version)
password
- the unhashed passwordsalt
- the saltversion
- the nonce version to useString generateSalt()
JDBCAuth setNonces(JsonArray nonces)
nonces
- a List of non null Strings.Copyright © 2017. All rights reserved.