Closed mchadwick closed 1 year ago
@mchadwick Thanks. And 100% agreed.
Does this failure happen when running in the AWS environment or only, as the message suggests might be the case, when running locally with no access to an instance meta server? If it's the former, that's definitely a bug - it's never my intention to introduce breaking changes in a minor version. If it's only in a non-AWS environment, well then we could probably argue it either way - at the very least we should add a mention in the docs to turn this off when running like that.
Agreed on updating the changelog: in our case, we updated from 2.4.1 to 2.4.2 and had breaking changes on the lib's behavior in AWS environment: we use 2 different regions on S3, and because of that we use config_overrides
options for the ExAws.request/1
. The thing is, without refreshable: false
we fail to use the right region, because the config isn't being overwritten as it was before:
The authorization "***" is malformed; the region 'eu-west-1' is wrong; expecting 'us-east-1'
@mchadwick @rubas @gabrielgiordan Apologies for not getting to this sooner. My real job has been a bit busy. I'm having a look at this, but I'm struggling to figure out exactly what is going wrong - in theory, those overrides are only meant to be refreshed/overwritten in the case where they involve an :awscli
or :instance_role
type config.
Would one of you be able to give me a sample of both your base :ex_aws
config, and the override config you're passing into the request function please (with appropriate redactions, obviously)?
Thanks.
I've reversed the behaviour so that the default is as it was in v2.4.1 and the refreshable behaviour must be explicitly enabled. That will, at least, fix backwards compatibility. The more I look at it, the more I feel like the whole auth system is kind of due for a rewrite since it's had new stuff tacked on to it over the years and has become pretty difficult to manage/reason about. But that's a job for when I (or someone else) has "spare time".
Fix is in 2.4.3.
Recommend updating
CHANGELOG.md
for v2.4.2 to indicate that the refreshable feature is a backwards incompatible change in some cases. It is unexpected to see a patch version bump break functionality.Using ex_aws_s3 2.4.0 with ex_aws 2.4.1:
Using ex_aws_s3 2.4.0 with ex_aws 2.4.2, the
refreshable: false
is needed to opt out of the behavior, otherwise the operation fails.Failure manifests as: