-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'parsec-ssl' into develop
- Loading branch information
Showing
28 changed files
with
421 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/main/java/org/mariadb/jdbc/plugin/AuthenticationPluginFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// SPDX-License-Identifier: LGPL-2.1-or-later | ||
// Copyright (c) 2012-2014 Monty Program Ab | ||
// Copyright (c) 2015-2024 MariaDB Corporation Ab | ||
package org.mariadb.jdbc.plugin; | ||
|
||
import org.mariadb.jdbc.Configuration; | ||
import org.mariadb.jdbc.HostAddress; | ||
|
||
/** Authentication plugin descriptor */ | ||
public interface AuthenticationPluginFactory { | ||
|
||
/** | ||
* Authentication plugin type. | ||
* | ||
* @return authentication plugin type. ex: mysql_native_password | ||
*/ | ||
String type(); | ||
|
||
/** | ||
* Plugin initialization. | ||
* | ||
* @param authenticationData authentication data (password/token) | ||
* @param seed server provided seed | ||
* @param conf Connection options | ||
* @param hostAddress host address | ||
*/ | ||
AuthenticationPlugin initialize( | ||
String authenticationData, byte[] seed, Configuration conf, HostAddress hostAddress); | ||
|
||
/** | ||
* Authentication plugin required SSL to be used | ||
* | ||
* @return true if SSL is required | ||
*/ | ||
default boolean requireSsl() { | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/java/org/mariadb/jdbc/plugin/authentication/addon/ClearPasswordPluginFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// SPDX-License-Identifier: LGPL-2.1-or-later | ||
// Copyright (c) 2012-2014 Monty Program Ab | ||
// Copyright (c) 2015-2024 MariaDB Corporation Ab | ||
package org.mariadb.jdbc.plugin.authentication.addon; | ||
|
||
import org.mariadb.jdbc.Configuration; | ||
import org.mariadb.jdbc.HostAddress; | ||
import org.mariadb.jdbc.plugin.AuthenticationPlugin; | ||
import org.mariadb.jdbc.plugin.AuthenticationPluginFactory; | ||
|
||
/** Clear password plugin. */ | ||
public class ClearPasswordPluginFactory implements AuthenticationPluginFactory { | ||
|
||
@Override | ||
public String type() { | ||
return "mysql_clear_password"; | ||
} | ||
|
||
@Override | ||
public boolean requireSsl() { | ||
return true; | ||
} | ||
|
||
/** | ||
* Initialization. | ||
* | ||
* @param authenticationData authentication data (password/token) | ||
* @param seed server provided seed | ||
* @param conf Connection string options | ||
* @param hostAddress host information | ||
*/ | ||
public AuthenticationPlugin initialize( | ||
String authenticationData, byte[] seed, Configuration conf, HostAddress hostAddress) { | ||
return new ClearPasswordPlugin(authenticationData); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/java/org/mariadb/jdbc/plugin/authentication/addon/SendGssApiAuthPacketFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// SPDX-License-Identifier: LGPL-2.1-or-later | ||
// Copyright (c) 2012-2014 Monty Program Ab | ||
// Copyright (c) 2015-2024 MariaDB Corporation Ab | ||
package org.mariadb.jdbc.plugin.authentication.addon; | ||
|
||
import org.mariadb.jdbc.Configuration; | ||
import org.mariadb.jdbc.HostAddress; | ||
import org.mariadb.jdbc.plugin.AuthenticationPlugin; | ||
import org.mariadb.jdbc.plugin.AuthenticationPluginFactory; | ||
|
||
/** GSSAPI plugin */ | ||
public class SendGssApiAuthPacketFactory implements AuthenticationPluginFactory { | ||
|
||
@Override | ||
public String type() { | ||
return "auth_gssapi_client"; | ||
} | ||
|
||
/** | ||
* Initialization. | ||
* | ||
* @param authenticationData authentication data (password/token) | ||
* @param seed server provided seed | ||
* @param conf Connection string options | ||
* @param hostAddress host information | ||
*/ | ||
public AuthenticationPlugin initialize( | ||
String authenticationData, byte[] seed, Configuration conf, HostAddress hostAddress) { | ||
return new SendGssApiAuthPacket(seed, conf); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...ava/org/mariadb/jdbc/plugin/authentication/standard/CachingSha2PasswordPluginFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: LGPL-2.1-or-later | ||
// Copyright (c) 2012-2014 Monty Program Ab | ||
// Copyright (c) 2015-2024 MariaDB Corporation Ab | ||
package org.mariadb.jdbc.plugin.authentication.standard; | ||
|
||
import org.mariadb.jdbc.Configuration; | ||
import org.mariadb.jdbc.HostAddress; | ||
import org.mariadb.jdbc.plugin.AuthenticationPlugin; | ||
import org.mariadb.jdbc.plugin.AuthenticationPluginFactory; | ||
|
||
/** Mysql caching sha2 password plugin */ | ||
public class CachingSha2PasswordPluginFactory implements AuthenticationPluginFactory { | ||
|
||
@Override | ||
public String type() { | ||
return "caching_sha2_password"; | ||
} | ||
|
||
public AuthenticationPlugin initialize( | ||
String authenticationData, byte[] seed, Configuration conf, HostAddress hostAddress) { | ||
return new CachingSha2PasswordPlugin(authenticationData, seed, conf, hostAddress); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.