3
3
oidc_github_idp = " token.actions.githubusercontent.com"
4
4
5
5
# compose the OIDC subject using opinionated set of claims
6
- # TODO: discuss alternative with maintainers
7
- # see 'claims_supported' for all possibilities (some of which would require custom GHA):
6
+ # for alternatives with maintainers,see 'claims_supported' for
7
+ # all possibilities (some of which would require custom GHA):
8
8
# https://token.actions.githubusercontent.com/.well-known/openid-configuration
9
9
ordered_claim_names = [
10
10
" repo" , " environment" , " ref"
@@ -15,7 +15,9 @@ locals {
15
15
var . github_repo , var . github_environment , var . github_branch
16
16
])
17
17
18
- # construct 'sub' claim parts by selecting non-empty arg values, then combine
18
+ # construct 'sub' claim parts by selecting non-empty arg values, then
19
+ # combine; these correspond to the source repo and branch, which
20
+ # the GHA token issuer populates when sending requests to AWS
19
21
claims = [
20
22
for claim in local . ordered_claim_names : format (
21
23
" %s:%s" ,
@@ -24,16 +26,9 @@ locals {
24
26
) if length (local. claims_with_values [claim ]) > 0
25
27
]
26
28
27
- oidc_gha_sub = join (" :" , var. allow_pull_request ? concat (
28
- local. claims , [" pull_request" ]
29
- ) : local. claims
30
- )
31
-
32
- /*
33
- Alternative, which would place more responsibility on user to specify valid OIDC claims:
34
-
35
- `oidc_expected_claims = join(":", [for k,v in var.claim_patterns : "${k}:${v}"])`
36
- */
29
+ # combine all component parts into a ':' delimited string for the
30
+ # AWS policy to use for evaluating incoming request 'sub' claims
31
+ oidc_gha_sub = join (" :" , local. claims )
37
32
38
33
}
39
34
0 commit comments