Skip to content

Commit db00daf

Browse files
Cr 21056 fix (#662)
* fix: properly check if audience was not provided by the user * bump version
1 parent e6fb02b commit db00daf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

incubating/obtain-oidc-id-token/step.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '1.0'
22
kind: step-type
33
metadata:
4-
version: 1.1.1
4+
version: 1.1.2
55
name: obtain-oidc-id-token
66
description: >-
77
Obtain ID token from Codefresh OIDC Provider
@@ -83,8 +83,7 @@ spec:
8383
"properties": {
8484
"AUDIENCE": {
8585
"type": "string",
86-
"description": "the audience of the ID token. For multiple audiences, use a comma-separated list. Defaults to the address of the Codefresh platform instance (For SaaS, https://g.codefresh.io)",
87-
"default": "https://g.codefresh.io"
86+
"description": "the audience of the ID token. For multiple audiences, use a comma-separated list. Defaults to the address of the Codefresh platform instance (For SaaS, https://g.codefresh.io)"
8887
}
8988
}
9089
}
@@ -116,7 +115,9 @@ spec:
116115
apk add jq
117116
118117
URL="$CF_OIDC_REQUEST_URL"
119-
if [ -n "$AUDIENCE" ]; then
118+
119+
# This means that audience was provided by the user
120+
if [ -z "$(echo "$AUDIENCE" | grep '${{AUDIENCE')" ]; then
120121
ENCODED_AUDIENCE=$(echo -n "$AUDIENCE" | jq -s -R -r '@uri')
121122
URL="$URL?audience=$ENCODED_AUDIENCE"
122123
fi

0 commit comments

Comments
 (0)