go-aws-auth
go-aws-auth copied to clipboard
Does not support API Gateway with custom host names
With API Gateway, you need to sign your URL if you have AWS_IAM authentication enabled and this would be a great service to use if it supported it. Unfortunately, if you are using custom domain with API Gateway, you can't derive the service and region from the URL like you can with other API requests. There should be another method similar to Sign4 that allows the user to manually provide the region and service (execute-api for API Gateway).
:+1: haven't run into this yet, but probably will soon.
I patched API Gateway functionality in commit https://github.com/brianfaull/go-aws-auth/commit/cd6173caebfc79a364bd6734bdcd4ea7e644c3bd Narrowly targeted at API Gateway ("execute-api"), but it seems to work for me: calling Sign() or SignV4() works for API Gateway endpoints. I can PR if it's helpful, or it could be generalized for other 5-length services that are similar. Thanks for this very helpful library.
Due to a failure on my part, I had to re-write history; identical diff-set now as
https://github.com/brianfaull/go-aws-auth/commit/d18aee0828b159b20f61e289daf7b2e86c470339
I apologize for any inconvenience.
Again, only works for generic (non-custom) API Gateway endpoints, like https://abcd1234yz.execute-api.us-east-1.amazonaws.com.
I needed custom host name support so I opened a PR that supports it, @brianfaull I added in your change as well to support calls to non-custom hostnames.