Commit 60460187 authored by neelesh thakur's avatar neelesh thakur Committed by Komal Makkar
Browse files

comments

parent 1596ddcd
......@@ -23,7 +23,7 @@ import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.core.common.provider.interfaces.IAuthorizationService;
import org.opengroup.osdu.notification.di.RequestInfoExt;
import org.opengroup.osdu.notification.utils.Config;
import org.opengroup.osdu.notification.provider.interfaces.ServiceAccountValidator;
import org.opengroup.osdu.notification.provider.interfaces.IServiceAccountValidator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.RequestScope;
......@@ -40,7 +40,7 @@ public class AuthorizationFilter {
@Autowired
private RequestInfoExt requestInfoExt;
@Autowired
private ServiceAccountValidator validator;
private IServiceAccountValidator validator;
public boolean hasAnyPermission(String... requiredRoles) {
DpsHeaders dpsHeaders = requestInfoExt.getHeaders();
......
/*
* Copyright 2017-2020, Schlumberger
*
* 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.
*/
package org.opengroup.osdu.notification.provider.interfaces;
public interface IAppProperties {
......
......@@ -16,7 +16,7 @@
package org.opengroup.osdu.notification.provider.interfaces;
public interface ServiceAccountValidator {
public interface IServiceAccountValidator {
boolean isValidPublisherServiceAccount(String jwt);
......
......@@ -28,7 +28,7 @@ import org.opengroup.osdu.core.common.provider.interfaces.IAuthorizationService;
import org.opengroup.osdu.notification.di.RequestInfoExt;
import org.opengroup.osdu.notification.pubsub.PubsubRequestBodyExtractor;
import org.opengroup.osdu.notification.utils.Config;
import org.opengroup.osdu.notification.provider.interfaces.ServiceAccountValidator;
import org.opengroup.osdu.notification.provider.interfaces.IServiceAccountValidator;
import org.powermock.modules.junit4.PowerMockRunner;
import java.util.HashMap;
......@@ -57,7 +57,7 @@ public class AuthorizationFilterTest {
@Mock
private IAuthorizationService authorizationService;
@Mock
private ServiceAccountValidator validator;
private IServiceAccountValidator validator;
@Mock
private PubsubRequestBodyExtractor extractor;
@InjectMocks
......
......@@ -21,12 +21,12 @@ import com.google.api.client.googleapis.auth.oauth2.GoogleIdTokenVerifier;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.jackson2.JacksonFactory;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.notification.provider.interfaces.ServiceAccountValidator;
import org.opengroup.osdu.notification.provider.interfaces.IServiceAccountValidator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class GoogleServiceAccountValidatorImpl implements ServiceAccountValidator {
public class GoogleServiceAccountValidatorImpl implements IServiceAccountValidator {
private final NetHttpTransport netHttpTransport = new NetHttpTransport();
private final JacksonFactory jacksonFactory = new JacksonFactory();
......
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