From f164c2d4bd09704ecd803edc91cef106340264e8 Mon Sep 17 00:00:00 2001 From: q3k Date: Tue, 10 Nov 2020 21:01:58 +0000 Subject: [PATCH] Revert "app/matrix make cas deployment configurable" This reverts commit 014c9cd018ec848235ea7f2bd543b86a2947fb66. Reason for revert: When applying app/matrix/matrix.hackerspace.pl.jsonnet: ERROR Error in deployments matrix.oauth2-cas-proxy: ValidationError(v1.Deployment.spec.template.spec.containers[0].env[4].valueFrom): unknown field "secretkeyref" in io.k8s.api.core.v1.EnvVarSource Change-Id: I833f8a7d7174632b2edffe2f6a9b3e9bb55eebb9 --- app/matrix/lib/matrix.libsonnet | 17 ++--------------- app/matrix/matrix.hackerspace.pl.jsonnet | 8 -------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/app/matrix/lib/matrix.libsonnet b/app/matrix/lib/matrix.libsonnet index 4190941b..9887f58f 100644 --- a/app/matrix/lib/matrix.libsonnet +++ b/app/matrix/lib/matrix.libsonnet @@ -54,15 +54,6 @@ local postgres = import "../../../kube/postgres.libsonnet"; cas: { # whether to enable the CAS proxy (ie. connect to hswaw sso via OAuth) enable: false, - # generate client ID and secret in with your OAuth2 provider, refer to https://www.oauth.com/oauth2-servers/client-registration/client-id-secret/ - oauth2: { - clientID: error "cas.oauth2.clientID must be set", - clientSecret: error "cas.oauth2.clientSecret must be set", - scope: error "cas.oauth2.scope must be set", - authorizeURL: error "cas.oauth2.authorizeURL must be set", - tokenURL: error "cas.oauth2.tokenURL must be set", - userinfoURL: error "cas.oauth2.userinfoURL must be set", - }, }, }, @@ -147,12 +138,8 @@ local postgres = import "../../../kube/postgres.libsonnet"; env_: { BASE_URL: "https://%s" % [cfg.webDomain], SERVICE_URL: "https://%s" % [cfg.webDomain], - OAUTH2_CLIENT: cfg.cas.oauth2.clientID, - OAUTH2_SECRET: cfg.cas.oauth2.clientSecret, - OAUTH2_SCOPE: cfg.cas.oauth2.scope, - OAUTH2_AUTHORIZE: cfg.cas.oauth2.authorizeURL, - OAUTH2_TOKEN: cfg.cas.oauth2.tokenURL, - OAUTH2_USERINFO: cfg.cas.oauth2.userinfoURL, + OAUTH2_CLIENT: "matrix", + OAUTH2_SECRET: { secretKeyRef: { name: "oauth2-cas-proxy", key: "oauth2_secret" } }, }, }, }, diff --git a/app/matrix/matrix.hackerspace.pl.jsonnet b/app/matrix/matrix.hackerspace.pl.jsonnet index 44e169fc..e882636c 100644 --- a/app/matrix/matrix.hackerspace.pl.jsonnet +++ b/app/matrix/matrix.hackerspace.pl.jsonnet @@ -11,14 +11,6 @@ matrix { serverName: "hackerspace.pl", cas: { enable: true, - oauth2: { - clientID: "matrix", - clientSecret: { secretkeyref: { name: "oauth2-cas-proxy", key: "oauth2_secret" } }, - scope: "profile:read", - authorizeURL: "https://sso.hackerspace.pl/oauth/authorize", - tokenURL: "https://sso.hackerspace.pl/oauth/token", - userinfoURL: "https://sso.hackerspace.pl/api/1/profile", - }, }, },