Commit 10d72a80 authored by Gitlab Runner's avatar Gitlab Runner
Browse files
parents 65a4e473 b1f76d51
......@@ -18,14 +18,14 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.opengroup.osdu</groupId>
<artifactId>partition-core</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<description>Core project for the partition service</description>
<packaging>jar</packaging>
<parent>
<groupId>org.opengroup.osdu</groupId>
<artifactId>partition</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -18,7 +18,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.opengroup.osdu</groupId>
<artifactId>partition</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<description>Partition Service</description>
<properties>
......
......@@ -21,13 +21,13 @@
<parent>
<artifactId>partition</artifactId>
<groupId>org.opengroup.osdu</groupId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>partition-aws</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<description>Partition service on AWS</description>
<packaging>jar</packaging>
......@@ -63,7 +63,7 @@
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>partition-core</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
</dependency>
<!-- AWS managed packages -->
......
......@@ -4,20 +4,20 @@
<parent>
<artifactId>partition</artifactId>
<groupId>org.opengroup.osdu</groupId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>partition-azure</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<description>Partition service on Azure</description>
<packaging>jar</packaging>
<properties>
<osdu.partition-core.version>0.6.0-SNAPSHOT</osdu.partition-core.version>
<osdu.partition-core.version>0.6.1-SNAPSHOT</osdu.partition-core.version>
<osdu.corelibazure.version>0.0.44</osdu.corelibazure.version>
<osdu.oscorecommon.version>0.3.16</osdu.oscorecommon.version>
<osdu.oscorecommon.version>0.3.28</osdu.oscorecommon.version>
<azure.version>2.3.5</azure.version>
<junit.version>4.12</junit.version>
<mockito.version>2.25.0</mockito.version>
......
......@@ -5,12 +5,12 @@
<parent>
<artifactId>partition</artifactId>
<groupId>org.opengroup.osdu</groupId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>partition-gcp</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<description>Partition service on GCP</description>
<packaging>jar</packaging>
......@@ -19,12 +19,12 @@
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>partition-core</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-core-common</artifactId>
<version>0.3.16</version>
<version>0.3.28</version>
</dependency>
<dependency>
......
......@@ -18,9 +18,13 @@
package org.opengroup.osdu.partition.provider.gcp.security;
import lombok.RequiredArgsConstructor;
import javax.inject.Inject;
import org.opengroup.osdu.core.common.entitlements.EntitlementsAPIConfig;
import org.opengroup.osdu.core.common.entitlements.EntitlementsFactory;
import org.opengroup.osdu.core.common.entitlements.IEntitlementsFactory;
import org.opengroup.osdu.core.common.http.json.HttpResponseBodyMapper;
import org.opengroup.osdu.partition.provider.gcp.config.PropertiesConfiguration;
import org.springframework.beans.factory.config.AbstractFactoryBean;
import org.springframework.stereotype.Component;
......@@ -31,13 +35,17 @@ public class EntitlementsClientFactory extends AbstractFactoryBean<IEntitlements
private final PropertiesConfiguration properties;
@Inject
private HttpResponseBodyMapper httpResponseBodyMapper;
@Override
protected IEntitlementsFactory createInstance() throws Exception {
return new EntitlementsFactory(EntitlementsAPIConfig
.builder()
.rootUrl(properties.getAuthorizeApi())
.build());
.build(),
httpResponseBodyMapper);
}
@Override
......
......@@ -9,13 +9,13 @@
<parent>
<artifactId>partition</artifactId>
<groupId>org.opengroup.osdu</groupId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>partition-ibm</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<description>Partition service on IBM</description>
<packaging>jar</packaging>
......@@ -28,7 +28,7 @@
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-core-common</artifactId>
<version>0.3.16</version>
<version>0.3.28</version>
</dependency>
<dependency>
<groupId>org.opengroup.osdu</groupId>
......@@ -38,7 +38,7 @@
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>partition-core</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
</dependency>
......
......@@ -3,9 +3,12 @@
package org.opengroup.osdu.partition.provider.ibm.security;
import javax.inject.Inject;
import org.opengroup.osdu.core.common.entitlements.EntitlementsAPIConfig;
import org.opengroup.osdu.core.common.entitlements.EntitlementsFactory;
import org.opengroup.osdu.core.common.entitlements.IEntitlementsFactory;
import org.opengroup.osdu.core.common.http.json.HttpResponseBodyMapper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.AbstractFactoryBean;
import org.springframework.stereotype.Component;
......@@ -19,6 +22,9 @@ public class EntitlementsClientFactory extends AbstractFactoryBean<IEntitlements
@Value("${AUTHORIZE_API_KEY:}")
private String AUTHORIZE_API_KEY;
@Inject
private HttpResponseBodyMapper httpResponseBodyMapper;
@Override
protected IEntitlementsFactory createInstance() throws Exception {
......@@ -26,7 +32,8 @@ public class EntitlementsClientFactory extends AbstractFactoryBean<IEntitlements
.builder()
.rootUrl(AUTHORIZE_API)
.apiKey(AUTHORIZE_API_KEY)
.build());
.build(),
httpResponseBodyMapper);
}
@Override
......
......@@ -19,14 +19,14 @@
<parent>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-partition-testing</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.opengroup.osdu.partition</groupId>
<artifactId>partition-test-aws</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
......@@ -65,7 +65,7 @@
<dependency>
<groupId>org.opengroup.osdu.partition</groupId>
<artifactId>partition-test-core</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
</dependency>
<dependency>
......
......@@ -20,13 +20,13 @@
<parent>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-partition-testing</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.opengroup.osdu.partition</groupId>
<artifactId>partition-test-azure</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
......@@ -65,7 +65,7 @@
<dependency>
<groupId>org.opengroup.osdu.partition</groupId>
<artifactId>partition-test-core</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
</dependency>
<dependency>
......
......@@ -20,13 +20,13 @@
<parent>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-partition-testing</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.opengroup.osdu.partition</groupId>
<artifactId>partition-test-core</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
......
......@@ -69,17 +69,17 @@ public abstract class UpdatePartitionTest extends BaseTestTemplate {
ClientResponse response = this.descriptor.runWithCustomPayload(this.getId(), getValidBodyForUpdatePartition(), this.testUtils.getAccessToken());
deleteResource();
assertEquals(response.getStatus(), HttpStatus.NO_CONTENT.value());
assertEquals("[GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH]", response.getHeaders().getFirst("Access-Control-Allow-Methods"));
assertEquals("[origin, content-type, accept, authorization, data-partition-id, correlation-id, appkey]", response.getHeaders().getFirst("Access-Control-Allow-Headers"));
assertEquals("[*]", response.getHeaders().getFirst("Access-Control-Allow-Origin"));
assertEquals("[true]", response.getHeaders().getFirst("Access-Control-Allow-Credentials"));
assertEquals("[default-src 'self']", response.getHeaders().getFirst("Content-Security-Policy"));
assertEquals("[max-age=31536000; includeSubDomains]", response.getHeaders().getFirst("Strict-Transport-Security"));
assertEquals("[0]", response.getHeaders().getFirst("Expires"));
assertEquals("GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH", response.getHeaders().getFirst("Access-Control-Allow-Methods"));
assertEquals("origin, content-type, accept, authorization, data-partition-id, correlation-id, appkey", response.getHeaders().getFirst("Access-Control-Allow-Headers"));
assertEquals("*", response.getHeaders().getFirst("Access-Control-Allow-Origin"));
assertEquals("true", response.getHeaders().getFirst("Access-Control-Allow-Credentials"));
assertEquals("default-src 'self'", response.getHeaders().getFirst("Content-Security-Policy"));
assertEquals("max-age=31536000; includeSubDomains", response.getHeaders().getFirst("Strict-Transport-Security"));
assertEquals("0", response.getHeaders().getFirst("Expires"));
assertEquals("DENY", response.getHeaders().getFirst("X-Frame-Options"));
assertEquals("private, max-age=300", response.getHeaders().getFirst("Cache-Control"));
assertEquals("[1; mode=block]", response.getHeaders().getFirst("X-XSS-Protection"));
assertEquals("[nosniff]", response.getHeaders().getFirst("X-Content-Type-Options"));
assertEquals("1; mode=block", response.getHeaders().getFirst("X-XSS-Protection"));
assertEquals("nosniff", response.getHeaders().getFirst("X-Content-Type-Options"));
}
private String getInvalidBodyForUpdatePartition() {
......
......@@ -6,13 +6,13 @@
<parent>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-partition-testing</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.opengroup.osdu.partition</groupId>
<artifactId>partition-test-gcp</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
......@@ -57,7 +57,7 @@
<dependency>
<groupId>org.opengroup.osdu.partition</groupId>
<artifactId>partition-test-core</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
</dependency>
<dependency>
......
......@@ -6,13 +6,13 @@
<parent>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-partition-testing</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.opengroup.osdu.partition</groupId>
<artifactId>partition-test-ibm</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
......@@ -58,7 +58,7 @@
<dependency>
<groupId>org.opengroup.osdu.partition</groupId>
<artifactId>partition-test-core</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
</dependency>
<dependency>
......
......@@ -18,7 +18,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-partition-testing</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.1-SNAPSHOT</version>
<description>Root partition test project</description>
<packaging>pom</packaging>
......
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