Skip to content

Commit f200028

Browse files
committed
fix tests
Signed-off-by: Richard Salac <richard.salac@broadcom.com>
1 parent 46b2b6c commit f200028

4 files changed

Lines changed: 7 additions & 9 deletions

File tree

apiml-security-common/src/main/java/org/zowe/apiml/security/common/content/AbstractSecureContentFilter.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,12 @@ protected boolean shouldNotFilter(HttpServletRequest request) {
7676
*/
7777
@Override
7878
protected void doFilterInternal(@NonNull HttpServletRequest request, @NonNull HttpServletResponse response, @NonNull FilterChain filterChain) throws ServletException, IOException {
79-
Optional<AbstractAuthenticationToken> authenticationToken = extractContent(request);
79+
var authenticationToken = Optional.<AbstractAuthenticationToken>empty();
80+
try {
81+
authenticationToken = extractContent(request);
82+
} catch(AuthenticationException authenticationException) {
83+
failureHandler.onAuthenticationFailure(request, response, authenticationException);
84+
}
8085

8186
if (authenticationToken.isPresent()) {
8287
Authentication authentication = null;

apiml-security-common/src/main/java/org/zowe/apiml/security/common/util/JwtUtils.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ public RuntimeException handleJwtParserException(Exception exception) {
103103
return new TokenNotValidException("An internal error occurred while validating the token therefore the token is no longer valid.", exception);
104104
}
105105

106-
boolean verifyJwtSignatureWithJwk() {
107-
return false;
108-
}
109-
110106
/**
111107
* Extracts value of a field from an OIDC token. The value is extracted from a custom path which supports nested objects.
112108
* @param token to extract the field from

caching-service/src/main/java/org/zowe/apiml/caching/service/infinispan/config/InfinispanConfig.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ public class InfinispanConfig implements InitializingBean {
101101
@Value("${attlsEnabledOnInfinispanTest:${server.attlsServer.enabled:false}}")
102102
private boolean isServerAttlsEnabled;
103103

104-
@Value("${apiml.service.hostname:localhost}")
105-
private String hostname;
106-
107104
@Value("${caching.storage.infinispan.distributedSyncTimeoutSecs:360}")
108105
private int distributedSyncTimeout;
109106

zaas-service/src/main/java/org/zowe/apiml/zaas/security/query/SuccessfulQueryHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
5454
response.setContentType(MediaType.APPLICATION_JSON_VALUE);
5555
response.setStatus(HttpStatus.OK.value());
5656

57-
mapper.writeValue(response.getWriter(), authenticationService.parseJwtToken(token));
57+
mapper.writeValue(response.getWriter(), authenticationService.parseJwtToken(token).getQueryResponse());
5858

5959
response.getWriter().flush();
6060
if (!response.isCommitted()) {

0 commit comments

Comments
 (0)