3 <ïh[C ã@s:dZddlmZddlmZd dd„ZGdd „d eƒZdS) zÎ Functions in this file are included as a convenience for working with AWSRequestsAuth. External libraries, like boto, that this file imports are not a strict requirement for the aws-requests-auth package. é)ÚSessioné)ÚAWSRequestsAuthNcCs,|dkrtƒjƒ}|jƒ}|j|j|jdœS)a˜ Interacts with boto to retrieve AWS credentials, and returns a dictionary of kwargs to be used in AWSRequestsAuth. boto automatically pulls AWS credentials from a variety of sources including but not limited to credentials files and IAM role. AWS credentials are pulled in the order listed here: http://boto3.readthedocs.io/en/latest/guide/configuration.html#configuring-credentials N)Zaws_access_keyZaws_secret_access_keyZ aws_token)rÚget_credentialsZget_frozen_credentialsZ access_keyZ secret_keyÚtoken)Zcredentials_objZfrozen_credentials©rúT/home/moumis/lambda-venv/lib/python3.6/site-packages/aws_requests_auth/boto_utils.pyr s  rcs$eZdZ‡fdd„Zdd„Z‡ZS)ÚBotoAWSRequestsAuthcs(tt|ƒjdd|||ƒtƒjƒ|_dS)a Example usage for talking to an AWS Elasticsearch Service: BotoAWSRequestsAuth(aws_host='search-service-foobar.us-east-1.es.amazonaws.com', aws_region='us-east-1', aws_service='es') The aws_access_key, aws_secret_access_key, and aws_token are discovered automatically from the environment, in the order described here: http://boto3.readthedocs.io/en/latest/guide/configuration.html#configuring-credentials N)Úsuperr Ú__init__rrÚ_refreshable_credentials)ÚselfZaws_hostZ aws_regionZ aws_service)Ú __class__rrr "s zBotoAWSRequestsAuth.__init__cCst|jƒ}|j|f|ŽS)N)rr Zget_aws_request_headers)r ÚrZ credentialsrrrÚget_aws_request_headers_handler1s z3BotoAWSRequestsAuth.get_aws_request_headers_handler)Ú__name__Ú __module__Ú __qualname__r rÚ __classcell__rr)rrr s r )N)Ú__doc__Zbotocore.sessionrZaws_authrrr rrrrÚs