Describe the bug
Security filter chain for the modulith /auth/invalidate endpoint was unintentionally changed in #4818.
- The security configuration defines path
gateway/api/v1/auth/invalidate/**
|
SecurityWebFilterChain gatewayInvalidateAndDistribute(ServerHttpSecurity http) { |
|
return x509SecurityConfig(http) |
|
.securityMatcher( |
|
new OrServerWebExchangeMatcher( |
|
pathMatchers(DELETE, "gateway/api/v1/auth/invalidate/**"), |
- In the PR the
invalidate endpoint was changed to /gateway/api/v1/auth/invalidate here:
|
protected String getInvalidateUrl(InstanceInfo instanceInfo) { |
|
return EurekaUtils.getUrl(instanceInfo) + "/gateway/api/v1/auth/invalidate"; |
and here:
|
protected String getInvalidateUrl(InstanceInfo instanceInfo) { |
|
return EurekaUtils.getUrl(instanceInfo) + "/gateway/api/v1/auth/invalidate"; |
The invalidate endpoint is used in modulith only when caching storage mode other than infinispan is used. This is possible only in development environment because the modulith start.sh script validates the configuration (
|
validate_caching_storage_mode() { |
|
storage_mode="${ZWE_components_caching_service_storage_mode:-${ZWE_configs_storage_mode}}" |
|
storage_mode_lc=$(printf '%s' "${storage_mode}" | tr '[:upper:]' '[:lower:]') |
|
|
|
if [ -n "${storage_mode}" ] && [ "${storage_mode_lc}" != "infinispan" ]; then |
|
echo "API ML single service requires caching storage mode set to infinispan" |
|
return 1 |
|
fi |
|
} |
)
Such configuration is not covered in tests.
Do we want to support other caching storage modes than infinispan in modulith (even for tests or development environment)? If yes, we should fix it and add an integration test configuration. Otherwise this is a dead code to be removed.
Describe the bug
Security filter chain for the modulith
/auth/invalidateendpoint was unintentionally changed in #4818.gateway/api/v1/auth/invalidate/**api-layer/apiml/src/main/java/org/zowe/apiml/WebSecurityConfig.java
Lines 546 to 550 in a656f6d
invalidateendpoint was changed to/gateway/api/v1/auth/invalidatehere:api-layer/zaas-service/src/main/java/org/zowe/apiml/zaas/security/service/ModulithAuthenticationService.java
Lines 45 to 46 in a656f6d
and here:
api-layer/zaas-service/src/main/java/org/zowe/apiml/zaas/security/service/ModulithAuthenticationService.java
Lines 45 to 46 in a656f6d
The
invalidateendpoint is used in modulith only when caching storage mode other than infinispan is used. This is possible only in development environment because the modulith start.sh script validates the configuration (api-layer/apiml-package/src/main/resources/bin/validate.sh
Lines 13 to 21 in a656f6d
Such configuration is not covered in tests.
Do we want to support other caching storage modes than infinispan in modulith (even for tests or development environment)? If yes, we should fix it and add an integration test configuration. Otherwise this is a dead code to be removed.