ó –ee[c@sTddlZddlZddlZddlZddlZddlZddlmZmZddl m Z m Z ddl m Z ddl mZddl mZddlmZmZdefd „ƒYZd efd „ƒYZd „Zdd „Zdefd„ƒYZd„Zdddd„Zd„Zdddd„Zd„ZdS(iÿÿÿÿN(tsixt OrderedDict(tcreate_request_objecttprepare_request_dict(tUnknownSignatureVersionError(tUnknownClientMethodError(t UnsupportedSignatureVersionError(t fix_s3_hosttdatetime2timestampt RequestSignercBs•eZdZd„Zed„ƒZed„ƒZed„ƒZd d d„Z d dd d d„Z d„Z d d „Z e Z d d d d „ZRS( s An object to sign requests before they go out over the wire using one of the authentication mechanisms defined in ``auth.py``. This class fires two events scoped to a service and operation name: * choose-signer: Allows overriding the auth signer name. * before-sign: Allows mutating the request before signing. Together these events allow for customization of the request signing pipeline, including overrides, request path manipulation, and disabling signing per operation. :type service_name: string :param service_name: Name of the service, e.g. ``S3`` :type region_name: string :param region_name: Name of the service region, e.g. ``us-east-1`` :type signing_name: string :param signing_name: Service signing name. This is usually the same as the service name, but can differ. E.g. ``emr`` vs. ``elasticmapreduce``. :type signature_version: string :param signature_version: Signature name like ``v4``. :type credentials: :py:class:`~botocore.credentials.Credentials` :param credentials: User credentials with which to sign requests. :type event_emitter: :py:class:`~botocore.hooks.BaseEventHooks` :param event_emitter: Extension mechanism to fire events. cCsC||_||_||_||_||_tj|ƒ|_dS(N(t _service_namet _region_namet _signing_namet_signature_versiont _credentialstweakreftproxyt_event_emitter(tselft service_namet region_namet signing_nametsignature_versiont credentialst event_emitter((s4/tmp/pip-install-xdEqop/botocore/botocore/signers.pyt__init__>s      cCs|jS(N(R (R((s4/tmp/pip-install-xdEqop/botocore/botocore/signers.pyRIscCs|jS(N(R (R((s4/tmp/pip-install-xdEqop/botocore/botocore/signers.pyRMscCs|jS(N(R (R((s4/tmp/pip-install-xdEqop/botocore/botocore/signers.pyRQscKs|j||ƒS(N(tsign(Rtoperation_nametrequesttkwargs((s4/tmp/pip-install-xdEqop/botocore/botocore/signers.pythandlerUststandardc Cs2|d kr|j}n|d kr0|j}n|j|||jƒ}|jjdj|j|ƒd|d|d|jd|d|d|ƒ|t j kr.i|d6|d6|d6}|d k rÑ||dtdate_less_thantpolicyR.tparamst signature((s4/tmp/pip-install-xdEqop/botocore/botocore/signers.pyR@7s   cCs-d|krdnd}||dj|ƒS(Nt?t&(tjoin(Rtbase_urlt extra_paramst separator((s4/tmp/pip-install-xdEqop/botocore/botocore/signers.pyRSZsc CsÌtt|ƒƒ}tii|d6d6ƒ}|r_d|krK|d7}ni|d6|dtfieldsN(R"tdatetimetutcnowt timedeltatstrftimeR'R-tISO8601tappendRR$R‡RR>( RR?R–R”R,RRUt datetime_nowt expire_dateRnR((s4/tmp/pip-install-xdEqop/botocore/botocore/signers.pytgenerate_presigned_postÉs"*          N(RARBRR"RŸ(((s4/tmp/pip-install-xdEqop/botocore/botocore/signers.pyR‘Ås cKst|d s.      ô~  3L  >  r