Skip to content

Commit 3cf379f

Browse files
xaijfaltermeier
andauthored
Refactor APPID to SERVICE_AUTH_TOKEN (#95)
- Deprecate app.id parameter in favor of service.authToken - Update operator to use --serviceAuthToken flag instead of --appId - Add SERVICE_AUTH_TOKEN to service configuration - Update landing page config to use serviceAuthToken property - Maintain backward compatibility by defaulting to app.id value Co-authored-by: Johannes Faltermeier <[email protected]>
1 parent c808244 commit 3cf379f

File tree

6 files changed

+15
-8
lines changed

6 files changed

+15
-8
lines changed

charts/theia-cloud/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 1.2.0-next.1
18+
version: 1.2.0-next.2
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/theia-cloud/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# theia-cloud
22

3-
![Version: 1.2.0-next.1](https://img.shields.io/badge/Version-1.2.0--next.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.2.0-next](https://img.shields.io/badge/AppVersion-1.2.0--next-informational?style=flat-square)
3+
![Version: 1.2.0-next.2](https://img.shields.io/badge/Version-1.2.0--next.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.2.0-next](https://img.shields.io/badge/AppVersion-1.2.0--next-informational?style=flat-square)
44

55
A Helm chart for Theia Cloud
66

@@ -12,7 +12,7 @@ A Helm chart for Theia Cloud
1212
| Key | Type | Default | Description |
1313
|-----|------|---------|-------------|
1414
| app | object | (see details below) | General information about the deployed app |
15-
| app.id | string | `"asdfghjkl"` | The app id which is used in the communication between website and REST-API as a spam migitation. This id is public. Please choose an random generated string. |
15+
| app.id | Deprecated | `"asdfghjkl"` | The app id which is used in the communication between website and REST-API as a spam migitation. This id is public. Please choose an random generated string. Use service.authToken instead. |
1616
| app.name | string | `"Theia Blueprint"` | The name of the application that may be displayed e.g. on the landing pages |
1717
| demoApplication | object | (see details below) | Information about the demo application to be installed |
1818
| demoApplication.imagePullPolicy | string | `nil` | Optional: Override the imagePullPolicy for the main application's docker image. If this is omitted or empty, the root at .Values.imagePullPolicy is used. |
@@ -99,6 +99,7 @@ A Helm chart for Theia Cloud
9999
| preloading.imagePullPolicy | string | `nil` | Optional: Override the imagePullPolicy for the image preloading containers. If this is omitted or empty, the root at .Values.imagePullPolicy is used. |
100100
| preloading.images | list | `[]` | Images to preload. Images must support running /bin/sh. If the list is empty and demoApplication.install == true, demoApplication.name is automatically added. |
101101
| service | object | (see details below) | Values of the Theia Cloud REST service |
102+
| service.authToken | string | `"asdfghjkl"` | The service authentication token used in the communication between website and REST-API for spam mitigation. This token is public. Please choose a random generated string. |
102103
| service.image | string | `"theiacloud/theia-cloud-service:1.2.0-next"` | The image to use |
103104
| service.imagePullPolicy | string | `nil` | Optional: Override the imagePullPolicy for the service's docker image. If this is omitted or empty, the root at .Values.imagePullPolicy is used. |
104105
| service.imagePullSecret | string | `nil` | Optional: the image pull secret |

charts/theia-cloud/templates/landing-page-config-map.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
data:
99
config.js: |
1010
window.theiaCloudConfig = {
11-
appId: "{{ tpl (.Values.app.id | toString) . }}",
11+
serviceAuthToken: "{{ tpl ((.Values.service.authToken | default .Values.app.id) | toString) . }}",
1212
appName: "{{ tpl (.Values.app.name | toString) . }}",
1313
useEphemeralStorage: {{ tpl (.Values.landingPage.ephemeralStorage | toString) . }},
1414
useKeycloak: {{ tpl (.Values.keycloak.enable | toString) . }},
@@ -24,7 +24,7 @@ data:
2424
additionalApps: [
2525
{{- range $key, $val := .Values.landingPage.additionalApps }}
2626
{
27-
appId: {{ $key | quote}},
27+
serviceAuthToken: {{ $key | quote}},
2828
appName: {{ $val.label | quote }},
2929
},
3030
{{- end }}

charts/theia-cloud/templates/operator.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ spec:
5151
{{- end }}
5252
- "--sessionsPerUser"
5353
- "{{ tpl (.Values.operator.sessionsPerUser | toString) . }}"
54-
- "--appId"
55-
- {{ tpl (.Values.app.id | toString) . }}
54+
- "--serviceAuthToken"
55+
- {{ tpl ((.Values.service.authToken | default .Values.app.id) | toString) . }}
5656
{{- if .Values.hosts.usePaths }}
5757
- "--instancesHost"
5858
- "{{ tpl (.Values.hosts.configuration.baseHost | toString) . }}"

charts/theia-cloud/templates/service-configmap.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ metadata:
44
name: service-config
55
namespace: {{ .Release.Namespace }}
66
data:
7+
SERVICE_AUTH_TOKEN: {{ tpl ((.Values.service.authToken | default .Values.app.id) | toString) . }}
78
APPID: {{ tpl (.Values.app.id | toString) . }}
89
SERVICE_PORT: {{ tpl (.Values.service.port | toString) . | quote }}
910
KEYCLOAK_ENABLE: {{ tpl (.Values.keycloak.enable | toString) . | quote }}

charts/theia-cloud/values.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ imagePullPolicy: Always
99
# -- General information about the deployed app
1010
# @default -- (see details below)
1111
app:
12-
# -- The app id which is used in the communication between website and REST-API
12+
# -- (Deprecated) The app id which is used in the communication between website and REST-API
1313
# as a spam migitation. This id is public. Please choose an random generated string.
14+
# Use service.authToken instead.
1415
id: asdfghjkl
1516

1617
# -- The name of the application that may be displayed e.g. on the landing pages
@@ -294,6 +295,10 @@ operator:
294295
# -- Values of the Theia Cloud REST service
295296
# @default -- (see details below)
296297
service:
298+
# -- The service authentication token used in the communication between website and REST-API
299+
# for spam mitigation. This token is public. Please choose a random generated string.
300+
authToken: asdfghjkl
301+
297302
# -- The image to use
298303
image: theiacloud/theia-cloud-service:1.2.0-next
299304

0 commit comments

Comments
 (0)