From d9b6119ea9265266438b95fcde7af6a2b74eb3ae Mon Sep 17 00:00:00 2001
From: Wyatt Nielsen <wyatt.nielsen@parivedasolutions.com>
Date: Wed, 6 Nov 2019 10:46:44 -0600
Subject: [PATCH] Merging core changes from Azure DevOps

---
 azure-pipelines.yml                           |  46 ------
 indexer-core/pom.xml                          |  27 +++-
 .../osdu/indexer/api/HealthCheckApi.java      |   4 +-
 .../osdu/indexer/api/RecordIndexerApi.java    |   6 +-
 .../osdu/indexer/api/ReindexApi.java          |  43 +----
 .../AuthorizationServiceEntitlements.java     | 109 +++++++++++++
 .../osdu/indexer/logging/AuditLogger.java     |   6 +-
 .../middleware/AuthorizationFilter.java       |  32 ++++
 .../service/AttributeParsingServiceImpl.java  |  10 +-
 .../osdu/indexer/service/CronServiceImpl.java |  10 +-
 .../service/ElasticSettingServiceImpl.java    |  10 +-
 .../indexer/service/IndexCopyServiceImpl.java |  16 +-
 .../service/IndexSchemaServiceImpl.java       |  16 +-
 .../service/IndexerMappingServiceImpl.java    |   6 +-
 .../indexer/service/IndexerServiceImpl.java   |  29 ++--
 .../indexer/service/ReindexServiceImpl.java   |  10 +-
 .../indexer/service/StorageServiceImpl.java   |  10 +-
 .../service/TenantInfoServiceImpl.java        |   8 +-
 .../indexer/util/IndexerQueueTaskBuilder.java |   6 +-
 .../osdu/indexer/util/JobStatus.java          |   4 +-
 .../AuthorizationServiceEntitlementsTest.java | 153 ++++++++++++++++++
 .../indexer/middleware/IndexerFilterTest.java | 128 ---------------
 .../RedirectHttpRequestsHandlerTest.java      | 106 ------------
 pom.xml                                       |  73 +++------
 24 files changed, 420 insertions(+), 448 deletions(-)
 delete mode 100644 azure-pipelines.yml
 create mode 100644 indexer-core/src/main/java/org/opengroup/osdu/indexer/auth/AuthorizationServiceEntitlements.java
 create mode 100644 indexer-core/src/main/java/org/opengroup/osdu/indexer/middleware/AuthorizationFilter.java
 create mode 100644 indexer-core/src/test/java/org/opengroup/osdu/indexer/auth/AuthorizationServiceEntitlementsTest.java
 delete mode 100644 indexer-core/src/test/java/org/opengroup/osdu/indexer/middleware/IndexerFilterTest.java
 delete mode 100644 indexer-core/src/test/java/org/opengroup/osdu/indexer/middleware/RedirectHttpRequestsHandlerTest.java

diff --git a/azure-pipelines.yml b/azure-pipelines.yml
deleted file mode 100644
index f3554480c..000000000
--- a/azure-pipelines.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-# Maven
-# Build your Java project and run tests with Apache Maven.
-# Add steps that analyze code, save build artifacts, deploy, and more:
-# https://docs.microsoft.com/azure/devops/pipelines/languages/java
-
-trigger:
-  branches:
-    include:
-    - master
-  paths:
-    exclude:
-      - README.md
-      - .gitignore
-
-pool:
-  name: Hosted Ubuntu 1604
-  demands: maven
-
-steps:
-- task: Maven@3
-  displayName: 'build, test, code coverage'
-  inputs:
-    mavenPomFile: 'pom.xml'
-    options: '--settings ./indexer-service-root/maven/settings.xml -DVSTS_FEED_TOKEN=$(VSTS_FEED_TOKEN)'
-    #testResultsFiles: '**/*/TEST-*.xml'
-    #codeCoverageToolOption: JaCoCo
-    goals: 'install'
-
-- task: CopyFiles@2
-  displayName: 'Copy Azure artifacts for maven deploy to: $(build.artifactstagingdirectory)'
-  inputs:
-    SourceFolder:
-    Contents: |
-      pom.xml
-      indexer-service-azure/maven/settings.xml
-      indexer-service-azure/pom.xml
-      indexer-service-azure/target/*-spring-boot.jar
-    TargetFolder: '$(build.artifactstagingdirectory)'
-    
-- task: PublishBuildArtifacts@1
-  displayName: 'Publish Artifact: drop'
-  inputs:
-    PathtoPublish: '$(build.artifactstagingdirectory)'
-    ArtifactName: 'drop'
-    publishLocation: 'Container'
-  condition: succeededOrFailed()
diff --git a/indexer-core/pom.xml b/indexer-core/pom.xml
index ef524baa0..1e60e8218 100644
--- a/indexer-core/pom.xml
+++ b/indexer-core/pom.xml
@@ -5,13 +5,13 @@
 	<parent>
 		<groupId>org.opengroup.osdu.indexer</groupId>
 		<artifactId>indexer-service</artifactId>
-		<version>1.0-SNAPSHOT</version>
+		<version>1.0.0</version>
 	</parent>
 
-	<artifactId>indexer-service-root</artifactId>
-	<version>1.0-SNAPSHOT</version>
-	<name>indexer-service-root</name>
-	<description>Indexer Service Root</description>
+	<artifactId>indexer-core</artifactId>
+	<version>1.0.0</version>
+	<name>indexer-core</name>
+	<description>Indexer Service Core</description>
 	<packaging>jar</packaging>
 
 	<!--<repositories>
@@ -68,7 +68,7 @@
 		<dependency>
 			<groupId>org.opengroup.osdu</groupId>
 			<artifactId>indexer-search-core-lib</artifactId>
-			<version>1.0.7</version>
+			<version>1.0.10</version>
 		</dependency>
 
 		<dependency>
@@ -198,5 +198,18 @@
 		</dependency>
 
 	</dependencies>
-
+    <build>
+        <defaultGoal>test</defaultGoal>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.4.2</version>
+                <configuration>
+                  <useSystemClassLoader>false</useSystemClassLoader>
+                  <threadCount>1</threadCount>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/api/HealthCheckApi.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/api/HealthCheckApi.java
index b08140420..c6c7d1b8e 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/api/HealthCheckApi.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/api/HealthCheckApi.java
@@ -27,14 +27,14 @@ import javax.annotation.security.PermitAll;
 
 @Log
 @RestController
-@RequestMapping("/_ah")
+@RequestMapping("/")
 @RequestScope
 public class HealthCheckApi {
 
     @PermitAll
     @GetMapping("/liveness_check")
     public ResponseEntity<String> livenessCheck(){
-        return new ResponseEntity<String>("Indexer service is alive", org.springframework.http.HttpStatus.OK);
+        return new ResponseEntity<String>("Indexer service is alive", HttpStatus.OK);
     }
 
     @PermitAll
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/api/RecordIndexerApi.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/api/RecordIndexerApi.java
index 505bd5504..6ac08b6ee 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/api/RecordIndexerApi.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/api/RecordIndexerApi.java
@@ -30,11 +30,11 @@ import org.opengroup.osdu.indexer.util.RecordInfo;
 import org.opengroup.osdu.is.core.model.RecordChangedMessages;
 import org.opengroup.osdu.is.core.util.AppException;
 import org.springframework.http.HttpStatus;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.context.annotation.RequestScope;
 
+import javax.inject.Inject;
 import javax.validation.Valid;
 import javax.validation.constraints.NotNull;
 import java.lang.reflect.Type;
@@ -46,9 +46,9 @@ import java.util.List;
 @RequestScope
 public class RecordIndexerApi {
 
-    @Autowired
+    @Inject
     private IndexerService indexerService;
-    @Autowired
+    @Inject
     private ReindexService reIndexService;
 
     // THIS IS AN INTERNAL USE API ONLY
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/api/ReindexApi.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/api/ReindexApi.java
index 2f2125e55..d5cbe7ecc 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/api/ReindexApi.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/api/ReindexApi.java
@@ -14,16 +14,10 @@
 
 package org.opengroup.osdu.indexer.api;
 
-import io.swagger.annotations.*;
-import org.opengroup.osdu.indexer.SwaggerDoc;
 import org.opengroup.osdu.indexer.logging.AuditLogger;
 import org.opengroup.osdu.indexer.model.RecordReindexRequest;
 import org.opengroup.osdu.indexer.service.ReindexService;
-import org.opengroup.osdu.core.api.DpsHeaders;
-import org.opengroup.osdu.core.multitenancy.TenantInfo;
 import org.opengroup.osdu.is.core.model.SearchServiceRole;
-import org.opengroup.osdu.is.core.util.AppError;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -32,51 +26,26 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.context.annotation.RequestScope;
 
-import javax.annotation.security.RolesAllowed;
+import javax.inject.Inject;
 import javax.validation.Valid;
 import javax.validation.constraints.NotNull;
 
 import static java.util.Collections.singletonList;
-@Api(
-        value = SwaggerDoc.INDEXER_TAG,
-        authorizations = {@Authorization(value = SwaggerDoc.BEARER_AUTH),
-                @Authorization(value = SwaggerDoc.GOOGLE_ID_AUTH),
-                @Authorization(value = SwaggerDoc.SAUTH_ID_AUTH)})
+
 @RestController
 @RequestMapping("/reindex")
-@ApiImplicitParams({
-        @ApiImplicitParam(name = DpsHeaders.ACCOUNT_ID, value = SwaggerDoc.PARAMETER_ACCOUNT_ID, required = true, defaultValue = TenantInfo.COMMON, dataType = "string", paramType = "header"),
-        @ApiImplicitParam(name = DpsHeaders.ON_BEHALF_OF, value = SwaggerDoc.PARAMETER_ONBEHALF_ACCOUNT_ID, dataType = "string", paramType = "header")})
 @RequestScope
 public class ReindexApi {
 
-    @Autowired
+    @Inject
     private ReindexService reIndexService;
-    @Autowired
+    @Inject
     private AuditLogger auditLogger;
 
-//    @PreAuthorize("@authorizationFilter.hasPermission('" + SearchServiceRole.ADMIN + "')")
+    @PreAuthorize("@authorizationFilter.hasPermission('" + SearchServiceRole.ADMIN + "')")
     @PostMapping
-    @ApiOperation(
-            value = SwaggerDoc.REINDEX_POST_TITLE,
-            nickname = SwaggerDoc.REINDEX_OPERATION_ID,
-            notes = SwaggerDoc.REINDEX_POST_NOTES)
-    @ApiResponses({
-            @ApiResponse(
-                    code = org.apache.http.HttpStatus.SC_OK,
-                    message = SwaggerDoc.REINDEX_POST_RESPONSE_OK,
-                    response = String.class),
-            @ApiResponse(
-                    code = org.apache.http.HttpStatus.SC_BAD_REQUEST,
-                    message = SwaggerDoc.REINDEX_POST_RESPONSE_BAD_REQUEST,
-                    response = AppError.class),
-            @ApiResponse(
-                    code = org.apache.http.HttpStatus.SC_NOT_FOUND,
-                    message = SwaggerDoc.REINDEX_POST_RESPONSE_NOT_FOUND,
-                    response = AppError.class)})
     public ResponseEntity reindex(
-            @NotNull(message = SwaggerDoc.REQUEST_VALIDATION_NOT_NULL_BODY)
-            @Valid @RequestBody RecordReindexRequest recordReindexRequest) {
+            @NotNull @Valid @RequestBody RecordReindexRequest recordReindexRequest) {
         this.reIndexService.reindexRecords(recordReindexRequest);
         this.auditLogger.getReindex(singletonList(recordReindexRequest.getKind()));
         return new ResponseEntity (org.springframework.http.HttpStatus.OK);
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/auth/AuthorizationServiceEntitlements.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/auth/AuthorizationServiceEntitlements.java
new file mode 100644
index 000000000..eea65eb17
--- /dev/null
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/auth/AuthorizationServiceEntitlements.java
@@ -0,0 +1,109 @@
+// Copyright 2017-2019, 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.indexer.auth;
+
+import lombok.extern.java.Log;
+import org.opengroup.osdu.core.api.DpsHeaders;
+import org.opengroup.osdu.core.api.entitlements.EntitlementsException;
+import org.opengroup.osdu.core.api.entitlements.IEntitlementsFactory;
+import org.opengroup.osdu.core.api.entitlements.IEntitlementsService;
+import org.opengroup.osdu.core.api.entitlements.models.GroupInfo;
+import org.opengroup.osdu.core.api.entitlements.models.Groups;
+import org.opengroup.osdu.core.httpclient.HttpResponse;
+import org.opengroup.osdu.is.core.logging.JaxRsDpsLog;
+import org.opengroup.osdu.is.core.model.AuthorizationResponse;
+import org.opengroup.osdu.is.core.provider.interfaces.auth.AuthorizationService;
+import org.opengroup.osdu.is.core.util.AppException;
+import org.opengroup.osdu.is.core.util.HeadersUtil;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Service;
+import org.springframework.web.context.annotation.RequestScope;
+
+import javax.inject.Inject;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+@RequestScope
+public class AuthorizationServiceEntitlements implements AuthorizationService {
+
+    private static final String TENANT_GROUP_FORMAT = "@%s";
+
+    @Inject
+    private IEntitlementsFactory factory;
+    @Inject
+    @Lazy
+    private JaxRsDpsLog jaxRsDpsLog;
+
+    @Override
+    public AuthorizationResponse authorizeAny(DpsHeaders headers, String... roles) {
+        AuthorizationResponse authorizationResponse = null;
+        IEntitlementsService service = factory.create(headers);
+        try {
+            authorizationResponse = authorizeAny(headers, service.getGroups(), roles);
+        } catch (EntitlementsException e) {
+            handleEntitlementsException(e, headers);
+        }
+        return authorizationResponse;
+    }
+
+    @Override
+    public AuthorizationResponse authorizeAny(String tenantName, DpsHeaders headers, String... roles) {
+        IEntitlementsService service = factory.create(headers);
+        AuthorizationResponse authorizationResponse = null;
+        try {
+            Groups groups = service.getGroups();
+            List<GroupInfo> allGroups = new ArrayList<>(groups.getGroups());
+            groups.setGroups(groups.getGroups().stream().filter(groupInfo -> groupInfo.getEmail()
+                    .contains(String.format(TENANT_GROUP_FORMAT, tenantName))).collect(Collectors.toList()));
+
+            authorizationResponse = authorizeAny(headers, groups, roles);
+            groups.setGroups(allGroups);
+        } catch (EntitlementsException e) {
+            handleEntitlementsException(e, headers);
+        }
+        return authorizationResponse;
+    }
+
+    private void handleEntitlementsException(EntitlementsException e, DpsHeaders headers) {
+        HttpResponse response = e.getHttpResponse();
+        throw new AppException(response.getResponseCode(), "Access denied", "The user is not authorized to perform this action", HeadersUtil.toLogMsg(headers, null), e);
+    }
+
+    private AuthorizationResponse authorizeAny(DpsHeaders headers, Groups groups, String... roles) {
+        String userEmail = null;
+        List<String> logMessages = new ArrayList<>();
+        Long curTimeStamp = System.currentTimeMillis();
+        Long latency = System.currentTimeMillis() - curTimeStamp;
+
+        logMessages.add(String.format("entitlements-api latency: %s", latency));
+        logMessages.add(String.format("groups: %s", getEmailFromGroups(groups)));
+        if (groups != null) {
+            userEmail = groups.getMemberEmail();
+            if (groups.any(roles)) {
+                return AuthorizationResponse.builder().user(userEmail).groups(groups).build();
+            }
+        }
+        jaxRsDpsLog.info(String.join(" | ", logMessages));
+        jaxRsDpsLog.info(HeadersUtil.toLogMsg(headers, userEmail));
+        throw AppException.createUnauthorized("required search service roles are missing for user");
+    }
+
+    private String getEmailFromGroups(Groups groups) {
+        if (groups == null) return "";
+        return groups.getGroups().stream().map(GroupInfo::getEmail).collect(Collectors.joining(" | "));
+    }
+}
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/logging/AuditLogger.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/logging/AuditLogger.java
index 62fb15418..7bd9e97c3 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/logging/AuditLogger.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/logging/AuditLogger.java
@@ -17,19 +17,19 @@ package org.opengroup.osdu.indexer.logging;
 import org.opengroup.osdu.core.logging.payload.AuditPayload;
 import org.opengroup.osdu.is.core.logging.JaxRsDpsLog;
 import org.opengroup.osdu.is.core.provider.interfaces.util.IHeadersInfo;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.context.annotation.RequestScope;
 
+import javax.inject.Inject;
 import java.util.List;
 
 @Component
 @RequestScope
 public class AuditLogger {
 
-    @Autowired
+    @Inject
     private JaxRsDpsLog logger;
-    @Autowired
+    @Inject
     private IHeadersInfo headers;
 
     private AuditEvents events = null;
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/middleware/AuthorizationFilter.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/middleware/AuthorizationFilter.java
new file mode 100644
index 000000000..fbdbd0669
--- /dev/null
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/middleware/AuthorizationFilter.java
@@ -0,0 +1,32 @@
+package org.opengroup.osdu.indexer.middleware;
+
+import com.google.common.base.Strings;
+import lombok.extern.java.Log;
+import org.opengroup.osdu.core.api.DpsHeaders;
+import org.opengroup.osdu.is.core.model.AuthorizationResponse;
+import org.opengroup.osdu.is.core.provider.interfaces.auth.AuthorizationService;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.annotation.RequestScope;
+import javax.inject.Inject;
+
+@Log
+@Component("authorizationFilter")
+@RequestScope
+public class AuthorizationFilter {
+
+    @Inject
+    private AuthorizationService authorizationService;
+
+    private DpsHeaders headers;
+
+    @Inject
+    AuthorizationFilter(DpsHeaders headers) {
+        this.headers = headers;
+    }
+
+    public boolean hasPermission(String... requiredRoles) {
+        AuthorizationResponse authResponse = authorizationService.authorizeAny(headers, requiredRoles);
+        headers.put(DpsHeaders.USER_EMAIL, authResponse.getUser());
+        return true;
+    }
+}
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/AttributeParsingServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/AttributeParsingServiceImpl.java
index a2e3ccec5..370194f3e 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/AttributeParsingServiceImpl.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/AttributeParsingServiceImpl.java
@@ -29,10 +29,10 @@ import org.opengroup.osdu.indexer.util.parser.DateTimeParser;
 import org.opengroup.osdu.indexer.util.parser.NumberParser;
 
 import org.opengroup.osdu.is.core.util.Constants;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.web.context.annotation.RequestScope;
 
+import javax.inject.Inject;
 import java.lang.reflect.Type;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -47,13 +47,13 @@ public class AttributeParsingServiceImpl implements IAttributeParsingService {
     private static final String GEOMETRY_COLLECTION = "geometrycollection";
     private static final String GEOMETRIES = "geometries";
 
-    @Autowired
+    @Inject
     private NumberParser numberParser;
-    @Autowired
+    @Inject
     private DateTimeParser dateTimeParser;
-    @Autowired
+    @Inject
     private GeometryConversionService geometryConversionService;
-    @Autowired
+    @Inject
     private JobStatus jobStatus;
 
     @Override
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/CronServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/CronServiceImpl.java
index 3ab464818..268f8196b 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/CronServiceImpl.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/CronServiceImpl.java
@@ -24,10 +24,10 @@ import org.opengroup.osdu.is.core.provider.interfaces.util.IRequestInfo;
 import org.opengroup.osdu.is.core.service.IndicesService;
 import org.opengroup.osdu.is.core.util.AppException;
 import org.opengroup.osdu.is.core.util.ElasticClientHandler;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
+import javax.inject.Inject;
 import java.io.IOException;
 import java.time.Instant;
 import java.time.temporal.ChronoUnit;
@@ -36,13 +36,13 @@ import java.util.List;
 @Service
 public class CronServiceImpl implements CronService{
 
-        @Autowired
+        @Inject
         private ElasticClientHandler elasticClientHandler;
-        @Autowired
+        @Inject
         private IRequestInfo requestInfo;
-        @Autowired
+        @Inject
         private IndicesService indicesService;
-        @Autowired
+        @Inject
         private JaxRsDpsLog log;
 
         @Value("${CRON_INDEX_CLEANUP_THRESHOLD_DAYS}")
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/ElasticSettingServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/ElasticSettingServiceImpl.java
index b07fd8209..e93c26135 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/ElasticSettingServiceImpl.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/ElasticSettingServiceImpl.java
@@ -23,20 +23,20 @@ import org.opengroup.osdu.is.core.provider.interfaces.persistence.ElasticReposit
 import org.opengroup.osdu.is.core.service.ElasticSettingService;
 import org.opengroup.osdu.is.core.service.TenantInfoService;
 import org.opengroup.osdu.is.core.util.AppException;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
+import javax.inject.Inject;
 
 @Service
 public class ElasticSettingServiceImpl implements ElasticSettingService {
 
-    @Autowired
+    @Inject
     private TenantInfoService tenantInfoServiceProvider;
-    @Autowired
+    @Inject
     private ElasticRepository elasticRepository;
-    @Autowired
+    @Inject
     private IElasticCredentialsCache elasticCredentialCache;
-    @Autowired
+    @Inject
     private JaxRsDpsLog log;
 
     @Value("${GAE_SERVICE}")
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexCopyServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexCopyServiceImpl.java
index 97792aae1..b8df1edac 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexCopyServiceImpl.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexCopyServiceImpl.java
@@ -33,9 +33,9 @@ import org.opengroup.osdu.is.core.provider.interfaces.util.IHeadersInfo;
 import org.opengroup.osdu.is.core.service.ElasticSettingService;
 import org.opengroup.osdu.is.core.service.IndicesService;
 import org.opengroup.osdu.is.core.util.*;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.inject.Inject;
 import java.io.IOException;
 import java.lang.reflect.Type;
 import java.util.HashMap;
@@ -44,19 +44,19 @@ import java.util.Map;
 @Service
 public class IndexCopyServiceImpl implements IndexCopyService {
 
-    @Autowired
+    @Inject
     private ElasticClientHandler elasticClientHandler;
-    @Autowired
+    @Inject
     private ElasticIndexNameResolver elasticIndexNameResolver;
-    @Autowired
+    @Inject
     private IndicesService indicesService;
-    @Autowired
+    @Inject
     private ElasticSettingService elasticSettingService;
-    @Autowired
+    @Inject
     private IndexerMappingService mappingService;
-    @Autowired
+    @Inject
     private IHeadersInfo headersInfo;
-    @Autowired
+    @Inject
     private AuditLogger auditLogger;
 
     @Override
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexSchemaServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexSchemaServiceImpl.java
index 6225cb714..ba6d69c7c 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexSchemaServiceImpl.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexSchemaServiceImpl.java
@@ -31,10 +31,10 @@ import org.opengroup.osdu.is.core.service.IndicesService;
 import org.opengroup.osdu.is.core.util.AppException;
 import org.opengroup.osdu.is.core.util.ElasticClientHandler;
 import org.opengroup.osdu.is.core.util.ElasticIndexNameResolver;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.apache.http.HttpStatus;
 import org.springframework.stereotype.Service;
 
+import javax.inject.Inject;
 
 import java.io.IOException;
 import java.util.HashMap;
@@ -47,19 +47,19 @@ public class IndexSchemaServiceImpl implements IndexSchemaService {
 
     private final Gson gson = new Gson();
 
-    @Autowired
+    @Inject
     private JaxRsDpsLog log;
-    @Autowired
+    @Inject
     private StorageService storageService;
-    @Autowired
+    @Inject
     private ElasticClientHandler elasticClientHandler;
-    @Autowired
+    @Inject
     private ElasticIndexNameResolver elasticIndexNameResolver;
-    @Autowired
+    @Inject
     private IndexerMappingService mappingService;
-    @Autowired
+    @Inject
     private IndicesService indicesService;
-    @Autowired
+    @Inject
     private ISchemaCache schemaCache;
 
     public void processSchemaMessages(Map<String, OperationType> schemaMsgs) throws IOException {
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerMappingServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerMappingServiceImpl.java
index 2a0a92d16..ba2aecad4 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerMappingServiceImpl.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerMappingServiceImpl.java
@@ -46,15 +46,15 @@ import org.opengroup.osdu.is.core.util.AppException;
 import org.opengroup.osdu.is.core.util.Constants;
 import org.opengroup.osdu.is.core.util.ElasticClientHandler;
 import org.opengroup.osdu.is.core.util.Preconditions;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import javax.inject.Inject;
 
 @Service
 public class IndexerMappingServiceImpl extends MappingServiceImpl implements IndexerMappingService {
 
-    @Autowired
+    @Inject
     private JaxRsDpsLog log;
-    @Autowired
+    @Inject
     private ElasticClientHandler elasticClientHandler;
     private TimeValue REQUEST_TIMEOUT = TimeValue.timeValueMinutes(1);
 
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java
index 1d20c569c..c24aca491 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java
@@ -47,12 +47,11 @@ import org.opengroup.osdu.is.core.util.AppException;
 import org.opengroup.osdu.is.core.util.Constants;
 import org.opengroup.osdu.is.core.util.ElasticClientHandler;
 import org.opengroup.osdu.is.core.util.ElasticIndexNameResolver;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.commons.beanutils.NestedNullException;
 import org.springframework.stereotype.Service;
 
-
+import javax.inject.Inject;
 import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
 import java.util.*;
@@ -69,31 +68,31 @@ public class IndexerServiceImpl implements IndexerService {
 
     private final Gson gson = new Gson();
 
-    @Autowired
+    @Inject
     private JaxRsDpsLog jaxRsDpsLog;
-    @Autowired
+    @Inject
     private AuditLogger auditLogger;
-    @Autowired
+    @Inject
     private StorageService storageService;
-    @Autowired
+    @Inject
     private IndexSchemaService schemaService;
-    @Autowired
+    @Inject
     private IndicesService indicesService;
-    @Autowired
+    @Inject
     private IndexerMappingService mappingService;
-    @Autowired
+    @Inject
     private IPublisher progressPublisher;
-    @Autowired
+    @Inject
     private ElasticClientHandler elasticClientHandler;
-    @Autowired
+    @Inject
     private IndexerQueueTaskBuilder indexerQueueTaskBuilder;
-    @Autowired
+    @Inject
     private ElasticIndexNameResolver elasticIndexNameResolver;
-    @Autowired
+    @Inject
     private IAttributeParsingService attributeParsingServiceImpl;
-    @Autowired
+    @Inject
     private IRequestInfo requestInfo;
-    @Autowired
+    @Inject
     private JobStatus jobStatus;
 
     private DpsHeaders headers;
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/ReindexServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/ReindexServiceImpl.java
index 1293c160d..b0b5c94e2 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/ReindexServiceImpl.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/ReindexServiceImpl.java
@@ -28,9 +28,9 @@ import org.opengroup.osdu.is.core.logging.JaxRsDpsLog;
 import org.opengroup.osdu.is.core.model.RecordChangedMessages;
 import org.opengroup.osdu.is.core.provider.interfaces.util.IRequestInfo;
 import org.opengroup.osdu.is.core.util.AppException;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import javax.inject.Inject;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -40,13 +40,13 @@ import java.util.stream.Collectors;
 @Component
 public class ReindexServiceImpl implements ReindexService {
 
-    @Autowired
+    @Inject
     private StorageService storageService;
-    @Autowired
+    @Inject
     private IndexerQueueTaskBuilder indexerQueueTaskBuilder;
-    @Autowired
+    @Inject
     private IRequestInfo requestInfo;
-    @Autowired
+    @Inject
     private JaxRsDpsLog jaxRsDpsLog;
 
     @Override
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/StorageServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/StorageServiceImpl.java
index b1973d300..485f3e987 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/StorageServiceImpl.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/StorageServiceImpl.java
@@ -30,11 +30,11 @@ import org.opengroup.osdu.is.core.model.RecordMetaAttribute;
 import org.opengroup.osdu.is.core.provider.interfaces.util.IRequestInfo;
 import org.opengroup.osdu.is.core.service.UrlFetchService;
 import org.opengroup.osdu.is.core.util.AppException;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.apache.http.HttpStatus;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
+import javax.inject.Inject;
 import java.io.UnsupportedEncodingException;
 import java.lang.reflect.Type;
 import java.net.URISyntaxException;
@@ -53,13 +53,13 @@ public class StorageServiceImpl implements StorageService {
 
     private final Gson gson = new Gson();
 
-    @Autowired
+    @Inject
     private UrlFetchService urlFetchService;
-    @Autowired
+    @Inject
     private JobStatus jobStatus;
-    @Autowired
+    @Inject
     private IRequestInfo requestInfo;
-    @Autowired
+    @Inject
     private JaxRsDpsLog jaxRsDpsLog;
 
     @Value("${STORAGE_SCHEMA_HOST}")
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/TenantInfoServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/TenantInfoServiceImpl.java
index 4d670e851..0ec16d2fe 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/TenantInfoServiceImpl.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/TenantInfoServiceImpl.java
@@ -20,18 +20,18 @@ import org.opengroup.osdu.core.multitenancy.ITenantFactory;
 import org.opengroup.osdu.core.multitenancy.TenantInfo;
 import org.opengroup.osdu.is.core.service.TenantInfoService;
 import org.opengroup.osdu.is.core.util.AppException;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
+import javax.inject.Inject;
 
 @Component
 public class TenantInfoServiceImpl implements TenantInfoService {
 
-    @Autowired
+    @Inject
     private ITenantFactory tenantFactory;
-    @Autowired
+    @Inject
     private DpsHeaders headersInfo;
 
-    @Autowired
+    @Inject
     private TenantInfo tenantInfo;
 
     public TenantInfo getTenantInfo() {
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/IndexerQueueTaskBuilder.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/IndexerQueueTaskBuilder.java
index 47f3fc14c..0b844e122 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/IndexerQueueTaskBuilder.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/IndexerQueueTaskBuilder.java
@@ -22,12 +22,12 @@ import org.opengroup.osdu.is.core.httpclient.HttpResponse;
 import org.opengroup.osdu.is.core.logging.JaxRsDpsLog;
 import org.opengroup.osdu.is.core.model.CloudTaskRequest;
 import org.opengroup.osdu.is.core.service.UrlFetchService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 import org.springframework.web.context.annotation.RequestScope;
 
 import java.net.URISyntaxException;
+import javax.inject.Inject;
 
 import static org.opengroup.osdu.is.core.util.Constants.REINDEX_RELATIVE_URL;
 import static org.opengroup.osdu.is.core.util.Constants.WORKER_RELATIVE_URL;
@@ -37,9 +37,9 @@ import static org.opengroup.osdu.is.core.util.Constants.WORKER_RELATIVE_URL;
 @RequestScope
 public class IndexerQueueTaskBuilder {
 
-    @Autowired
+    @Inject
     private UrlFetchService urlFetchService;
-    @Autowired
+    @Inject
     private JaxRsDpsLog jaxRsDpsLog;
 
     @Value("${INDEXER_QUEUE_HOST}")
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/JobStatus.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/JobStatus.java
index b102b0924..a246228e8 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/JobStatus.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/JobStatus.java
@@ -22,10 +22,10 @@ import org.opengroup.osdu.indexer.model.IndexingStatus;
 import org.opengroup.osdu.indexer.model.OperationType;
 import org.opengroup.osdu.indexer.model.RecordStatus;
 import org.opengroup.osdu.is.core.logging.JaxRsDpsLog;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.context.annotation.RequestScope;
 
+import javax.inject.Inject;
 import java.time.Instant;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -36,7 +36,7 @@ import java.util.stream.Collectors;
 @RequestScope
 public class JobStatus {
 
-    @Autowired
+    @Inject
     private JaxRsDpsLog jaxRsDpsLog;
 
     private List<RecordStatus> statusesList = new ArrayList<>();
diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/auth/AuthorizationServiceEntitlementsTest.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/auth/AuthorizationServiceEntitlementsTest.java
new file mode 100644
index 000000000..1434113f9
--- /dev/null
+++ b/indexer-core/src/test/java/org/opengroup/osdu/indexer/auth/AuthorizationServiceEntitlementsTest.java
@@ -0,0 +1,153 @@
+// Copyright 2017-2019, 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.indexer.auth;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.opengroup.osdu.core.api.DpsHeaders;
+import org.opengroup.osdu.core.api.entitlements.EntitlementsException;
+import org.opengroup.osdu.core.api.entitlements.IEntitlementsFactory;
+import org.opengroup.osdu.core.api.entitlements.IEntitlementsService;
+import org.opengroup.osdu.core.api.entitlements.models.GroupInfo;
+import org.opengroup.osdu.core.api.entitlements.models.Groups;
+import org.opengroup.osdu.core.httpclient.HttpResponse;
+import org.opengroup.osdu.is.core.logging.JaxRsDpsLog;
+import org.opengroup.osdu.is.core.model.AuthorizationResponse;
+import org.opengroup.osdu.is.core.util.AppException;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.when;
+
+@RunWith(SpringRunner.class)
+public class AuthorizationServiceEntitlementsTest {
+
+    @Mock
+    private IEntitlementsFactory entitlementsFactory;
+    @Mock
+    private IEntitlementsService service;
+    @Mock
+    private JaxRsDpsLog log;
+    @InjectMocks
+    private AuthorizationServiceEntitlements sut;
+
+    @Before
+    public void setup() {
+        when(entitlementsFactory.create(any())).thenReturn(service);
+    }
+
+    @Test
+    public void should_returnUser_when_ussrHasPermission() throws EntitlementsException {
+
+        sut = createSut("service.search.user");
+
+        AuthorizationResponse result = sut.authorizeAny(DpsHeaders.createFromMap(new HashMap<>()), "service.search.user");
+
+        assertEquals("iamtester@dps.com", result.getUser());
+    }
+
+    @Test
+    public void should_returnUser_when_ussrHasAnyPermission() throws EntitlementsException {
+
+        sut = createSut("service.search.user");
+
+        AuthorizationResponse result = sut.authorizeAny(DpsHeaders.createFromMap(new HashMap<>()), "service.search.user", "service.search.owner");
+
+        assertEquals("iamtester@dps.com", result.getUser());
+    }
+
+    @Test
+    public void should_throwUnauthorized_when_userDoesNotHaveRequiredPermission() throws EntitlementsException {
+        sut = createSut("service.search.user");
+
+        try {
+            sut.authorizeAny(DpsHeaders.createFromMap(new HashMap<>()), "service.search.owner");
+            fail("expected exception");
+        } catch (AppException ex) {
+            assertEquals(401, ex.getError().getCode());
+        }
+    }
+
+    @Test
+    public void should_throwUnauthorized_when_userDoesNotBelongToAnyGroup() throws EntitlementsException {
+        sut = createSut("service.search.user");
+        HttpResponse response = new HttpResponse();
+        response.setResponseCode(401);
+        when(service.getGroups()).thenThrow(new EntitlementsException("", response));
+
+        try {
+            sut.authorizeAny(DpsHeaders.createFromMap(new HashMap<>()), "service.search.owner");
+            fail("expected exception");
+        } catch (AppException ex) {
+            assertEquals(401, ex.getError().getCode());
+        }
+    }
+
+    @Test
+    public void should_throwServerError_when_getGroupsThrowsServerError() throws EntitlementsException {
+        sut = createSut("service.search.user");
+        HttpResponse response = new HttpResponse();
+        response.setResponseCode(500);
+        when(service.getGroups()).thenThrow(new EntitlementsException("", response));
+        try {
+            sut.authorizeAny(DpsHeaders.createFromMap(new HashMap<>()), "service.search.owner");
+            fail("expected exception");
+        } catch (AppException ex) {
+            assertEquals(500, ex.getError().getCode());
+        }
+    }
+
+    @Test
+    public void should_throw403AppError_when_getGroupsThrows400EntitlementsError() throws EntitlementsException {
+        sut = createSut("service.search.user");
+        HttpResponse response = new HttpResponse();
+        response.setResponseCode(403);
+        when(service.getGroups()).thenThrow(new EntitlementsException("", response));
+        try {
+            sut.authorizeAny(DpsHeaders.createFromMap(new HashMap<>()), "service.search.owner");
+            fail("expected exception");
+        } catch (AppException ex) {
+            assertEquals(403, ex.getError().getCode());
+        }
+    }
+
+    private AuthorizationServiceEntitlements createSut(String... roles) throws EntitlementsException {
+
+        List<GroupInfo> groupInfos = new ArrayList<>();
+
+        for (String s : roles) {
+            GroupInfo group = new GroupInfo();
+            group.setName(s);
+            groupInfos.add(group);
+        }
+
+        Groups output = new Groups();
+        output.setMemberEmail("iamtester@dps.com");
+        output.setGroups(groupInfos);
+
+        when(service.getGroups()).thenReturn(output);
+
+        return sut;
+    }
+}
diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/middleware/IndexerFilterTest.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/middleware/IndexerFilterTest.java
deleted file mode 100644
index 1e3b6819e..000000000
--- a/indexer-core/src/test/java/org/opengroup/osdu/indexer/middleware/IndexerFilterTest.java
+++ /dev/null
@@ -1,128 +0,0 @@
-//// Copyright 2017-2019, 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.opendes.indexer.middleware;
-//
-//import org.junit.Assert;
-//import org.junit.Before;
-//import org.junit.Ignore;
-//import org.junit.Test;
-//import org.junit.runner.RunWith;
-//import org.mockito.InjectMocks;
-//import org.mockito.Mock;
-//import org.opendes.client.api.DpsHeaders;
-//import org.opendes.core.auth.AuthorizationService;
-//import org.opendes.core.util.Config;
-//import org.opendes.indexer.util.IRequestInfo;
-//import org.powermock.core.classloader.annotations.PrepareForTest;
-//import org.springframework.test.context.junit4.SpringRunner;
-//import org.springframework.web.bind.annotation.ExceptionHandler;
-//
-//import javax.annotation.security.RolesAllowed;
-//import javax.servlet.FilterChain;
-//import javax.servlet.ServletException;
-//import javax.servlet.ServletRequest;
-//import javax.servlet.ServletResponse;
-//import javax.servlet.http.HttpServletRequest;
-//import javax.ws.rs.container.ContainerRequestContext;
-//import javax.ws.rs.container.ResourceInfo;
-//import javax.ws.rs.core.UriInfo;
-//import java.io.IOException;
-//import java.util.HashMap;
-//import java.util.Map;
-//
-//import static org.mockito.Mockito.mock;
-//import static org.mockito.MockitoAnnotations.initMocks;
-//import static org.powermock.api.mockito.PowerMockito.mockStatic;
-//import static org.powermock.api.mockito.PowerMockito.when;
-//
-//@RunWith(SpringRunner.class)
-//@PrepareForTest({ContainerRequestContext.class, Config.class})
-//public class IndexerFilterTest {
-//
-//    private static final String ROLE1 = "role1";
-//    private static final String ROLE2 = "role2";
-//
-//    @Mock
-//    private ServletRequest request;
-//    @Mock
-//    private AuthorizationService authorizationService;
-//    @Mock(name = "resourceInfo")
-//    private ResourceInfo resourceInfo;
-//
-//    @Mock
-//    private IRequestInfo requestInfo;
-//    @InjectMocks
-//    private IndexerFilter filter;
-//
-//    private Map<String, String> headers;
-//
-//    @Before
-//    public void setup() {
-//        initMocks(this);
-//
-//        mockStatic(Config.class);
-//
-//        headers = new HashMap<>();
-//        headers.put(DpsHeaders.ACCOUNT_ID, "tenant1");
-//        headers.put(DpsHeaders.AUTHORIZATION, "Bearer geer.fereferv.cefe=");
-//        headers.put(DpsHeaders.CONTENT_TYPE, "application/json");
-//        headers.put("X-AppEngine-QueueName", "indexer-task-queue");
-//        DpsHeaders dpsHeaders = DpsHeaders.createFromMap(headers);
-//
-//        when(requestInfo.getHeaders()).thenReturn(dpsHeaders);
-//    }
-//
-//    @Ignore
-//    @Test
-//    @ExceptionHandler({IOException.class, ServletException.class})
-//    public void shouldNot_addAnyHeaders_filterSwaggerPath() throws IOException, ServletException {
-//        HttpServletRequest httpRequest = (HttpServletRequest) this.request;
-//        ServletResponse response = mock(ServletResponse.class);
-//        FilterChain filterChain = mock(FilterChain.class);
-//
-//        when(httpRequest.getRequestURI().toLowerCase()).thenReturn("/swagger.json");
-//
-//        when(httpRequest.getMethod()).thenReturn("GET");
-//
-//        this.filter.doFilter(this.request, response, filterChain);
-//        Assert.assertFalse(headers.containsKey(DpsHeaders.CORRELATION_ID));
-//        Assert.assertFalse(headers.containsKey(AppEngineHeaders.CLOUD_TRACE_CONTEXT));
-//    }
-//
-//    @Ignore
-//    @Test
-//    @ExceptionHandler({IOException.class, ServletException.class})
-//    public void shouldNot_addAnyHeaders_filterIndexerPath() throws IOException, ServletException {
-//        HttpServletRequest httpRequest = (HttpServletRequest) this.request;
-//        ServletResponse response = mock(ServletResponse.class);
-//        FilterChain filterChain = mock(FilterChain.class);
-//
-//        UriInfo urlInfo = mock(UriInfo.class);
-//        when(httpRequest.getRequestURI().toLowerCase()).thenReturn("task-handlers");
-//
-//        when(httpRequest.getMethod()).thenReturn("POST");
-//
-//        when(this.requestInfo.isTaskQueueRequest()).thenReturn(true);
-//
-//        this.filter.doFilter(this.request, response, filterChain);
-//        Assert.assertFalse(headers.containsKey(DpsHeaders.CORRELATION_ID));
-//        Assert.assertFalse(headers.containsKey(AppEngineHeaders.CLOUD_TRACE_CONTEXT));
-//    }
-//
-//    @RolesAllowed({ROLE1, ROLE2})
-//    public void rolesAllowedTestMethod() {
-//        // do nothing
-//    }
-//}
diff --git a/indexer-core/src/test/java/org/opengroup/osdu/indexer/middleware/RedirectHttpRequestsHandlerTest.java b/indexer-core/src/test/java/org/opengroup/osdu/indexer/middleware/RedirectHttpRequestsHandlerTest.java
deleted file mode 100644
index 0f86155fe..000000000
--- a/indexer-core/src/test/java/org/opengroup/osdu/indexer/middleware/RedirectHttpRequestsHandlerTest.java
+++ /dev/null
@@ -1,106 +0,0 @@
-//// Copyright 2017-2019, 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.opendes.indexer.middleware;
-//
-//import org.junit.Before;
-//import org.junit.Ignore;
-//import org.junit.Test;
-//import org.junit.runner.RunWith;
-//import org.mockito.InjectMocks;
-//import org.mockito.Mock;
-//import org.opengroup.core.util.AppException;
-//import org.opendes.indexer.util.IRequestInfo;
-//import org.springframework.test.context.junit4.SpringRunner;
-//import javax.ws.rs.container.ContainerRequestContext;
-//import javax.ws.rs.core.SecurityContext;
-//
-//import static org.junit.Assert.assertEquals;
-//import static org.junit.Assert.fail;
-//import static org.mockito.Mockito.when;
-//
-//@Ignore
-//@RunWith(SpringRunner.class)
-//public class RedirectHttpRequestsHandlerTest {
-////    @Mock
-////    private IRequestInfo requestInfo;
-////    @Mock
-////    private ContainerRequestContext context;
-////    @Mock
-////    private SecurityContext securityContext;
-////    @Mock
-////    private javax.inject.Provider<IRequestInfo> requestInfoProvider;
-////    @InjectMocks
-////    private RedirectHttpRequestsHandler sut;
-////
-////    @Before
-////    public void setup() {
-////        when(requestInfoProvider.get()).thenReturn(requestInfo);
-////    }
-////
-////    @Test
-////    public void should_throwAppException302WithHttpsLocation_when_isNotACron_And_IsNotUsingHttps() {
-////        when(requestInfo.isCronRequest()).thenReturn(false);
-////        when(context.getSecurityContext()).thenReturn(securityContext);
-////        when(securityContext.isSecure()).thenReturn(false);
-////
-////        try {
-////            sut.filter(context);
-////            fail("should throw");
-////        } catch (AppException e) {
-////            assertEquals(302, e.getError().getCode());
-////        }
-////    }
-////
-////    @Test
-////    public void should_throwAppException302WithHttpsLocation_when_isNotATaskQueue_And_IsNotUsingHttps() {
-////        when(requestInfo.isTaskQueueRequest()).thenReturn(false);
-////        when(context.getSecurityContext()).thenReturn(securityContext);
-////        when(securityContext.isSecure()).thenReturn(false);
-////
-////        try {
-////            sut.filter(context);
-////            fail("should throw");
-////        } catch (AppException e) {
-////            assertEquals(302, e.getError().getCode());
-////        }
-////    }
-////
-////    @Test
-////    public void should_notThrowAppException302WithHttpsLocation_when_isACron() {
-////        when(requestInfo.isCronRequest()).thenReturn(true);
-////        when(context.getSecurityContext()).thenReturn(securityContext);
-////        when(securityContext.isSecure()).thenReturn(false);
-////
-////        sut.filter(context);
-////    }
-////
-////    @Test
-////    public void should_notThrowAppException302WithHttpsLocation_when_isAHttpsRequest() {
-////        when(requestInfo.isCronRequest()).thenReturn(false);
-////        when(context.getSecurityContext()).thenReturn(securityContext);
-////        when(securityContext.isSecure()).thenReturn(true);
-////
-////        sut.filter(context);
-////    }
-////
-////    @Test
-////    public void should_notThrowAppException302WithHttpsLocation_when_isATaskQueue() {
-////        when(requestInfo.isTaskQueueRequest()).thenReturn(true);
-////        when(context.getSecurityContext()).thenReturn(securityContext);
-////        when(securityContext.isSecure()).thenReturn(false);
-////
-////        sut.filter(context);
-////    }
-//}
diff --git a/pom.xml b/pom.xml
index 97614e804..e4e8edb99 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,19 +14,13 @@
     <groupId>org.opengroup.osdu.indexer</groupId>
     <artifactId>indexer-service</artifactId>
     <packaging>pom</packaging>
-    <version>1.0-SNAPSHOT</version>
+    <version>1.0.0</version>
     <description>Indexer Service</description>
-<!--    <modules>-->
-<!--        <module>indexer-service-root</module>-->
-<!--        <module>indexer-service-gcp</module>-->
-<!--        <module>indexer-service-azure</module>-->
-<!--    </modules>-->
 
     <properties>
         <java.version>1.8</java.version>
         <springfox-version>2.7.0</springfox-version>
         <spring-cloud.version>Greenwich.SR2</spring-cloud.version>
-<!--        <java.version>1.8</java.version>-->
 <!--        <maven.compiler.target>1.8</maven.compiler.target>-->
 <!--        <maven.compiler.source>1.8</maven.compiler.source>-->
 <!--        <maven.war.plugin>2.6</maven.war.plugin>-->
@@ -50,72 +44,55 @@
         </repository>
     </repositories>
 
+    <distributionManagement>
+        <repository>
+            <id>dev-azure-com-slb-des-ext-collaboration-os-core</id>
+            <url>https://pkgs.dev.azure.com/slb-des-ext-collaboration/_packaging/os-core/maven/v1</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </repository>
+    </distributionManagement>
+    
     <profiles>
         <profile>
-            <id>root</id>
+            <id>indexer-core</id>
             <activation>
                 <!-- this profile is active by default -->
                 <activeByDefault>true</activeByDefault>
             </activation>
 
             <modules>
-                <module>indexer-service-root</module>
+                <module>indexer-core</module>
             </modules>
         </profile>
-
         <profile>
-            <id>gcp</id>
+            <id>indexer-azure</id>
             <activation>
                 <property>
-                    <name>vendor</name>
-                    <value>gcp</value>
+                    <name>provider</name>
+                    <value>indexer-azure</value>
                 </property>
             </activation>
-
             <modules>
-                <module>indexer-service-gcp</module>
+                <module>provider/indexer-azure</module>
             </modules>
-
         </profile>
         <profile>
-            <id>azure</id>
+            <id>indexer-gcp</id>
             <activation>
                 <property>
-                    <name>vendor</name>
-                    <value>azure</value>
+                    <name>provider</name>
+                    <value>indexer-gcp</value>
                 </property>
             </activation>
-
             <modules>
-                <module>indexer-service-azure</module>
+                <module>provider/indexer-gcp</module>
             </modules>
-
         </profile>
-
-<!--        &lt;!&ndash; Unit test only &ndash;&gt;-->
-<!--        <profile>-->
-<!--            <id>dev</id>-->
-<!--            <properties>-->
-<!--                <skip.unit.tests>false</skip.unit.tests>-->
-<!--                <skip.integration.tests>true</skip.integration.tests>-->
-<!--            </properties>-->
-<!--        </profile>-->
-<!--        &lt;!&ndash; Integration test only &ndash;&gt;-->
-<!--        <profile>-->
-<!--            <id>integration-test</id>-->
-<!--            <properties>-->
-<!--                <skip.integration.tests>false</skip.integration.tests>-->
-<!--                <skip.unit.tests>true</skip.unit.tests>-->
-<!--            </properties>-->
-<!--        </profile>-->
-<!--        &lt;!&ndash; Unit and Integration tests combined &ndash;&gt;-->
-<!--        <profile>-->
-<!--            <id>test-all</id>-->
-<!--            <properties>-->
-<!--                <skip.integration.tests>false</skip.integration.tests>-->
-<!--                <skip.unit.tests>false</skip.unit.tests>-->
-<!--            </properties>-->
-<!--        </profile>-->
     </profiles>
 
-</project>
\ No newline at end of file
+</project>
-- 
GitLab