Skip to content

Commit

Permalink
Merge pull request #15568 from cdapio/CDAP-20966_dataplane_bugfix
Browse files Browse the repository at this point in the history
CDAP-20966 : bug fix adding AccessController to byte rewrite filter
  • Loading branch information
sahusanket authored Mar 20, 2024
2 parents f67062a + 8f8725c commit ce57be5
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import io.cdap.cdap.common.utils.DirUtils;
import io.cdap.cdap.internal.asm.FinallyAdapter;
import io.cdap.cdap.internal.asm.Signatures;
import io.cdap.cdap.security.spi.authorization.AccessController;
import io.cdap.cdap.security.spi.authorization.AccessControllerSpi;
import io.cdap.cdap.security.spi.authorization.Authorizer;
import java.io.File;
Expand Down Expand Up @@ -149,8 +150,8 @@ public byte[] rewriteClass(String className, InputStream input) throws IOExcepti
}

// Rewrite the AccessController class to wrap every methods call with context classloader change
Set<java.lang.reflect.Method> accessControlMethods = Stream.of(Authorizer.class,
AccessControllerSpi.class)
Set<java.lang.reflect.Method> accessControlMethods = Stream.of(Authorizer.class, AccessController.class,
AccessControllerSpi.class)
.flatMap(c -> Stream.of(c.getMethods())).collect(Collectors.toSet());

ClassReader cr = new ClassReader(input);
Expand Down

0 comments on commit ce57be5

Please sign in to comment.