Commit 0e00500a authored by Vibhuti Sharma [Microsoft]'s avatar Vibhuti Sharma [Microsoft]
Browse files

addressing MR comments

parent c5773b74
Pipeline #61105 failed with stages
in 1 minute and 50 seconds
This diff is collapsed.
......@@ -3,6 +3,7 @@ package org.opengroup.osdu.partition.provider.azure.security;
import com.azure.spring.autoconfigure.aad.UserPrincipal;
import com.nimbusds.jwt.JWTClaimsSet;
import net.minidev.json.JSONArray;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
......@@ -44,7 +45,7 @@ public class AzureIstioSecurityFilter extends OncePerRequestFilter {
protected void doFilterInternal(final HttpServletRequest servletRequest, final HttpServletResponse servletResponse, final FilterChain filterChain) throws ServletException, IOException {
final String istioPayload = servletRequest.getHeader(X_ISTIO_CLAIMS_PAYLOAD);
LOGGER.info(String.format("Received headers list: %s", Collections.list(servletRequest.getHeaderNames())));
LOGGER.debug("Received headers list: {}", Collections.list(servletRequest.getHeaderNames()));
try {
if (hasText(istioPayload)) {
......@@ -73,7 +74,7 @@ public class AzureIstioSecurityFilter extends OncePerRequestFilter {
}
} catch (ParseException ex) {
LOGGER.error("Failed to initialize UserPrincipal.", ex);
throw new ServletException(ex);
throw new AppException(500, "Unable to parse claims in istio payload", ex.getMessage());
}
try {
filterChain.doFilter(servletRequest, servletResponse);
......
# Copyright © Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
runtime.env.local=true
azure.activedirectory.client-id=${aad_client_id}
azure.activedirectory.AppIdUri=api://${azure.activedirectory.client-id}
azure.activedirectory.session-stateless=true
# Istio Auth Enabled
azure.istio.auth.enabled=false
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment