-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(cli): profile AssumeRole credentials don't work via proxy #7292
Conversation
The proxy configuration was not being properly passed to the `AWS.SharedIniFileCredentials` object, so if users configure AssumeRole credentials in their `~/.aws/config` file, it would try to connect to STS directly instead of going through the proxy. Properly parse and pass the HTTP options to the right AWS file. (Note that this object only takes `HTTPOptions` and not `ConfigurationOptions`, so there's no way to override the user agent on this initial STS call). Fixes #7265.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small things
@@ -298,6 +301,7 @@ function defaultHttpOptions(options: SdkHttpOptions) { | |||
debug('Using proxy server: %s', proxyAddress); | |||
// eslint-disable-next-line @typescript-eslint/no-require-imports | |||
const ProxyAgent: any = require('proxy-agent'); | |||
// tslint:disable-next-line:no-console |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
// This error takes 6 seconds to be completely handled. It might be retries in the SDK | ||
// somewhere, or something about the Node event loop. I've spent an hour trying to figure | ||
// it out and I can't, and I gave up. We'll just have to live with this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add a FIXME
here? don't see it as being blocking for now but interesting nonetheless
// Messy mocking | ||
let called = false; | ||
jest.mock('proxy-agent', () => { | ||
class FakeAgent extends require('https').Agent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this not complain about using require?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course it does :)
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Commit Message
The proxy configuration was not being properly passed to the
AWS.SharedIniFileCredentials
object, so if users configure AssumeRolecredentials in their
~/.aws/config
file, it would try to connect toSTS directly instead of going through the proxy.
Properly parse and pass the HTTP options to the right AWS file.
(Note that this object only takes
HTTPOptions
and notConfigurationOptions
, so there's no way to override the user agenton this initial STS call).
Fixes #7265.
End Commit Message
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license