Skip to content

Commit 83e7e74

Browse files
author
Tanmay Sardesai
authored
Merge pull request #164 from Clever/INFRANG-6854
[INFRANG-6854] Bugfix: the oidc token is never loaded lazily
2 parents 2f133bf + 0f63b05 commit 83e7e74

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

VERSION

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
v1.0.6
2-
Updating goci warning message, including recent version release date
1+
v1.0.7
2+
bugfix: dont lazy load the oidc token
33

44
Previously:
5+
- Updating goci warning message, including recent version release date
56
- Supporting lazy loading of environment variables
67
- updated parsing of go version from go.mod
78
- goci now supports validation of go version

internal/environment/environment.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ var (
5555
// OidcEcrUploadRole is the ARN of the role used to assume the ecr
5656
// upload role.
5757
oidcEcrUploadRole = ""
58-
// circleOidcTokenV2 is the oidc token used to assume roles in CI.
59-
// It is provided by circle-ci.
60-
circleOidcTokenV2 = ""
6158

6259
// Regions is the set of regions this app should perform
6360
// operations in.
@@ -173,19 +170,12 @@ func OidcEcrUploadRole() string {
173170
return oidcEcrUploadRole
174171
}
175172

176-
func CircleOidcTokenV2() string {
177-
if circleOidcTokenV2 == "" {
178-
circleOidcTokenV2 = envMustString("CIRCLE_OIDC_TOKEN_V2", false)
179-
}
180-
return circleOidcTokenV2
181-
}
182-
183173
// AWS doesn't provide a way to get the token from a string so we will
184174
// use this to satisfy the interface.
185175
type tokenRetriever struct{}
186176

187177
func (tokenRetriever) GetIdentityToken() ([]byte, error) {
188-
return []byte(circleOidcTokenV2), nil
178+
return []byte(envMustString("CIRCLE_OIDC_TOKEN_V2", false)), nil
189179
}
190180

191181
// AWSCfg initializes an AWS config or exits with code 0 on failure. If

0 commit comments

Comments
 (0)