From 7847c1a866e13fed2a69ff23b774f95f93c43072 Mon Sep 17 00:00:00 2001
From: "Mikhail Piatliou (EPAM)" <mikhail_piatliou@epam.com>
Date: Wed, 15 Jun 2022 12:37:52 +0000
Subject: [PATCH] Update bootstrap script, default spring property [GONRG-5157]

---
 NOTICE                                        |  2 +
 .../templates/configmap-bootstrap.yml         |  2 +-
 devops/gcp/deploy/templates/deploy.yml        |  3 --
 .../templates/request-authentication.yml      | 42 +++++++++----------
 .../bootstrap/bootstrap_partition.sh          |  2 +-
 .../src/main/resources/application.properties |  8 ++--
 6 files changed, 28 insertions(+), 31 deletions(-)

diff --git a/NOTICE b/NOTICE
index 1e12b6559..f731b6a8a 100644
--- a/NOTICE
+++ b/NOTICE
@@ -369,6 +369,7 @@ The following software have components provided under the terms of this license:
 - Cloud Key Management Service (KMS) API v1-rev20220407-1.32.1 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-cloudkms)
 - Cloud Storage JSON API (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-storage)
 - Cloud Storage JSON API v1-rev20220604-1.32.1 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-storage)
+- Cloud Storage JSON API v1-rev20220608-1.32.1 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-storage)
 - CloudWatch Metrics for AWS Java SDK (from https://aws.amazon.com/sdkforjava)
 - Cobertura (from http://cobertura.sourceforge.net)
 - Collections (from https://repo1.maven.org/maven2/commons-collections/commons-collections)
@@ -404,6 +405,7 @@ The following software have components provided under the terms of this license:
 - Google OAuth Client Library for Java (from https://repo1.maven.org/maven2/com/google/oauth-client/google-oauth-client)
 - Gson (from http://code.google.com/p/google-gson/, https://repo1.maven.org/maven2/com/google/code/gson/gson)
 - Guava InternalFutureFailureAccess and InternalFutures (from https://repo1.maven.org/maven2/com/google/guava/failureaccess)
+- Guava ListenableFuture only (from https://repo1.maven.org/maven2/com/google/guava/listenablefuture)
 - Guava: Google Core Libraries for Java (from http://code.google.com/p/guava-libraries, https://github.com/google/guava, https://repo1.maven.org/maven2/com/google/guava/guava)
 - HTTP functionality for the Reactor Netty library (from https://github.com/reactor/reactor-netty)
 - Hibernate Validator (from https://repo1.maven.org/maven2/org/hibernate/hibernate-validator, https://repo1.maven.org/maven2/org/hibernate/validator/hibernate-validator)
diff --git a/devops/gcp/configmap/templates/configmap-bootstrap.yml b/devops/gcp/configmap/templates/configmap-bootstrap.yml
index dacb725d7..e7225a6e6 100644
--- a/devops/gcp/configmap/templates/configmap-bootstrap.yml
+++ b/devops/gcp/configmap/templates/configmap-bootstrap.yml
@@ -6,7 +6,7 @@ metadata:
   name: "{{ .Values.conf.configmap }}-bootstrap"
   namespace: "{{ .Release.Namespace }}"
 data:
-  PARTITION_NAME: "{{ .Values.data.partitionName }}.{{ .Release.Namespace }}.svc.cluster.local"
+  PARTITION_NAME: "{{ .Values.data.partitionName }}"
   SERVICE_ACCOUNT: {{ printf "%s@%s.iam.gserviceaccount.com" .Values.data.datafierSa .Values.data.projectId | quote }}
   DATA_PARTITION_ID: "{{ .Values.data.dataPartitionId }}"
   ENVIRONMENT: "{{ .Values.data.springProfilesActive }}"
diff --git a/devops/gcp/deploy/templates/deploy.yml b/devops/gcp/deploy/templates/deploy.yml
index 371400442..f71368127 100644
--- a/devops/gcp/deploy/templates/deploy.yml
+++ b/devops/gcp/deploy/templates/deploy.yml
@@ -19,9 +19,6 @@ spec:
         - image: "{{ .Values.data.image }}"
           imagePullPolicy: "{{ .Values.data.imagePullPolicy }}"
           name: "{{ .Values.conf.appName }}"
-          env:
-            - name: "ACCEPT_HTTP"
-              value: "true"
           envFrom:
           - configMapRef:
               name: "{{ .Values.conf.configmap }}"
diff --git a/devops/gcp/deploy/templates/request-authentication.yml b/devops/gcp/deploy/templates/request-authentication.yml
index 2aa6d550f..65cdee849 100644
--- a/devops/gcp/deploy/templates/request-authentication.yml
+++ b/devops/gcp/deploy/templates/request-authentication.yml
@@ -1,21 +1,21 @@
-{{- if .Values.conf.onPremEnabled }}
-apiVersion: security.istio.io/v1beta1
-kind: RequestAuthentication
-metadata:
-  name: "{{ .Values.conf.appName }}-jwt-policy"
-  namespace: "{{ .Release.Namespace }}"
-spec:
-  selector:
-    matchLabels:
-      app: "{{ .Values.conf.appName }}"
-  jwtRules:
-  - issuer: "https://keycloak.{{ .Values.conf.domain }}/auth/realms/{{ .Values.auth.realm }}"
-    jwksUri: "http://keycloak.{{ .Release.Namespace }}.svc.cluster.local/auth/realms/{{ .Values.auth.realm }}/protocol/openid-connect/certs"
-    forwardOriginalToken: true
-  - issuer: "http://keycloak.{{ .Values.conf.domain }}/auth/realms/{{ .Values.auth.realm }}"
-    jwksUri: "http://keycloak.{{ .Release.Namespace }}.svc.cluster.local/auth/realms/{{ .Values.auth.realm }}/protocol/openid-connect/certs"
-    forwardOriginalToken: true
-  - issuer: "http://keycloak.{{ .Release.Namespace }}.svc.cluster.local/auth/realms/{{ .Values.auth.realm }}"
-    jwksUri: "http://keycloak.{{ .Release.Namespace }}.svc.cluster.local/auth/realms/{{ .Values.auth.realm }}/protocol/openid-connect/certs"
-    forwardOriginalToken: true
-{{- end }}
+{{- if .Values.conf.onPremEnabled }}
+apiVersion: security.istio.io/v1beta1
+kind: RequestAuthentication
+metadata:
+  name: "{{ .Values.conf.appName }}-jwt-policy"
+  namespace: "{{ .Release.Namespace }}"
+spec:
+  selector:
+    matchLabels:
+      app: "{{ .Values.conf.appName }}"
+  jwtRules:
+  - issuer: "https://keycloak.{{ .Values.conf.domain }}/auth/realms/{{ .Values.auth.realm }}"
+    jwksUri: "http://keycloak.{{ .Release.Namespace }}.svc.cluster.local/auth/realms/{{ .Values.auth.realm }}/protocol/openid-connect/certs"
+    forwardOriginalToken: true
+  - issuer: "http://keycloak.{{ .Values.conf.domain }}/auth/realms/{{ .Values.auth.realm }}"
+    jwksUri: "http://keycloak.{{ .Release.Namespace }}.svc.cluster.local/auth/realms/{{ .Values.auth.realm }}/protocol/openid-connect/certs"
+    forwardOriginalToken: true
+  - issuer: "http://keycloak.{{ .Release.Namespace }}.svc.cluster.local/auth/realms/{{ .Values.auth.realm }}"
+    jwksUri: "http://keycloak.{{ .Release.Namespace }}.svc.cluster.local/auth/realms/{{ .Values.auth.realm }}/protocol/openid-connect/certs"
+    forwardOriginalToken: true
+{{- end }}
diff --git a/provider/partition-gcp/bootstrap/bootstrap_partition.sh b/provider/partition-gcp/bootstrap/bootstrap_partition.sh
index a20ff5954..f4de1eebb 100644
--- a/provider/partition-gcp/bootstrap/bootstrap_partition.sh
+++ b/provider/partition-gcp/bootstrap/bootstrap_partition.sh
@@ -34,7 +34,7 @@ generate_post_data() {
     },
     "bucket": {
       "sensitive": false,
-      "value": "${PROJECT_ID}-records"
+      "value": "${PROJECT_ID}-${DATA_PARTITION_ID}-records"
     },
     "crmAccountID": {
       "sensitive": false,
diff --git a/provider/partition-gcp/src/main/resources/application.properties b/provider/partition-gcp/src/main/resources/application.properties
index bff52e44e..548f12fb6 100644
--- a/provider/partition-gcp/src/main/resources/application.properties
+++ b/provider/partition-gcp/src/main/resources/application.properties
@@ -1,6 +1,6 @@
 #
-# Copyright 2020-2021 Google LLC
-# Copyright 2020-2021 EPAM Systems, Inc
+# Copyright 2020-2022 Google LLC
+# Copyright 2020-2022 EPAM Systems, Inc
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@ server.port=8080
 springfox.documentation.swagger.v2.path=/api-docs
 management.endpoint.health.show-details=always
 management.health.diskspace.enabled=false
+ACCEPT_HTTP=true
 
 #logging configuration
 logging.level.org.springframework.web=${LOG_LEVEL:DEBUG}
@@ -33,6 +34,3 @@ cache-maxSize=1000
 #service config
 partition-property-kind=PartitionProperty
 partition-namespace=partition
-
-
-
-- 
GitLab