Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

for-CONJ-742-and-CONJ-807, static loader for AuthenticationPlugin introduces Access Denied problem #159

Merged
merged 1 commit into from Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -28,9 +28,6 @@

public class AuthenticationPluginLoader {

private static ServiceLoader<AuthenticationPlugin> loader =
ServiceLoader.load(AuthenticationPlugin.class, Driver.class.getClassLoader());

/**
* Get authentication plugin from type String. Customs authentication plugin can be added
* implementing AuthenticationPlugin and registering new type in resources services.
Expand All @@ -44,6 +41,9 @@ public static AuthenticationPlugin get(String type) throws SQLException {
return null;
}

ServiceLoader<AuthenticationPlugin> loader =
ServiceLoader.load(AuthenticationPlugin.class, Driver.class.getClassLoader());

for (AuthenticationPlugin implClass : loader) {
if (type.equals(implClass.type())) {
return implClass;
Expand Down
Expand Up @@ -31,9 +31,6 @@
*/
public class CredentialPluginLoader {

private static ServiceLoader<CredentialPlugin> loader =
ServiceLoader.load(CredentialPlugin.class, Driver.class.getClassLoader());

/**
* Get current Identity plugin according to option `identityType`.
*
Expand All @@ -46,6 +43,9 @@ public static CredentialPlugin get(String type) throws SQLException {
return null;
}

ServiceLoader<CredentialPlugin> loader =
ServiceLoader.load(CredentialPlugin.class, Driver.class.getClassLoader());

for (CredentialPlugin implClass : loader) {
if (type.equals(implClass.type())) {
return implClass;
Expand Down