class AuthenticationPluginManager
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
AuthenticationPluginManager.PasswordAction<T,R> |
| Modifier and Type | Field and Description |
|---|---|
private static java.util.logging.Logger |
LOGGER |
| Modifier | Constructor and Description |
|---|---|
private |
AuthenticationPluginManager() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
withEncodedPassword(AuthenticationRequestType type,
java.util.Properties info,
AuthenticationPluginManager.PasswordAction<byte[],T> action)
Helper that wraps
withPassword(AuthenticationRequestType, Properties, PasswordAction), checks that it is not-null, and encodes
it as a byte array. |
static <T> T |
withPassword(AuthenticationRequestType type,
java.util.Properties info,
AuthenticationPluginManager.PasswordAction<char[],T> action)
If a password is requested by the server during connection initiation, this
method will be invoked to supply the password.
|
public static <T> T withPassword(AuthenticationRequestType type, java.util.Properties info, AuthenticationPluginManager.PasswordAction<char[],T> action) throws PSQLException, java.io.IOException
The caller provides a action method that will be invoked with the char[]
password. After completion, for security reasons the char[] array will be
wiped by filling it with zeroes. Callers must not rely on being able to read
the password char[] after the action has completed.
type - The authentication type that is being requestedinfo - The connection properties for the connectionaction - The action to invoke with the passwordPSQLException - Throws a PSQLException if the plugin class cannot be instantiatedjava.io.IOException - Bubbles up any thrown IOException from the provided actionpublic static <T> T withEncodedPassword(AuthenticationRequestType type, java.util.Properties info, AuthenticationPluginManager.PasswordAction<byte[],T> action) throws PSQLException, java.io.IOException
withPassword(AuthenticationRequestType, Properties, PasswordAction), checks that it is not-null, and encodes
it as a byte array. Used by internal code paths that require an encoded password
that may be an empty string, but not null.
The caller provides a callback method that will be invoked with the byte[]
encoded password. After completion, for security reasons the byte[] array will be
wiped by filling it with zeroes. Callers must not rely on being able to read
the password byte[] after the callback has completed.
type - The authentication type that is being requestedinfo - The connection properties for the connectionaction - The action to invoke with the encoded passwordPSQLException - Throws a PSQLException if the plugin class cannot be instantiated or if the retrieved password is null.java.io.IOException - Bubbles up any thrown IOException from the provided callback