From 2dcfd5a02c0ba75cb777c9a912ef1e7b565760d2 Mon Sep 17 00:00:00 2001
From: Manish Jangid <msjangid@amazon.com>
Date: Thu, 16 Feb 2023 14:07:47 +0000
Subject: [PATCH] Merge branch 'aws-integration-merge' into 'master'

Removed test validations on cors response headers

See merge request osdu/platform/system/notification!349

(cherry picked from commit 0ad4138e141d0beb0ace938321594172903829da)

a1650427 Removed test validations on cors response headers
d54e9b0f Updating NOTICE
---
 NOTICE                                        |  4 ++--
 .../api/TestPubsubEndpointHMAC.java           | 23 +++++++++++++++++++
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/NOTICE b/NOTICE
index c5ee26295..d1f2b691b 100644
--- a/NOTICE
+++ b/NOTICE
@@ -92,8 +92,8 @@ The following software have components provided under the terms of this license:
 - Google APIs Client Library for Java (from https://repo1.maven.org/maven2/com/google/api-client/google-api-client)
 - Google App Engine extensions to the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-appengine)
 - Google Cloud Core (from https://github.com/googleapis/google-cloud-java, https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core, https://github.com/googleapis/java-core)
-- Google Cloud Core HTTP (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-core-http, https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core-http, https://github.com/googleapis/java-core)
-- Google Cloud Core gRPC (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core-grpc, https://github.com/googleapis/java-core)
+- Google Cloud Core HTTP (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-core-http, https://github.com/googleapis/google-cloud-java, https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core-http, https://github.com/googleapis/java-core)
+- Google Cloud Core gRPC (from https://github.com/googleapis/google-cloud-java, https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core-grpc, https://github.com/googleapis/java-core)
 - Google Cloud Datastore (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-datastore, https://github.com/googleapis/java-datastore)
 - Google Cloud IAM Service Account Credentials (from https://github.com/googleapis/google-cloud-java, https://github.com/googleapis/java-iamcredentials)
 - Google Cloud Logging (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-logging, https://github.com/googleapis/java-logging)
diff --git a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/api/TestPubsubEndpointHMAC.java b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/api/TestPubsubEndpointHMAC.java
index ebc825e80..eefe15dbb 100644
--- a/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/api/TestPubsubEndpointHMAC.java
+++ b/testing/notification-test-aws/src/test/java/org/opengroup/osdu/notification/api/TestPubsubEndpointHMAC.java
@@ -14,6 +14,7 @@
 package org.opengroup.osdu.notification.api;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 import org.junit.After;
 import org.junit.AfterClass;
@@ -132,4 +133,26 @@ public class TestPubsubEndpointHMAC extends PubsubEndpointHMACTests {
         awssubscriptionService.delete(subscriptionId);
     }
 
+    @Override
+    @Test
+    public void should_return20X_when_usingCredentialsWithOpsPermission() throws Exception{
+        createResource();
+
+        try {
+            ClientResponse response = descriptor.run(getArg(), testUtils.getOpsToken());
+
+            assertEquals(error(response.getStatus() == 204 ? "" : response.getEntity(String.class)), expectedOkResponseCode(), response.getStatus());
+            assertEquals("DENY", response.getHeaders().getFirst("X-Frame-Options"));
+            assertEquals("1; mode=block", response.getHeaders().getFirst("X-XSS-Protection"));
+            assertEquals("nosniff", response.getHeaders().getFirst("X-Content-Type-Options"));
+            assertEquals("no-cache, no-store, must-revalidate", response.getHeaders().getFirst("Cache-Control"));
+            assertEquals("default-src 'self'", response.getHeaders().getFirst("Content-Security-Policy"));
+            assertTrue(response.getHeaders().get("Strict-Transport-Security").get(0).contains("max-age=31536000"));
+            assertTrue(response.getHeaders().get("Strict-Transport-Security").get(0).contains("includeSubDomains"));
+            assertEquals("0", response.getHeaders().getFirst("Expires"));
+        } finally {
+            deleteResource();
+        }
+    }
+
 }
\ No newline at end of file
-- 
GitLab