From b2f3e2c0b067acede63f69fc50c19b64a7871c75 Mon Sep 17 00:00:00 2001 From: lostlevels Date: Mon, 18 Mar 2024 12:37:40 -0700 Subject: [PATCH 1/9] [BACK-2784] Proxy user profile requests to auth instead of seagull. --- charts/tidepool/charts/seagull/templates/4-routetable.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/tidepool/charts/seagull/templates/4-routetable.yaml b/charts/tidepool/charts/seagull/templates/4-routetable.yaml index bed57dd48..851aab5c4 100644 --- a/charts/tidepool/charts/seagull/templates/4-routetable.yaml +++ b/charts/tidepool/charts/seagull/templates/4-routetable.yaml @@ -25,8 +25,9 @@ spec: routeAction: single: upstream: - name: seagull + name: auth options: + prefixRewrite: /v1/users/ retries: retryOn: '5xx' numRetries: 3 From 4f5e2bd2cc6d1b220c6d27d571857d4b83053984 Mon Sep 17 00:00:00 2001 From: lostlevels Date: Wed, 27 Mar 2024 13:25:52 -0700 Subject: [PATCH 2/9] Only rewrite and send profile requests to auth service. --- .../charts/seagull/templates/4-routetable.yaml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/charts/tidepool/charts/seagull/templates/4-routetable.yaml b/charts/tidepool/charts/seagull/templates/4-routetable.yaml index 851aab5c4..41a15d764 100644 --- a/charts/tidepool/charts/seagull/templates/4-routetable.yaml +++ b/charts/tidepool/charts/seagull/templates/4-routetable.yaml @@ -21,13 +21,27 @@ spec: extauth: disable: true - matchers: - - prefix: /metadata/ + - regex: '/metadata/[^/]+/profile' routeAction: single: upstream: name: auth options: - prefixRewrite: /v1/users/ + regexRewrite: + pattern: + regex: '/metadata/' + substitution: '/v1/users/' + retries: + retryOn: '5xx' + numRetries: 3 + perTryTimeout: '15s' + - matchers: + - prefix: /metadata/ + routeAction: + single: + upstream: + name: seagull + options: retries: retryOn: '5xx' numRetries: 3 From 8583e578253264e6e94effc6fc6aeff38cc30075 Mon Sep 17 00:00:00 2001 From: lostlevels Date: Mon, 1 Apr 2024 08:05:17 -0700 Subject: [PATCH 3/9] Proxy legacy style profiles from segaull to auth. --- charts/tidepool/charts/seagull/templates/4-routetable.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/tidepool/charts/seagull/templates/4-routetable.yaml b/charts/tidepool/charts/seagull/templates/4-routetable.yaml index 41a15d764..939f4403a 100644 --- a/charts/tidepool/charts/seagull/templates/4-routetable.yaml +++ b/charts/tidepool/charts/seagull/templates/4-routetable.yaml @@ -30,7 +30,7 @@ spec: regexRewrite: pattern: regex: '/metadata/' - substitution: '/v1/users/' + substitution: '/v1/users/legacy/' retries: retryOn: '5xx' numRetries: 3 From ce8d6d58ecef1606874a11498d1849f2ebfcf717 Mon Sep 17 00:00:00 2001 From: lostlevels Date: Tue, 24 Jun 2025 14:40:52 -0700 Subject: [PATCH 4/9] Add keycloak config to platform-auth env variables. --- .../charts/auth/templates/1-deployment.yaml | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/charts/tidepool/charts/auth/templates/1-deployment.yaml b/charts/tidepool/charts/auth/templates/1-deployment.yaml index 65c22644e..b40a854ee 100644 --- a/charts/tidepool/charts/auth/templates/1-deployment.yaml +++ b/charts/tidepool/charts/auth/templates/1-deployment.yaml @@ -320,6 +320,66 @@ spec: name: palmtree key: tlsKeyData optional: true + - name: TIDEPOOL_KEYCLOAK_CLIENT_ID + valueFrom: + configMapKeyRef: + name: shoreline + key: KeycloakClientId + optional: true + - name: TIDEPOOL_KEYCLOAK_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: shoreline + key: KeycloakClientSecret + optional: true + - name: TIDEPOOL_KEYCLOAK_LONG_LIVED_CLIENT_ID + valueFrom: + configMapKeyRef: + name: shoreline + key: KeycloakLongLivedClientId + optional: true + - name: TIDEPOOL_KEYCLOAK_LONG_LIVED_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: shoreline + key: KeycloakLongLivedClientSecret + optional: true + - name: TIDEPOOL_KEYCLOAK_BACKEND_CLIENT_ID + valueFrom: + configMapKeyRef: + name: shoreline + key: KeycloakBackendClientId + optional: true + - name: TIDEPOOL_KEYCLOAK_BACKEND_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: shoreline + key: KeycloakBackendClientSecret + optional: true + - name: TIDEPOOL_KEYCLOAK_ADMIN_USERNAME + valueFrom: + configMapKeyRef: + name: shoreline + key: KeycloakAdminUsername + optional: true + - name: TIDEPOOL_KEYCLOAK_ADMIN_PASSWORD + valueFrom: + secretKeyRef: + name: shoreline + key: KeycloakAdminPassword + optional: true + - name: TIDEPOOL_KEYCLOAK_BASE_URL + valueFrom: + configMapKeyRef: + name: shoreline + key: KeycloakBaseUrl + optional: true + - name: TIDEPOOL_KEYCLOAK_REALM + valueFrom: + configMapKeyRef: + name: shoreline + key: KeycloakRealm + optional: true {{- range $key, $val := ((.Values.deployment).extraEnv | default ((.Values.global).deployment).extraEnv | default (dict)) }} - name: {{ $key }} value: {{ $val | quote }} From afd346a70ba55f4fccb071cf65081c77e88281e1 Mon Sep 17 00:00:00 2001 From: lostlevels Date: Tue, 24 Jun 2025 16:06:26 -0700 Subject: [PATCH 5/9] Temporarily disable seagull route rewrite to platform auth. --- .../seagull/templates/4-routetable.yaml | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/charts/tidepool/charts/seagull/templates/4-routetable.yaml b/charts/tidepool/charts/seagull/templates/4-routetable.yaml index 939f4403a..f54df0f12 100644 --- a/charts/tidepool/charts/seagull/templates/4-routetable.yaml +++ b/charts/tidepool/charts/seagull/templates/4-routetable.yaml @@ -20,21 +20,21 @@ spec: options: extauth: disable: true - - matchers: - - regex: '/metadata/[^/]+/profile' - routeAction: - single: - upstream: - name: auth - options: - regexRewrite: - pattern: - regex: '/metadata/' - substitution: '/v1/users/legacy/' - retries: - retryOn: '5xx' - numRetries: 3 - perTryTimeout: '15s' + # - matchers: + # - regex: '/metadata/[^/]+/profile' + # routeAction: + # single: + # upstream: + # name: auth + # options: + # regexRewrite: + # pattern: + # regex: '/metadata/' + # substitution: '/v1/users/legacy/' + # retries: + # retryOn: '5xx' + # numRetries: 3 + # perTryTimeout: '15s' - matchers: - prefix: /metadata/ routeAction: From baf48673f5b1f66648625c1c23804c1c948faa89 Mon Sep 17 00:00:00 2001 From: lostlevels Date: Wed, 25 Jun 2025 19:30:02 -0700 Subject: [PATCH 6/9] Forgot to add seagull credentials for platform-auth while migration in progress. --- .../charts/auth/templates/1-deployment.yaml | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/charts/tidepool/charts/auth/templates/1-deployment.yaml b/charts/tidepool/charts/auth/templates/1-deployment.yaml index b40a854ee..cdf6b4d74 100644 --- a/charts/tidepool/charts/auth/templates/1-deployment.yaml +++ b/charts/tidepool/charts/auth/templates/1-deployment.yaml @@ -380,6 +380,44 @@ spec: name: shoreline key: KeycloakRealm optional: true + - name: SEAGULL_TIDEPOOL_STORE_SCHEME + valueFrom: + secretKeyRef: + name: {{ .Values.mongo.secretName }} + key: Scheme + optional: true + - name: SEAGULL_TIDEPOOL_STORE_USERNAME + valueFrom: + secretKeyRef: + name: {{ .Values.mongo.secretName }} + key: Username + optional: true + - name: SEAGULL_TIDEPOOL_STORE_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Values.mongo.secretName }} + key: Password + optional: true + - name: SEAGULL_TIDEPOOL_STORE_ADDRESSES + valueFrom: + secretKeyRef: + name: {{ .Values.mongo.secretName }} + key: Addresses + optional: true + - name: SEAGULL_TIDEPOOL_STORE_TLS + valueFrom: + secretKeyRef: + name: {{ .Values.mongo.secretName }} + key: Tls + optional: true + - name: SEAGULL_TIDEPOOL_STORE_OPT_PARAMS + valueFrom: + secretKeyRef: + name: {{ .Values.mongo.secretName }} + key: OptParams + optional: true + - name: SEAGULL_TIDEPOOL_STORE_DATABASE + value: seagull {{- range $key, $val := ((.Values.deployment).extraEnv | default ((.Values.global).deployment).extraEnv | default (dict)) }} - name: {{ $key }} value: {{ $val | quote }} From 32bdf51ac308e79c05137bf80c7353752fa24dcc Mon Sep 17 00:00:00 2001 From: lostlevels Date: Thu, 26 Jun 2025 13:45:16 -0700 Subject: [PATCH 7/9] Add matcher to route table for user v1 profiles. --- charts/tidepool/Chart.yaml | 2 +- .../charts/auth/templates/4-routetable.yaml | 12 ++++- .../seagull/templates/4-routetable.yaml | 45 ++++++++++++------- 3 files changed, 42 insertions(+), 17 deletions(-) diff --git a/charts/tidepool/Chart.yaml b/charts/tidepool/Chart.yaml index c87533ece..22d859cd8 100644 --- a/charts/tidepool/Chart.yaml +++ b/charts/tidepool/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: A Helm chart for Tidepool name: tidepool -version: 0.24.5 +version: 0.25.0 maintainers: - name: Todd Kazakov email: todd@tidepool.org diff --git a/charts/tidepool/charts/auth/templates/4-routetable.yaml b/charts/tidepool/charts/auth/templates/4-routetable.yaml index 0541d0488..cae95ea60 100644 --- a/charts/tidepool/charts/auth/templates/4-routetable.yaml +++ b/charts/tidepool/charts/auth/templates/4-routetable.yaml @@ -179,5 +179,15 @@ spec: single: upstream: name: auth - + - matchers: + - methods: + - GET + - POST + - PUT + - DELETE + regex: /v1/users/(legacy/)?[^/]+/profile + routeAction: + single: + upstream: + name: auth {{- end }} diff --git a/charts/tidepool/charts/seagull/templates/4-routetable.yaml b/charts/tidepool/charts/seagull/templates/4-routetable.yaml index f54df0f12..9c6647868 100644 --- a/charts/tidepool/charts/seagull/templates/4-routetable.yaml +++ b/charts/tidepool/charts/seagull/templates/4-routetable.yaml @@ -20,22 +20,37 @@ spec: options: extauth: disable: true - # - matchers: - # - regex: '/metadata/[^/]+/profile' - # routeAction: - # single: - # upstream: - # name: auth - # options: - # regexRewrite: - # pattern: - # regex: '/metadata/' - # substitution: '/v1/users/legacy/' - # retries: - # retryOn: '5xx' - # numRetries: 3 - # perTryTimeout: '15s' - matchers: + - regex: '/metadata/[^/]+/profile' + routeAction: + single: + upstream: + name: auth + options: + regexRewrite: + pattern: + regex: '/metadata/' + substitution: '/v1/users/legacy/' + retries: + retryOn: '5xx' + numRetries: 3 + perTryTimeout: '15s' + - matchers: + - regex: '/metadata/users/[^/]+/users' + routeAction: + single: + upstream: + name: auth + options: + regexRewrite: + pattern: + regex: '/metadata/users/' + substitution: '/v1/users/' + retries: + retryOn: '5xx' + numRetries: 3 + perTryTimeout: '15s' + matchers: - prefix: /metadata/ routeAction: single: From 190c25438838c0f8603a85b48456c1b1f6054a48 Mon Sep 17 00:00:00 2001 From: lostlevels Date: Wed, 29 Apr 2026 12:34:25 -0700 Subject: [PATCH 8/9] Fix syntax. --- charts/tidepool/charts/seagull/templates/4-routetable.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/tidepool/charts/seagull/templates/4-routetable.yaml b/charts/tidepool/charts/seagull/templates/4-routetable.yaml index 9c6647868..950c9cc8d 100644 --- a/charts/tidepool/charts/seagull/templates/4-routetable.yaml +++ b/charts/tidepool/charts/seagull/templates/4-routetable.yaml @@ -50,7 +50,7 @@ spec: retryOn: '5xx' numRetries: 3 perTryTimeout: '15s' - matchers: + - matchers: - prefix: /metadata/ routeAction: single: From e7f5e1b9b7ea8903b09148f5f738fd73027f0c72 Mon Sep 17 00:00:00 2001 From: lostlevels Date: Wed, 29 Apr 2026 12:34:38 -0700 Subject: [PATCH 9/9] Point svc that directly talk to seagull to auth. Svc. --- .../tidepool/charts/clinic-worker/templates/1-deployment.yaml | 2 +- charts/tidepool/charts/clinic/templates/1-deployment.yaml | 2 +- charts/tidepool/charts/hydrophone/templates/1-deployment.yaml | 2 +- charts/tidepool/charts/jellyfish/templates/1-deployment.yaml | 2 +- charts/tidepool/charts/shoreline/templates/1-deployment.yaml | 2 +- .../tidepool/charts/tidewhisperer/templates/1-deployment.yaml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/tidepool/charts/clinic-worker/templates/1-deployment.yaml b/charts/tidepool/charts/clinic-worker/templates/1-deployment.yaml index 14f5e7b77..1ea97d51c 100644 --- a/charts/tidepool/charts/clinic-worker/templates/1-deployment.yaml +++ b/charts/tidepool/charts/clinic-worker/templates/1-deployment.yaml @@ -52,7 +52,7 @@ spec: - name: TIDEPOOL_AUTH_CLIENT_ADDRESS value: "http://shoreline:{{.Values.global.ports.shoreline}}" - name: TIDEPOOL_SEAGULL_CLIENT_ADDRESS - value: "http://seagull:{{.Values.global.ports.seagull}}" + value: "http://auth:{{.Values.global.ports.auth}}/metadata" - name: TIDEPOOL_GATEKEEPER_CLIENT_ADDRESS value: "http://gatekeeper:{{.Values.global.ports.gatekeeper}}" - name: TIDEPOOL_CLINIC_CLIENT_ADDRESS diff --git a/charts/tidepool/charts/clinic/templates/1-deployment.yaml b/charts/tidepool/charts/clinic/templates/1-deployment.yaml index 8eae6eede..9e26b17a7 100644 --- a/charts/tidepool/charts/clinic/templates/1-deployment.yaml +++ b/charts/tidepool/charts/clinic/templates/1-deployment.yaml @@ -66,7 +66,7 @@ spec: - name: TIDEPOOL_SHORELINE_CLIENT_ADDRESS value: "http://shoreline:{{.Values.global.ports.shoreline}}" - name: TIDEPOOL_SEAGULL_CLIENT_ADDRESS - value: "http://seagull:{{.Values.global.ports.seagull}}" + value: "http://auth:{{.Values.global.ports.auth}}/metadata" - name: TIDEPOOL_GATEKEEPER_CLIENT_ADDRESS value: "http://gatekeeper:{{.Values.global.ports.gatekeeper}}" - name: TIDEPOOL_REDOX_VERIFICATION_TOKEN diff --git a/charts/tidepool/charts/hydrophone/templates/1-deployment.yaml b/charts/tidepool/charts/hydrophone/templates/1-deployment.yaml index d40eae318..239cd9744 100644 --- a/charts/tidepool/charts/hydrophone/templates/1-deployment.yaml +++ b/charts/tidepool/charts/hydrophone/templates/1-deployment.yaml @@ -78,7 +78,7 @@ spec: - name: TIDEPOOL_DATA_CLIENT_ADDRESS value: "http://data:{{.Values.global.ports.data}}" - name: TIDEPOOL_SEAGULL_CLIENT_ADDRESS - value: "http://seagull:{{.Values.global.ports.seagull}}" + value: "http://auth:{{.Values.global.ports.auth}}/metadata" - name: TIDEPOOL_PERMISSION_CLIENT_ADDRESS value: "http://gatekeeper:{{.Values.global.ports.gatekeeper}}" - name: TIDEPOOL_METRICS_CLIENT_ADDRESS diff --git a/charts/tidepool/charts/jellyfish/templates/1-deployment.yaml b/charts/tidepool/charts/jellyfish/templates/1-deployment.yaml index 11152e308..df15cd10a 100644 --- a/charts/tidepool/charts/jellyfish/templates/1-deployment.yaml +++ b/charts/tidepool/charts/jellyfish/templates/1-deployment.yaml @@ -76,7 +76,7 @@ spec: - name: TIDEPOOL_AUTH_CLIENT_ADDRESS value: "shoreline:{{.Values.global.ports.shoreline}}" - name: TIDEPOOL_SEAGULL_CLIENT_ADDRESS - value: "seagull:{{.Values.global.ports.seagull}}" + value: "auth:{{.Values.global.ports.auth}}/metadata" - name: TIDEPOOL_PERMISSION_CLIENT_ADDRESS value: "gatekeeper:{{.Values.global.ports.gatekeeper}}" image: "{{ .Values.deployment.image }}" diff --git a/charts/tidepool/charts/shoreline/templates/1-deployment.yaml b/charts/tidepool/charts/shoreline/templates/1-deployment.yaml index d3f97fea6..ea6d6f1f3 100644 --- a/charts/tidepool/charts/shoreline/templates/1-deployment.yaml +++ b/charts/tidepool/charts/shoreline/templates/1-deployment.yaml @@ -144,7 +144,7 @@ spec: - name: TIDEPOOL_AUTH_CLIENT_ADDRESS value: "http://shoreline:{{.Values.global.ports.shoreline}}" - name: TIDEPOOL_SEAGULL_CLIENT_ADDRESS - value: "http://seagull:{{.Values.global.ports.seagull}}" + value: "http://auth:{{.Values.global.ports.auth}}/metadata" - name: TIDEPOOL_PERMISSION_CLIENT_ADDRESS value: "http://gatekeeper:{{.Values.global.ports.gatekeeper}}" - name: TIDEPOOL_METRICS_CLIENT_ADDRESS diff --git a/charts/tidepool/charts/tidewhisperer/templates/1-deployment.yaml b/charts/tidepool/charts/tidewhisperer/templates/1-deployment.yaml index f2a47389c..96b0214b6 100644 --- a/charts/tidepool/charts/tidewhisperer/templates/1-deployment.yaml +++ b/charts/tidepool/charts/tidewhisperer/templates/1-deployment.yaml @@ -78,7 +78,7 @@ spec: "host": "hakken", "skipHakken": true }, - "seagull": {"serviceSpec": {"type": "static", "hosts": ["http://seagull:{{.Values.global.ports.seagull}}"]}}, + "seagull": {"serviceSpec": {"type": "static", "hosts": ["http://auth:{{.Values.global.ports.auth}}/metadata"]}}, "shoreline": { "name": "tide-whisperer", "serviceSpec": {"type": "static", "hosts": ["http://shoreline:{{.Values.global.ports.shoreline}}"]},