Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.
Python agent-orchestrationaiai-agentschatopsdiscordlangchainmcpmicrosoft-teamsmulti-agentopen-sourceopenaiself-hostedslack
feat(chart): organization directory settings for switch-core
Petr Bauchc2b0804ef853
diff --git a/deploy/remote/helm/switch/templates/_helpers.tpl b/deploy/remote/helm/switch/templates/_helpers.tplindex 6e5dcd80e..47d139a52 100644--- a/deploy/remote/helm/switch/templates/_helpers.tpl+++ b/deploy/remote/helm/switch/templates/_helpers.tpl@@ -78,6 +78,9 @@ MATTERMOST_USER_PASSWORD: {{ .Values.secrets.mattermostUserPassword | default .V{{- if .Values.switchCore.oidc.enabled }}GATEWAY_OIDC_CLIENT_SECRET: {{ required "secrets.gatewayOidcClientSecret is required when switchCore.oidc.enabled" .Values.secrets.gatewayOidcClientSecret | b64enc | quote }}{{- end }}+{{- if eq .Values.switchCore.organizationDirectory.mode "workos" }}+WORKOS_API_KEY: {{ required "secrets.workosApiKey is required when switchCore.organizationDirectory.mode is workos" .Values.secrets.workosApiKey | b64enc | quote }}+{{- end }}{{- if and .Values.switchCore.smtp.enabled (or .Values.switchCore.smtp.username .Values.switchCore.smtp.usernameFromSecret) }}GATEWAY_SMTP_PASSWORD: {{ required "secrets.gatewaySmtpPassword is required when an SMTP username is set" .Values.secrets.gatewaySmtpPassword | b64enc | quote }}{{- end }}@@ -888,6 +891,7 @@ this one. Drop it once the oldest supported image reads ID_SERVER_NAME. */}}value: {{ $signupMode | quote }}- name: GATEWAY_MAX_WORKSPACES_PER_USERvalue: {{ .Values.switchCore.signup.maxWorkspacesPerUser | quote }}+{{- include "switch.organizationDirectoryEnv" . }}- name: GATEWAY_TENANT_CHOICE_ENABLEDvalue: {{ .Values.switchCore.tenantChoiceEnabled | quote }}{{- $outboundHosts := .Values.switchCore.outbound.allowedPrivateHosts }}@@ -1293,3 +1297,44 @@ HF_TOKEN env entry from decision.modelServer.hfTokenSecret, or nothing.key: {{ $.Values.decision.modelServer.hfTokenSecret.key }}{{- end }}{{- end }}++{{/*+switch-core's organization directory settings. The checks mirror the ones+switch-core makes at startup (config.py), so a bad combination fails the+render instead of a pod.+*/}}+{{- define "switch.organizationDirectoryEnv" -}}+{{- $directory := .Values.switchCore.organizationDirectory }}+{{- $changes := list $directory.membersServiceUrl $directory.workosClientId $directory.workosRedirectUrl | compact }}+{{- if not (has $directory.mode (list "local" "workos")) }}+{{- fail (printf "switchCore.organizationDirectory.mode must be local or workos. Got %q." $directory.mode) }}+{{- end }}+{{- if eq $directory.mode "workos" }}+{{- if not .Values.switchCore.oidc.enabled }}+{{- fail "switchCore.organizationDirectory.mode workos needs switchCore.oidc.enabled, against the same WorkOS environment: the sign-in is what names the person there." }}+{{- end }}+{{- if ne .Values.switchCore.signup.mode "invite_only" }}+{{- fail "switchCore.organizationDirectory.mode workos needs switchCore.signup.mode invite_only: a customer's organization is linked by an operator, not created by whoever signs up." }}+{{- end }}+{{- if and $changes (lt (len $changes) 3) }}+{{- fail "switchCore.organizationDirectory.membersServiceUrl, workosClientId and workosRedirectUrl are set together, or not at all." }}+{{- end }}+- name: ORGANIZATION_DIRECTORY+ value: "workos"+- name: WORKOS_API_KEY+ valueFrom:+ secretKeyRef:+ name: {{ include "switch.secretName" . }}+ key: WORKOS_API_KEY+{{- if $changes }}+- name: MEMBERS_SERVICE_URL+ value: {{ $directory.membersServiceUrl | quote }}+- name: WORKOS_CLIENT_ID+ value: {{ $directory.workosClientId | quote }}+- name: WORKOS_REDIRECT_URL+ value: {{ $directory.workosRedirectUrl | quote }}+{{- end }}+{{- else if $changes }}+{{- fail "switchCore.organizationDirectory.membersServiceUrl, workosClientId and workosRedirectUrl are for mode workos." }}+{{- end }}+{{- end }}diff --git a/deploy/remote/helm/switch/values.yaml b/deploy/remote/helm/switch/values.yamlindex 359589b05..d220d08b3 100644--- a/deploy/remote/helm/switch/values.yaml+++ b/deploy/remote/helm/switch/values.yaml@@ -104,7 +104,8 @@ ingress:# JWT_SECRET_KEY (optional, legacy — see secrets.jwtSecretKey),# CONTROLLER_TOKEN_SECRET (with the agent_management feature flag on),# MATTERMOST_ADMIN_PASSWORD + MATTERMOST_USER_PASSWORD (if mattermost.enabled),-# GATEWAY_OIDC_CLIENT_SECRET (if switchCore.oidc.enabled).+# GATEWAY_OIDC_CLIENT_SECRET (if switchCore.oidc.enabled),+# WORKOS_API_KEY (if switchCore.organizationDirectory.mode is workos).secrets:# Name of a pre-existing Secret to read all of the above from. Empty = the# chart manages its own Secret from the values below.@@ -144,6 +145,11 @@ secrets:controllerTokenSecret: ""# Gateway OIDC client secret (required when switchCore.oidc.enabled).gatewayOidcClientSecret: ""+ # WorkOS API key (required when switchCore.organizationDirectory.mode is+ # workos). With member changes on, it must belong to the AuthKit application+ # in organizationDirectory.workosClientId: WorkOS exchanges that+ # application's sign-ins only with its own key.+ workosApiKey: ""# SMTP relay password for invitation e-mails (required when# switchCore.smtp.enabled and a username is set, either way below).gatewaySmtpPassword: ""@@ -398,6 +404,23 @@ switchCore:# turns self-service creation off. Applies in every mode but invite_only,# which allows none.maxWorkspacesPerUser: 3+ # Who keeps the record of organizations and their members+ # (docs/old/workos-directory.md).+ # local — this server, in its own tables+ # workos — the WorkOS environment behind the OIDC sign-in, read with+ # secrets.workosApiKey. Needs oidc.enabled against that+ # environment and signup.mode invite_only.+ organizationDirectory:+ mode: local+ # Member changes made from Switch to a linked organization, sent to the+ # service the WorkOS environment's members are changed through, with the+ # admin's own WorkOS token. All three or none; workos mode only.+ membersServiceUrl: ""+ # The AuthKit application admins sign in to for that token.+ workosClientId: ""+ # Its callback, <gatewayPublicUrl>/gateway/auth/workos/callback, registered+ # on that application.+ workosRedirectUrl: ""# Answer a person with several workspaces and none selected with a 409 that# lists them, rather than a 403. The gateway UI does not need it; turn it on# once every API client authenticating against this deployment handles it.diff --git a/docs/old/workos-directory.md b/docs/old/workos-directory.mdindex 5038cd9aa..401325944 100644--- a/docs/old/workos-directory.md+++ b/docs/old/workos-directory.md@@ -22,6 +22,13 @@ off by default; this page says what works today and what does not yet.from Switch yet, so nobody but the operator creates one; the server refusesto start with any other mode.+With the Helm chart (`deploy/remote/helm/switch`), set+`switchCore.organizationDirectory.mode: workos` and `secrets.workosApiKey`+(or `WORKOS_API_KEY` in `secrets.existingSecret`), next to `switchCore.oidc`+and `switchCore.signup.mode: invite_only`; the settings for changes made from+Switch (below) are under `switchCore.organizationDirectory` too. The render+fails on a combination the server would refuse.+## LinkingNothing is linked automatically. An operator links each Switch organization to