smolnar82 commented on code in PR #1208:
URL: https://github.com/apache/knox/pull/1208#discussion_r3129232425
##########
gateway-service-knoxtoken/src/test/java/org/apache/knox/gateway/service/knoxtoken/TokenServiceResourceTest.java:
##########
@@ -1487,6 +1487,37 @@ public void
passcodeShouldNotBeInResponseIfTokenStateServiceIsDisabled() throws
testPasscodeToken(false, false, false);
}
+ @Test
+ public void testClientCredentialsThirdPartyAppConfig() throws Exception {
+ tryClientCredentialsThirdPartyAppConfig(null, true);
+ tryClientCredentialsThirdPartyAppConfig("true", true);
+ tryClientCredentialsThirdPartyAppConfig("false", false);
+ }
+
+ private void tryClientCredentialsThirdPartyAppConfig(String configValue,
boolean expectedValue) throws Exception {
+ try {
+ tss = new PersistentTestTokenStateService();
+ final Map<String, String> contextExpectations = new HashMap<>();
+ if (configValue != null) {
+ contextExpectations.put("clientid.thirdPartyApp", configValue);
Review Comment:
Yes, this is correct.
`ClientCredentialsResource` declares its [own
prefix](https://github.com/apache/knox/blob/master/gateway-service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/ClientCredentialsResource.java#L42)
as `clientid.` and
`PasscodeTokenResourceBase#setExpectedParamsFromExtensionParams` uses that
prefix to differentiate params in various `KNOXTOKEN` service implementations,
such as `CLIENTID`.
This was needed when a topology contains more than one of these services
(`APIKEY` and `CLIENTID`, for instance) and we want to setup those services
properly and don't want to mix the configs (e.g. TTL=1 in `APIKEY` and TTL=2 in
`CLIENTID`).
--
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]