aws-requests-auth
aws-requests-auth copied to clipboard
Add ability to pass parameters to the botocore session.
Adds session_params
parameter to BotoAwsRequestsAuth
that gets unpacked into the botocore session object. This allows things like passing in regions, profiles, etc... that are outside the default way botocore picks credentials. Solves #51
Would benefit from this getting merged and released at some point. What is left? I think I like using kwarg aws_profile
instead of just profile
to follow pattern already there (and AWS ENV var nomenclature).
I do not have plans for a new release soon - my company has stopped using this package. In the meantime, a workaround is to use the get_aws_request_headers_handler
hook exposed by AWSRequestsAuth
to execute arbitrary code for credential fetching. (Indeed, this is what BotoAWSRequestsAuth
does internally.)
class MyAuth(AWSRequestsAuth):
def get_aws_request_headers_handler(self, r):
return self.get_aws_request_headers(
r=r,
aws_access_key=# any code you like,
aws_secret_access_key=# any code you like,
aws_token=# any code you like,
)
Sounds good and thanks @DavidMuller. If anyone else is looking into this I also did AWS_REGION
on the env to get this to work.
@ethan-deng Will this be merged if you've approved it? seems like a helpful addition