github-advanced-security[bot] commented on code in PR #16979:
URL: https://github.com/apache/druid/pull/16979#discussion_r1737842842
##########
extensions-core/druid-pac4j/src/test/java/org/apache/druid/security/pac4j/Pac4jSessionStoreTest.java:
##########
@@ -131,4 +135,36 @@
Assert.assertTrue(Objects.requireNonNull(value).isPresent());
Assert.assertEquals(2, ((Map<String, CommonProfile>) value.get()).size());
}
+
+ @Test
+ public void testGetWithWrongPassphraseThrowsDruidException()
+ {
+ final WebContext webContext = EasyMock.mock(WebContext.class);
+ EasyMock.expect(webContext.getScheme()).andReturn("https");
+
+ final Capture<Cookie> cookieCapture = EasyMock.newCapture();
+ EasyMock.expect(webContext.getRequestCookies())
+ .andAnswer(() -> Collections.singleton(cookieCapture.getValue()));
+
+ webContext.addResponseCookie(EasyMock.capture(cookieCapture));
+ EasyMock.expectLastCall().once();
+ EasyMock.replay(webContext);
+
+ // Create a cookie with an invalid passphrase
+ new Pac4jSessionStore<>("invalid-passphrase").set(webContext, "key",
"value");
Review Comment:
## Hard-coded credential in API call
Hard-coded value flows to [sensitive API call](1).
[Show more
details](https://github.com/apache/druid/security/code-scanning/7757)
--
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]