public class JDBCAuth extends AuthProvider
AuthProvider
instances that use the Vert.x JDBC client.
By default the hashing strategy is SHA-512. If you're already running in production this is backwards
compatible, however for new deployments or security upgrades it is recommended to use the PBKDF2 strategy
as it is the current OWASP recommendation for password storage.
NOTE: This class has been automatically generated from the original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<JDBCAuth> |
__TYPE_ARG |
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
|
Constructor and Description |
---|
JDBCAuth(JDBCAuth delegate) |
JDBCAuth(Object delegate) |
Modifier and Type | Method and Description |
---|---|
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
|
boolean |
equals(Object o) |
String |
generateSalt()
Compute a salt string.
|
JDBCAuth |
getDelegate() |
int |
hashCode() |
static JDBCAuth |
newInstance(JDBCAuth arg) |
JDBCAuth |
setAuthenticationQuery(String authenticationQuery)
Set the authentication query 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.
|
String |
toString() |
authenticate, authenticateObservable, newInstance, rxAuthenticate
public static final io.vertx.lang.rx.TypeArg<JDBCAuth> __TYPE_ARG
public static final String DEFAULT_AUTHENTICATE_QUERY
public static final String DEFAULT_ROLES_QUERY
public static final String DEFAULT_PERMISSIONS_QUERY
public static final String DEFAULT_ROLE_PREFIX
public JDBCAuth(JDBCAuth delegate)
public JDBCAuth(Object delegate)
public String toString()
toString
in class AuthProvider
public boolean equals(Object o)
equals
in class AuthProvider
public int hashCode()
hashCode
in class AuthProvider
public JDBCAuth getDelegate()
getDelegate
in class AuthProvider
public static JDBCAuth create(Vertx vertx, JDBCClient client)
vertx
- client
- the JDBC client instancepublic JDBCAuth setAuthenticationQuery(String authenticationQuery)
authenticationQuery
- the authentication querypublic JDBCAuth setRolesQuery(String rolesQuery)
rolesQuery
- the roles querypublic JDBCAuth setPermissionsQuery(String permissionsQuery)
permissionsQuery
- the permissions querypublic JDBCAuth setRolePrefix(String rolePrefix)
rolePrefix
- a Prefix e.g.: "role:"public String computeHash(String password, String salt)
password
- the unhashed passwordsalt
- the saltpublic String computeHash(String password, String salt, int version)
password
- the unhashed passwordsalt
- the saltversion
- the nonce version to usepublic String generateSalt()
public JDBCAuth setNonces(JsonArray nonces)
nonces
- a List of non null Strings.Copyright © 2023 Eclipse. All rights reserved.