jakubmatyszewski commented on code in PR #20222:
URL: https://github.com/apache/druid/pull/20222#discussion_r3922949181


##########
extensions-core/druid-pac4j/src/test/java/org/apache/druid/security/pac4j/Pac4jFilterTest.java:
##########
@@ -196,4 +202,32 @@ public void testFilterCreation()
     Pac4jFilter filter = new Pac4jFilter("testName", "testAuthorizer", 
pac4jConfig, "/test-callback", "testPassphrase");
     Assertions.assertNotNull(filter);
   }
+
+  @Test
+  @SuppressWarnings("unchecked")
+  public void testAuthenticationResultContainsProfileAttributes()
+  {
+    // Verify that the AuthenticationResult context is populated with profile 
attributes,
+    // so downstream authorizers (e.g. OPA) can make group-based access 
decisions.
+    List<String> groups = Arrays.asList("group-a", "group-b");
+
+    CommonProfile profile = new CommonProfile();
+    profile.setId("test-user-id");
+    profile.addAttribute("groups", groups);
+    profile.addAttribute("email", "[email protected]");
+
+    Map<String, Object> authContext = Collections.singletonMap(

Review Comment:
   Ah, you are right... I had trouble adding tests previously as well. I think 
now it looks better, let me know what you think.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to