uswitch / kiam

Integrate AWS IAM with Kubernetes
Apache License 2.0
1.15k stars 238 forks source link

Accept metadata role name request without trailing slash #490

Closed dzoeteman closed 8 months ago

dzoeteman commented 3 years ago

This PR reverts #121, with added test.

It seems as if between when that PR was done and now, AWS has added back the ability to use this endpoint without trailing slash. Some drivers/libraries using AWS authentication do not respect redirects (like the MongoDB Nodejs driver), and use the URL without trailing slash. This causes them to not work with KIAM.

I tested the metadata service directly with a couple different families (t3, m5, r5, c4), and they seem to all respond without a redirect (just a 200 with the role name) when trying the URL without trailing slash.