Skip to content

Commit

Permalink
Scrub the contents of the user var, not the literal string "$user" (#141
Browse files Browse the repository at this point in the history
)

(SOFTWARE-5596)

Also make sure we reference the generated var name in the IDTOKEN name list
  • Loading branch information
brianhlin authored Jul 21, 2023
1 parent 248c9c7 commit 07e2782
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/osg-hosted-ce/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v1
appVersion: "5.1.5"
description: OSG Hosted Compute Element
name: osg-hosted-ce
version: 4.5.2
version: 4.5.3

5 changes: 3 additions & 2 deletions charts/osg-hosted-ce/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ data:
# Templatize IDTOKEN generation for glidein -> CE collector advertising (SOFTWARE-5556)
{{- range $index, $map := .Values.SciTokenRemoteUserMapping }}
{{- range $url, $user := $map }}
JOB_ROUTER_CREATE_IDTOKEN_{{ $user }} @=end
# N.B. Special chars in a helm template regex need to be escaped with '\\'
JOB_ROUTER_CREATE_IDTOKEN_{{ mustRegexReplaceAll "[^A-Za-z0-9_]" $user "_" }} @=end
sub = "{{ $user }}@users.htcondor.org"
kid = "POOL"
lifetime = 604800
Expand All @@ -86,7 +87,7 @@ data:
filename = "ce_{{ $user }}.idtoken"
owner = "{{ $user }}"
@end
JOB_ROUTER_CREATE_IDTOKEN_NAMES = $(JOB_ROUTER_CREATE_IDTOKEN_NAMES) {{ $user }}
JOB_ROUTER_CREATE_IDTOKEN_NAMES = $(JOB_ROUTER_CREATE_IDTOKEN_NAMES) {{ mustRegexReplaceAll "[^A-Za-z0-9_]" $user "_" }}
{{- end }}
{{- end }}

Expand Down

0 comments on commit 07e2782

Please sign in to comment.