Akanksha-kedia commented on code in PR #17584:
URL: https://github.com/apache/pinot/pull/17584#discussion_r3420919584
##########
pinot-integration-test-base/src/test/java/org/apache/pinot/integration/tests/BasicAuthTestUtils.java:
##########
@@ -27,14 +27,14 @@ public final class BasicAuthTestUtils {
private BasicAuthTestUtils() {
}
- public static final String AUTH_TOKEN = "Basic YWRtaW46dmVyeXNlY3JldA=====";
+ public static final String AUTH_TOKEN = "Basic YWRtaW46dmVyeXNlY3JldA==";
public static final String AUTH_TOKEN_USER = "Basic dXNlcjpzZWNyZXQ==";
public static final Map<String, String> AUTH_HEADER =
Map.of("Authorization", AUTH_TOKEN);
public static final BasicHeader AUTH_HEADER_BASIC = new
BasicHeader("Authorization", AUTH_TOKEN);
public static final Map<String, String> AUTH_HEADER_USER =
Map.of("Authorization", AUTH_TOKEN_USER);
public static void addControllerConfiguration(Map<String, Object>
properties) {
- properties.put("controller.segment.fetcher.auth.token", AUTH_TOKEN);
+ properties.put("pinot.controller.segment.fetcher.auth.token", AUTH_TOKEN);
Review Comment:
Good point. The existing ControllerTest.java (line 1560) already sets
pinot.controller.segment.fetcher.auth.token (correct key), so it passes. But
there is no test that explicitly verifies the wrong key
(controller.segment.fetcher.auth.token without the pinot. prefix) is rejected —
the tests pass either way because auth simply is not applied when the key is
wrong.
I will add a unit test to PinotIngestionRestletResourceStatelessTest that:
1. Configures the controller with the correct key
pinot.controller.segment.fetcher.auth.token and asserts the AuthProvider
produces the expected auth header.
2. Configures it with the old wrong key
controller.segment.fetcher.auth.token and asserts the AuthProvider returns no
auth header.
This makes the bug regression-testable. I will push the test in the next
commit. @Jackie-Jiang
--
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]