File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,9 @@ def fetch_credentials(options)
56
56
}
57
57
58
58
sts_endpoint =
59
- if ENV [ "AWS_STS_REGIONAL_ENDPOINTS" ] == "regional" && region
59
+ if ENV [ "AWS_ENDPOINT_URL_STS" ]
60
+ ENV [ "AWS_ENDPOINT_URL_STS" ]
61
+ elsif ENV [ "AWS_STS_REGIONAL_ENDPOINTS" ] == "regional" && region
60
62
"https://sts.#{ region } .amazonaws.com"
61
63
else
62
64
"https://sts.amazonaws.com"
Original file line number Diff line number Diff line change 202
202
) { Fog ::AWS ::Compute . fetch_credentials ( use_iam_profile : true ) }
203
203
end
204
204
205
+ ENV [ "AWS_ENDPOINT_URL_STS" ] = "https://my-special-sts.amazonaws.com"
206
+
207
+ tests ( '#fetch_credentials with global STS endpoint set in env' ) do
208
+ returns (
209
+ aws_access_key_id : 'dummykey' ,
210
+ aws_secret_access_key : 'dummysecret' ,
211
+ aws_session_token : 'dummytoken' ,
212
+ region : 'us-west-1' ,
213
+ sts_endpoint : "https://my-special-sts.amazonaws.com" ,
214
+ aws_credentials_expire_at : expires_at
215
+ ) { Fog ::AWS ::Compute . fetch_credentials ( use_iam_profile : true ) }
216
+ end
217
+
218
+ ENV [ "AWS_ENDPOINT_URL_STS" ] = nil
205
219
ENV [ "AWS_STS_REGIONAL_ENDPOINTS" ] = nil
206
220
ENV [ "AWS_DEFAULT_REGION" ] = nil
207
221
ENV [ "AWS_REGION" ] = nil
You can’t perform that action at this time.
0 commit comments