From ffc14fdc6f3817671b773caac12f6e2e74e03fb5 Mon Sep 17 00:00:00 2001 From: ElderMatt <18527012+ElderMatt@users.noreply.github.com> Date: Wed, 11 Sep 2024 13:23:41 +0200 Subject: [PATCH 1/2] fix: changed quotes to single --- src/operator/gitea.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/operator/gitea.ts b/src/operator/gitea.ts index dda1f57..c7032ef 100644 --- a/src/operator/gitea.ts +++ b/src/operator/gitea.ts @@ -467,10 +467,10 @@ async function setGiteaOIDCConfig(update = false) { AUTH_ID=$(gitea admin auth list --vertical-bars | grep -E "\\|otomi-idp\\s+\\|" | grep -iE "\\|OAuth2\\s+\\|" | awk -F " " '{print $1}' | tr -d '\\n') if [ -z "$AUTH_ID" ]; then echo "Gitea OIDC config not found. Adding OIDC config for otomi-idp." - gitea admin auth add-oauth --name "otomi-idp" --key "${clientID}" --secret "${clientSecret}" --auto-discover-url "${discoveryURL}" --provider "openidConnect" --admin-group "team-admin" --group-claim-name "groups" --group-team-map "${teamNamespaceString}" + gitea admin auth add-oauth --name "otomi-idp" --key "${clientID}" --secret "${clientSecret}" --auto-discover-url "${discoveryURL}" --provider "openidConnect" --admin-group "team-admin" --group-claim-name "groups" --group-team-map '${teamNamespaceString}' elif ${update}; then echo "Gitea OIDC config is different. Updating OIDC config for otomi-idp." - gitea admin auth update-oauth --id "$AUTH_ID" --key "${clientID}" --secret "${clientSecret}" --auto-discover-url "${discoveryURL}" --group-team-map "${teamNamespaceString}" + gitea admin auth update-oauth --id "$AUTH_ID" --key "${clientID}" --secret "${clientSecret}" --auto-discover-url "${discoveryURL}" --group-team-map '${teamNamespaceString}' else echo "Gitea OIDC config is up to date." fi From 93be13dd287136e7d444279d1528ea2e93d8b031 Mon Sep 17 00:00:00 2001 From: ElderMatt <18527012+ElderMatt@users.noreply.github.com> Date: Wed, 11 Sep 2024 13:25:55 +0200 Subject: [PATCH 2/2] fix: added warning for teamstring --- src/operator/gitea.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/operator/gitea.ts b/src/operator/gitea.ts index c7032ef..3558321 100644 --- a/src/operator/gitea.ts +++ b/src/operator/gitea.ts @@ -460,6 +460,7 @@ async function setGiteaOIDCConfig(update = false) { const teamNamespaceString = buildTeamString(env.teamNames) try { + // WARNING: Dont enclose the teamNamespaceString in double quotes, this will escape the string incorrectly and breaks OIDC group mapping in gitea const execCommand = [ 'sh', '-c',