-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Aws::Signers::V4 doesn't work with Aws::RefreshingCredentials #961
Comments
Currently the A few months back the signer and credential interfaces were updated to resolve a race condition in the refreshing credential interface. The signer calls the following methods on the credentials object:
Unfortunately, if a refreshing credentials object happens to refresh between invocations of those methods (some of which are called multiple times by the signer) then you make get miss-matched keys. To resolve this race condition, refreshing credentials added a That said, I was discussing with some of the other SDK engineers yesterday. It seems like now would be an appropriate time to extract the sigv4 signer into a separate project to make it accessible, to document it, and to give it a stable interface. As a temporary work-around, and I know this is non-optimal, you can construct a new signer and give it fresh credentials each time you sign. |
I've moved this to our feature requests backlog. That said, I consider this a high priority and hope we can get this work done quickly. |
Thank you for the explanation! I will forward the workaround to the guys working on the Logstash plugin. |
I just set up an EC2 instance running Logstash to write data to one of the brand new AWS Elasticsearch instances. All the requests need to be signed, thus the Logstash plugin uses Aws::Signers::V4 to achieve this. As I don't provide any dedicated credentials on the EC2 instance running Logstash I set up a profile that has the rights to write to Elasticsearch, which this works fine - for some hours...
Once the session token expires, it doesn't get updated in V4. I am pretty sure that the culprit is this change made to the SDK in May. Before this change, the V4 kept the Aws::CredentialProvider as an instance variable, and this has been replaced with the Aws::Credentials themselves. However, only the CredentialProvider (i.e. the Aws::InstanceProfileCredentials) is able to refresh the session token, and the Credentials will always return the same token. So after some hours you will always get the following error when using the Logstash plugin to write data to Elasticsearch:
I spent some hours trying to write meaningful specs and/or a pull request, but I'm totally stuck. I assume that there was a good reason why keeping the CredentialProvider has been replaced with keeping the Credentials, and all I could think of right now would be a rollback :-/
Any help is appreciated - thx!
The text was updated successfully, but these errors were encountered: