use of org.firebirdsql.gds.ParameterTagMapping in project jaybird by FirebirdSQL.
the class V10ParameterConverter method populateAuthenticationProperties.
@Override
protected void populateAuthenticationProperties(final AbstractConnection connection, final ConnectionParameterBuffer pb) throws SQLException {
IAttachProperties props = connection.getAttachProperties();
ParameterTagMapping tagMapping = pb.getTagMapping();
if (props.getUser() != null) {
pb.addArgument(tagMapping.getUserNameTag(), props.getUser());
}
if (props.getPassword() != null) {
pb.addArgument(tagMapping.getEncryptedPasswordTag(), UnixCrypt.crypt(props.getPassword(), LegacyAuthenticationPlugin.LEGACY_PASSWORD_SALT).substring(2, 13));
}
}
use of org.firebirdsql.gds.ParameterTagMapping in project jaybird by FirebirdSQL.
the class JnaParameterConverter method populateAuthenticationProperties.
@Override
protected void populateAuthenticationProperties(final AbstractConnection<?, ?> connection, final ConnectionParameterBuffer pb) throws SQLException {
IAttachProperties<?> props = connection.getAttachProperties();
ParameterTagMapping tagMapping = pb.getTagMapping();
if (props.getUser() != null) {
pb.addArgument(tagMapping.getUserNameTag(), props.getUser());
}
if (props.getPassword() != null) {
pb.addArgument(tagMapping.getPasswordTag(), props.getPassword());
}
Map<String, String> configMap = new HashMap<>();
if (props.getWireCryptAsEnum() != WireCrypt.DEFAULT) {
configMap.put("WireCrypt", props.getWireCrypt());
}
String authPlugins = props.getAuthPlugins();
if (authPlugins != null && !authPlugins.isEmpty()) {
configMap.put("AuthClient", authPlugins);
}
if (!configMap.isEmpty()) {
String configString = buildConfigString(configMap);
pb.addArgument(tagMapping.getConfigTag(), configString);
}
}
use of org.firebirdsql.gds.ParameterTagMapping in project jaybird by FirebirdSQL.
the class V10ParameterConverter method populateAuthenticationProperties.
@Override
protected void populateAuthenticationProperties(final AbstractConnection<?, ?> connection, final ConnectionParameterBuffer pb) throws SQLException {
IAttachProperties<?> props = connection.getAttachProperties();
ParameterTagMapping tagMapping = pb.getTagMapping();
if (props.getUser() != null) {
pb.addArgument(tagMapping.getUserNameTag(), props.getUser());
}
if (props.getPassword() != null) {
pb.addArgument(tagMapping.getEncryptedPasswordTag(), UnixCrypt.crypt(props.getPassword(), LEGACY_PASSWORD_SALT).substring(2, 13));
}
}
use of org.firebirdsql.gds.ParameterTagMapping in project jaybird by FirebirdSQL.
the class JnaParameterConverter method populateAuthenticationProperties.
@Override
protected void populateAuthenticationProperties(final AbstractConnection connection, final ConnectionParameterBuffer pb) throws SQLException {
IAttachProperties props = connection.getAttachProperties();
ParameterTagMapping tagMapping = pb.getTagMapping();
if (props.getUser() != null) {
pb.addArgument(tagMapping.getUserNameTag(), props.getUser());
}
if (props.getPassword() != null) {
pb.addArgument(tagMapping.getPasswordTag(), props.getPassword());
}
if (props.getWireCrypt() != WireCrypt.DEFAULT) {
// Need to do this differently when having to add multiple configs
String configString = "WireCrypt = " + props.getWireCrypt();
pb.addArgument(tagMapping.getConfigTag(), configString);
}
}
use of org.firebirdsql.gds.ParameterTagMapping in project jaybird by FirebirdSQL.
the class ClientAuthBlock method cleanParameterBuffer.
private void cleanParameterBuffer(ConnectionParameterBuffer pb) {
ParameterTagMapping tagMapping = pb.getTagMapping();
pb.removeArgument(tagMapping.getPasswordTag());
pb.removeArgument(tagMapping.getEncryptedPasswordTag());
pb.removeArgument(tagMapping.getTrustedAuthTag());
}
Aggregations