Skip to content

Commit

Permalink
[#6245] fix(authz): Authorization should use classloader to create th…
Browse files Browse the repository at this point in the history
…e plugin
  • Loading branch information
jerqi committed Jan 15, 2025
1 parent 39ad18a commit 7acf817
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,15 @@ public void initAuthorizationPluginInstance(IsolatedClassLoader classLoader) {
try {
BaseAuthorization<?> authorization =
BaseAuthorization.createAuthorization(classLoader, authorizationProvider);

// Load the authorization plugin with the class loader of the catalog.
// Because the JDBC authorization plugin may load JDBC driver using the class loader.
authorizationPlugin =
authorization.newPlugin(entity.namespace().level(0), provider(), this.conf);
classLoader.withClassLoader(
cl ->
authorization.newPlugin(
entity.namespace().level(0), provider(), this.conf));

} catch (Exception e) {
LOG.error("Failed to load authorization with class loader", e);
throw new RuntimeException(e);
Expand Down

0 comments on commit 7acf817

Please sign in to comment.