+
    šÜi×†  ã                   ó$  € ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHtHt ^ RI	H
t
Ht ^ RIHtHtHtHt ^ RIHt ^ RIHtHtHt  ! R R4      t ! R	 R
4      tR tR tRR ltRR ltRR ltRR lt ! R R4      tR t RR lt!R t"RR lt#R t$R# )é    N)Úcreate_request_objectÚprepare_request_dict)ÚOrderedDictÚget_current_datetime)ÚParamValidationErrorÚUnknownClientMethodErrorÚUnknownSignatureVersionErrorÚ UnsupportedSignatureVersionError)ÚFrozenAuthToken)Ú	ArnParserÚdatetime2timestampÚfix_s3_hostc                   ó–   a € ] tR t^$t o RtRR lt]R 4       t]R 4       t]R 4       t	RR lt
RR ltR	 tR
 tRR lt]tRR ltRtV tR# )ÚRequestSigneraÔ  
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_id: botocore.model.ServiceId
:param service_id: The service id for 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.
Nc                ó„   € W n         W0n        W@n        WPn        Wpn        Wn        \        P                  ! V4      V n        R # ©N)	Ú_region_nameÚ_signing_nameÚ_signature_versionÚ_credentialsÚ_auth_tokenÚ_service_idÚweakrefÚproxyÚ_event_emitter)ÚselfÚ
service_idÚregion_nameÚsigning_nameÚsignature_versionÚcredentialsÚevent_emitterÚ
auth_tokens   &&&&&&&&Ú2/usr/lib/python3/dist-packages/botocore/signers.pyÚ__init__ÚRequestSigner.__init__G   s;   € ð (ÔØ)ÔØ"3ÔØ'ÔØ%ÔØ%Ôô &Ÿmšm¨MÓ:ˆÖó    c                ó   € V P                   # r   )r   ©r   s   &r$   r   ÚRequestSigner.region_name[   s   € à× Ñ Ð r'   c                ó   € V P                   # r   )r   r)   s   &r$   r    ÚRequestSigner.signature_version_   s   € à×&Ñ&Ð&r'   c                ó   € V P                   # r   )r   r)   s   &r$   r   ÚRequestSigner.signing_namec   s   € à×!Ñ!Ð!r'   c                ó$   € V P                  W4      # r   )Úsign)r   Úoperation_nameÚrequestÚkwargss   &&&,r$   ÚhandlerÚRequestSigner.handlerg   s   € ð
 �y‰y˜Ó1Ð1r'   c           
     ó~  € TpVf   V P                   pVf   V P                  pV P                  WVP                  4      pV P                  P                  RV P                  P                  4        RV 2VVV P                   VV VR7       V\        P                  8w  dø   RVRVRV/p	Ve   WYR&   VP                  P                  R	/ 4      p
V'       g$   V
P                  R
4      '       d   V
R
,          V	R&   V
P                  R4      '       d   V
R,          V	R&   V
P                  R4      '       d   V
R,          V	R&   V
P                  R4      e"   V P                  V	V
R,          V
R,          4        V P                  ! R/ V	B pTP                  T4       R# R#   \         d   pTR8w  d   \        TR7      hThRp?ii ; i)a¤  Sign a request before it goes out over the wire.

:type operation_name: string
:param operation_name: The name of the current operation, e.g.
                       ``ListBuckets``.
:type request: AWSRequest
:param request: The request object to be sent over the wire.

:type region_name: str
:param region_name: The region to sign the request for.

:type signing_type: str
:param signing_type: The type of signing to perform. This can be one of
    three possible values:

    * 'standard'     - This should be used for most requests.
    * 'presign-url'  - This should be used when pre-signing a request.
    * 'presign-post' - This should be used when pre-signing an S3 post.

:type expires_in: int
:param expires_in: The number of seconds the presigned url is valid
    for. This parameter is only valid for signing type 'presign-url'.

:type signing_name: str
:param signing_name: The name to use for the service when signing.
Nzbefore-sign.Ú.)r2   r   r   r    Úrequest_signerr1   r   r   r    ÚexpiresÚsigningÚregionÚrequest_credentialsÚidentity_cacheÚ	cache_keyÚstandard©r    © )r   r   Ú_choose_signerÚcontextr   Úemitr   Ú	hyphenizeÚbotocoreÚUNSIGNEDÚgetÚ_resolve_identity_cacheÚget_auth_instancer	   r
   Úadd_auth)r   r1   r2   r   Úsigning_typeÚ
expires_inr   Úexplicit_region_namer    r3   Úsigning_contextÚauthÚes   &&&&&&&      r$   r0   ÚRequestSigner.signn   sâ  € ðF  +ÐØÒØ×+Ñ+ˆKàÒØ×-Ñ-ˆLà ×/Ñ/Ø¨'¯/©/ó
Ðð
 	×Ñ× Ñ Ø˜4×+Ñ+×5Ñ5Ó7Ð8¸¸.Ð9IÐJØØ%Ø×)Ñ)Ø/ØØ)ð 	!ô 	
ð ¤× 1Ñ 1Ô1à Ø˜{Ø#Ð%6ðˆFð
 Ò%Ø$.�yÑ!Ø%Ÿo™o×1Ñ1°)¸RÓ@ˆOß'¨O×,?Ñ,?À×,IÒ,IØ(7¸Õ(A��}Ñ%Ø×"Ñ" >×2Ò2Ø)8¸Õ)H��~Ñ&Ø×"Ñ"Ð#8×9Ò9Ø0?Ø)õ1�Ð,Ñ-ð ×"Ñ"Ð#3Ó4Ò@Ø×,Ñ,ØØ#Ð$4Õ5Ø# KÕ0ôð
Ø×-Ò-Ñ7°Ñ7�ð �M‰M˜'Ö"ñC 2øô2 0ô Ø :Ô-Ü:Ø*;ôð ð �Gûðús   Å0F ÆF<Æ"F7Æ7F<c                ó   € W!R &   W1R&   R# )r=   r>   NrA   )r   r3   Úcacher>   s   &&&&r$   rI   Ú%RequestSigner._resolve_identity_cacheÊ   s   € Ø#(ÐÑ Ø'ˆ{Ór'   c                ól  € RRRR/pVP                  VR4      pVP                  R4      ;'       g    V P                  pVP                  R/ 4      pVP                  RV P                  4      pVP                  R	V P                  4      p	V\        P
                  Jd    VP                  V4      '       g	   We,          pV P                  P                  R
V P                  P                  4        RV 2VV	VVR7      w  r«Ve6   TpV\        P
                  Jd    VP                  V4      '       g	   We,          pV# )a1  
Allow setting the signature version via the choose-signer event.
A value of `botocore.UNSIGNED` means no signing will be performed.

:param operation_name: The operation to sign.
:param signing_type: The type of signing that the signer is to be used
    for.
:return: The signature version to sign with.
úpresign-postz-presign-postúpresign-urlz-queryÚ Ú	auth_typer:   r   r;   zchoose-signer.r7   )r   r   r    rC   )rH   r   r   r   rF   rG   Úendswithr   Úemit_until_responser   rE   )r   r1   rL   rC   Úsigning_type_suffix_mapÚsuffixr    r:   r   r   r4   Úresponses   &&&&        r$   rB   ÚRequestSigner._choose_signerÎ   s7  € ð ˜OØ˜8ð#
Ðð )×,Ñ,¨\¸2Ó>ˆð $ŸK™K¨Ó4×OÐO¸×8OÑ8OÐØ—+‘+˜i¨Ó,ˆØ—{‘{ >°4×3EÑ3EÓFˆØ—k‘k (¨D×,=Ñ,=Ó>ˆà¤X×%6Ñ%6Ó6Ø%×.Ñ.¨v×6Ò6àÕ'Ðà ×/Ñ/×CÑCØ˜T×-Ñ-×7Ñ7Ó9Ð:¸!¸NÐ;KÐLØ%Ø#Ø/Øð Dó 
Ñˆð ÒØ (Ðð "¬×):Ñ):Ó:Ø)×2Ñ2°6×:Ò:à!Õ+Ð!à Ð r'   c                óè  € Vf   V P                   p\        P                  P                  P	                  V4      pVf   \        VR7      hVP                  RJ dd   V P                  '       d<   \        V P                  \        4      '       g   V P                  P                  4       pMV P                  pV! V4      pV# T;'       g    V P                  p	\        VRR4      RJ d'   VR,          p
VR,          pV
P                  V4      p	VR RpV	e   V	P                  4       pWÅR&   VP                  '       d5   V P                   f   \        P"                  P%                  4       hW%R&   WR	&   V! R
/ VB pV# )aA  
Get an auth instance which can be used to sign a request
using the given signature version.

: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 region_name: string
:param region_name: Name of the service region, e.g. ``us-east-1``

:type signature_version: string
:param signature_version: Signature name like ``v4``.

:rtype: :py:class:`~botocore.auth.BaseSigner`
:return: Auth instance to sign a request.
Nr@   TÚREQUIRES_IDENTITY_CACHEr=   r>   r!   r   Úservice_namerA   )r   rF   rP   ÚAUTH_TYPE_MAPSrH   r	   ÚREQUIRES_TOKENr   Ú
isinstancer   Úget_frozen_tokenr   ÚgetattrÚget_credentialsÚget_frozen_credentialsÚREQUIRES_REGIONr   Ú
exceptionsÚNoRegionError)r   r   r   r    r<   r3   ÚclsÚfrozen_tokenrP   r!   rT   ÚkeyÚfrozen_credentialss   &&&&&,       r$   rJ   ÚRequestSigner.get_auth_instanceþ   sm  € ð4 Ò$Ø $× 7Ñ 7Ðä�m‰m×*Ñ*×.Ñ.Ð/@ÓAˆØŠ;Ü.Ø"3ôð ð ×Ñ Ó%Ø××Ð¬
Ø× Ñ ¤/÷)ò )ð  $×/Ñ/×@Ñ@ÓB‘à#×/Ñ/�Ù�|Ó$ˆDØˆKà)×>Ð>¨T×->Ñ->ˆÜ�3Ð1°4Ó8¸DÓ@ØÐ+Õ,ˆEØ˜Õ%ˆCØ×/Ñ/°Ó4ˆKØ�{Ð#ð "ÐØÒ"Ø!,×!CÑ!CÓ!EÐØ 2ˆ}ÑØ××ÐØ× Ñ Ò(Ü×)Ñ)×7Ñ7Ó9Ð9Ø$/�=Ñ!Ø%1�>Ñ"Ù‰}�V‰}ˆØˆr'   c                ó|   € \        V4      pV P                  VVVRVV4       VP                  4        VP                  # )a]  Generates a presigned url

:type request_dict: dict
:param request_dict: The prepared request dictionary returned by
    ``botocore.awsrequest.prepare_request_dict()``

:type operation_name: str
:param operation_name: The operation being signed.

:type expires_in: int
:param expires_in: The number of seconds the presigned url is valid
    for. By default it expires in an hour (3600 seconds)

:type region_name: string
:param region_name: The region name to sign the presigned url.

:type signing_name: str
:param signing_name: The name to use for the service when signing.

:returns: The presigned url
rX   )r   r0   ÚprepareÚurl)r   Úrequest_dictr1   rM   r   r   r2   s   &&&&&& r$   Úgenerate_presigned_urlÚ$RequestSigner.generate_presigned_urlE  sB   € ô: (¨Ó5ˆØ�	‰	ØØØØØØô	
ð 	�‰ÔØ�{‰{Ðr'   )r   r   r   r   r   r   r   r   ©NN)Nr?   NN)é  NN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r%   Úpropertyr   r    r   r4   r0   rI   rB   rJ   Úget_authrw   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r$   r   r   $   s{   ø‡ € ñ ôD;ð( ñ!ó ð!ð ñ'ó ð'ð ñ"ó ð"ô2ôZ#òx(ò.!ô`BðJ !€H÷(ò (r'   r   c                   óJ   a € ] tR tRt o RtR tR
R ltR tR
R ltR t	R	t
V tR# )ÚCloudFrontSignerip  a¤  A signer to create a signed CloudFront URL.

First you create a cloudfront signer based on a normalized RSA signer::

    import rsa
    def rsa_signer(message):
        private_key = open('private_key.pem', 'r').read()
        return rsa.sign(
            message,
            rsa.PrivateKey.load_pkcs1(private_key.encode('utf8')),
            'SHA-1')  # CloudFront requires SHA-1 hash
    cf_signer = CloudFrontSigner(key_id, rsa_signer)

To sign with a canned policy::

    signed_url = cf_signer.generate_signed_url(
        url, date_less_than=datetime(2015, 12, 1))

To sign with a custom policy::

    signed_url = cf_signer.generate_signed_url(url, policy=my_policy)
c                ó   € Wn         W n        R# )aV  Create a CloudFrontSigner.

:type key_id: str
:param key_id: The CloudFront Key Pair ID

:type rsa_signer: callable
:param rsa_signer: An RSA signer.
       Its only input parameter will be the message to be signed,
       and its output will be the signed content as a binary string.
       The hash algorithm needed by CloudFront is SHA-1.
N©Úkey_idÚ
rsa_signer)r   rŠ   r‹   s   &&&r$   r%   ÚCloudFrontSigner.__init__ˆ  s   € ð ŒØ$Žr'   Nc                ó<  € VRJ;'       d    VRJpVRJ ;'       d    VRJ pV'       g	   V'       d   Rp\        V4      hVe   V P                  W4      p\        V\        4      '       d   VP	                  R4      pVe   R\        \        V4      4       2.pM$RV P                  V4      P                  R4       2.pV P                  V4      pVP                  RV P                  V4      P                  R4       2RV P                   2.4       V P                  W4      # )a\  Creates a signed CloudFront URL based on given parameters.

:type url: str
:param url: The URL of the protected object

:type date_less_than: datetime
:param date_less_than: The URL will expire after that date and time

:type policy: str
:param policy: The custom policy, possibly built by self.build_policy()

:rtype: str
:return: The signed URL.
Nz=Need to provide either date_less_than or policy, but not bothÚutf8zExpires=zPolicy=z
Signature=zKey-Pair-Id=)Ú
ValueErrorÚbuild_policyrf   ÚstrÚencodeÚintr   Ú_url_b64encodeÚdecoder‹   ÚextendrŠ   Ú
_build_url)	r   ru   Údate_less_thanÚpolicyÚboth_args_suppliedÚneither_arg_suppliedrQ   ÚparamsÚ	signatures	   &&&&     r$   rw   Ú'CloudFrontSigner.generate_presigned_url—  s  € ð ,°4Ð7×NÐN¸FÈ$Ð<NÐØ-°Ð5×HÐH¸&ÀD¸.Ðß×!5ØOˆAÜ˜Q“-ÐØÒ%à×&Ñ& sÓ;ˆFÜ�fœc×"Ò"Ø—]‘] 6Ó*ˆFØÒ%Ø ¤Ô%7¸Ó%GÓ!HÐ IÐJÐK‰Fà × 3Ñ 3°FÓ ;× BÑ BÀ6Ó JÐKÐLÐMˆFØ—O‘O FÓ+ˆ	Ø�‰à˜T×0Ñ0°Ó;×BÑBÀ6ÓJÐKÐLØ˜tŸ{™{˜mÐ,ðô	
ð �‰˜sÓ+Ð+r'   c                óT   € R V9   d   RMR pW,           RP                  V4      ,           # )Ú?Ú&)Újoin)r   Úbase_urlÚextra_paramsÚ	separators   &&& r$   r—   ÚCloudFrontSigner._build_url½  s&   € Ø (œ?‘C°ˆ	ØÕ# c§h¡h¨|Ó&<Õ<Ð<r'   c                ó(  € \        \        V4      4      p\        RRV//4      pV'       d   RV9  d
   VR,          pRV/VR&   V'       d   \        \        V4      4      pRV/VR&   RV3R	V3.pR
\        V4      ./p\        P                  ! VRR7      # )aØ  A helper to build policy.

:type resource: str
:param resource: The URL or the stream filename of the protected object

:type date_less_than: datetime
:param date_less_than: The URL will expire after the time has passed

:type date_greater_than: datetime
:param date_greater_than: The URL will not be valid until this time

:type ip_address: str
:param ip_address: Use 'x.x.x.x' for an IP, or 'x.x.x.x/x' for a subnet

:rtype: str
:return: The policy in a compact string.
ÚDateLessThanzAWS:EpochTimeÚ/z/32zAWS:SourceIpÚ	IpAddressÚDateGreaterThanÚResourceÚ	ConditionÚ	Statement)Ú
separators)Ú,Ú:)r“   r   r   ÚjsonÚdumps)	r   Úresourcer˜   Údate_greater_thanÚ
ip_addressÚmomentÚ	conditionÚordered_payloadÚcustom_policys	   &&&&&    r$   r�   ÚCloudFrontSigner.build_policyÁ  s§   € ô: Ô'¨Ó7Ó8ˆÜ °/À6Ð1JÐ KÓLˆ	ßØ˜*Ô$Ø˜eÕ#�
Ø&4°jÐ%AˆI�kÑ"ßÜÔ+Ð,=Ó>Ó?ˆFØ,;¸VÐ+DˆIÐ'Ñ(Ø&¨Ð1°KÀÐ3KÐLˆØ$¤{°?Ó'CÐ&DÐEˆÜ�zŠz˜-°JÔ?Ð?r'   c                óŽ   € \         P                  ! V4      P                  R R4      P                  RR4      P                  RR4      # )ó   +ó   -ó   =ó   _ó   /ó   ~)Úbase64Ú	b64encodeÚreplace)r   Údatas   &&r$   r”   ÚCloudFrontSigner._url_b64encodeë  s;   € ô ×Ò˜TÓ"ß‰W�T˜4Ó ß‰W�T˜4Ó ß‰W�T˜4Ó ð		
r'   r‰   ry   )r{   r|   r}   r~   r   r%   rw   r—   r�   r”   r‚   rƒ   r„   s   @r$   r‡   r‡   p  s+   ø‡ € ñò.%ô$,òL=ô(@÷T
ð 
r'   r‡   c                 ó   € \         V R &   R# )Úgenerate_db_auth_tokenN)rÉ   ©Úclass_attributesr3   s   &,r$   Úadd_generate_db_auth_tokenrÌ   ö  ó   € Ü1GÐÐ-Ó.r'   c                 ó*   € \         V R &   \        V R&   R# )Úgenerate_db_connect_auth_tokenÚ$generate_db_connect_admin_auth_tokenN)Ú#dsql_generate_db_connect_auth_tokenÚ)dsql_generate_db_connect_admin_auth_tokenrÊ   s   &,r$   Ú'add_dsql_generate_db_auth_token_methodsrÓ   ú  s    € ä+ð Ð5Ñ6ô 	2ð Ð;Ó<r'   c           
     óæ   € TpVf   V P                   P                  pRRRV/pRRRRR	/ R
VRR/pRpV V RV 2p	\        Wy4       V P                  P	                  RVVRRR7      p
V
\        V4      R # )aÙ  Generates an auth token used to connect to a db with IAM credentials.

:type DBHostname: str
:param DBHostname: The hostname of the database to connect to.

:type Port: int
:param Port: The port number the database is listening on.

:type DBUsername: str
:param DBUsername: The username to log in as.

:type Region: str
:param Region: The region the database is in. If None, the client
    region will be used.

:return: A presigned url which can be used as an auth token.
NÚActionÚconnectÚDBUserÚurl_pathr©   Úquery_stringrY   ÚheadersÚbodyÚmethodÚGETúhttps://r±   é„  zrds-db©r1   rv   r   rM   r   )Úmetar   r   Ú_request_signerrw   Úlen)r   Ú
DBHostnameÚPortÚ
DBUsernameÚRegionr;   rœ   rv   ÚschemeÚendpoint_urlÚpresigned_urls   &&&&&      r$   rÉ   rÉ     s³   € ð$ €FØ‚~Ø—‘×&Ñ&ˆð 	�)Ø�*ð€Fð 	�CØ˜Ø�2Ø�Ø�%ð€Lð €FØ�X˜j˜\¨¨4¨&Ð1€LÜ˜Ô4Ø×(Ñ(×?Ñ?Ø Ø!ØØØð @ó €Mð œ˜V›˜Ð'Ð'r'   c           
     ó&  € RpW%9  d"   \        RV RRP                  V4       2R7      hVf   V P                  P                  pRRRR	R
/ RRV/RR/pRpV V 2p\	        Wh4       V P
                  P                  VVVVRR7      p	V	\        V4      R # )aþ  Generate a DSQL database token for an arbitrary action.

:type Hostname: str
:param Hostname: The DSQL endpoint host name.

:type Action: str
:param Action: Action to perform on the cluster (DbConnectAdmin or DbConnect).

:type Region: str
:param Region: The AWS region where the DSQL Cluster is hosted. If None, the client region will be used.

:type ExpiresIn: int
:param ExpiresIn: The token expiry duration in seconds (default is 900 seconds).

:return: A presigned url which can be used as an auth token.
z	Received z! for action but expected one of: z, )ÚreportNrØ   r©   rÙ   rY   rÚ   rÛ   rÕ   rÜ   rÝ   rÞ   Údsqlrà   )Ú	DbConnectÚDbConnectAdmin)r   r¢   rá   r   r   râ   rw   rã   )
r   ÚHostnamerÕ   rç   Ú	ExpiresInÚpossible_actionsrv   rè   ré   rê   s
   &&&&&     r$   Ú_dsql_generate_db_auth_tokenró   9  sÖ   € ð& 7ÐàÔ%Ü"Ø˜v˜hÐ&GÈÏ	É	ÐRbÓHcÐGdÐeô
ð 	
ð ‚~Ø—‘×&Ñ&ˆð 	�CØ˜Ø�2ØØ�fð
ð 	�%ð€Lð €FØ�X˜h˜ZÐ(€LÜ˜Ô4Ø×(Ñ(×?Ñ?ØØ!ØØØð @ó €Mð œ˜V›˜Ð'Ð'r'   c                ó   € \        WRW#4      # )aŸ  Generate a DSQL database token for the "DbConnect" action.

:type Hostname: str
:param Hostname: The DSQL endpoint host name.

:type Region: str
:param Region: The AWS region where the DSQL Cluster is hosted. If None, the client region will be used.

:type ExpiresIn: int
:param ExpiresIn: The token expiry duration in seconds (default is 900 seconds).

:return: A presigned url which can be used as an auth token.
rî   ©ró   ©r   rð   rç   rñ   s   &&&&r$   rÑ   rÑ   l  s   € ô  (Ø˜ Vóð r'   c                ó   € \        WRW#4      # )a¤  Generate a DSQL database token for the "DbConnectAdmin" action.

:type Hostname: str
:param Hostname: The DSQL endpoint host name.

:type Region: str
:param Region: The AWS region where the DSQL Cluster is hosted. If None, the client region will be used.

:type ExpiresIn: int
:param ExpiresIn: The token expiry duration in seconds (default is 900 seconds).

:return: A presigned url which can be used as an auth token.
rï   rõ   rö   s   &&&&r$   rÒ   rÒ   �  s   € ô  (ØÐ(¨&óð r'   c                   ó0   a € ] tR tRt o R tRR ltRtV tR# )ÚS3PostPresigneri–  c                ó   € Wn         R # r   ©râ   )r   r8   s   &&r$   r%   ÚS3PostPresigner.__init__—  s   € Ø-Ör'   Nc                óº  € Vf   / pVf   . p/ p\        4       pV\        P                  ! VR7      ,           pVP                  \        P
                  P                  4      VR&   . VR&   V F  p	VR,          P                  V	4       K  	  \        V4      p
W*P                  R&   WjP                  R&   V P                  P                  RW¥R4       RV
P                  R	V/# )
ae  Generates the url and the form fields used for a presigned s3 post

:type request_dict: dict
:param request_dict: The prepared request dictionary returned by
    ``botocore.awsrequest.prepare_request_dict()``

:type fields: dict
:param fields: A dictionary of prefilled form fields to build on top
    of.

:type conditions: list
:param conditions: A list of conditions to include in the policy. Each
    element can be either a list or a structure. For example:

    .. code:: python

        [
            {"acl": "public-read"},
            {"bucket": "amzn-s3-demo-bucket"},
            ["starts-with", "$key", "mykey"]
        ]

:type expires_in: int
:param expires_in: The number of seconds the presigned post is valid
    for.

:type region_name: string
:param region_name: The region name to sign the presigned post to.

:rtype: dict
:returns: A dictionary with two elements: ``url`` and ``fields``.
    Url is the url to post to. Fields is a dictionary filled with
    the form fields and respective values to use when submitting the
    post. For example:

    .. code:: python

        {
            'url': 'https://amzn-s3-demo-bucket.s3.amazonaws.com',
            'fields': {
                'acl': 'public-read',
                'key': 'mykey',
                'signature': 'mysignature',
                'policy': 'mybase64 encoded policy'
            }
        }
)ÚsecondsÚ
expirationÚ
conditionszs3-presign-post-fieldszs3-presign-post-policyÚ	PutObjectrW   ru   Úfields)r   ÚdatetimeÚ	timedeltaÚstrftimerF   rP   ÚISO8601Úappendr   rC   râ   r0   ru   )r   rv   r  r   rM   r   r™   Údatetime_nowÚexpire_dater¸   r2   s   &&&&&&     r$   Úgenerate_presigned_postÚ'S3PostPresigner.generate_presigned_postš  sÞ   € ðn Š>ØˆFàÒØˆJð ˆô ,Ó-ˆØ"¤X×%7Ò%7À
Ô%KÕKˆØ*×3Ñ3´H·M±M×4IÑ4IÓJˆˆ|Ñð  "ˆˆ|ÑÛ#ˆIØ�<Õ ×'Ñ'¨	Ö2ñ $ô (¨Ó5ˆØ4:�‰Ð0Ñ1Ø4:�‰Ð0Ñ1à×Ñ×!Ñ!Ø˜¨~ô	
ð �w—{‘{ H¨fÐ5Ð5r'   rû   )NNrz   N)r{   r|   r}   r~   r%   r
  r‚   rƒ   r„   s   @r$   rù   rù   –  s   ø‡ € ò.÷S6ò S6r'   rù   c                 ó   € \         V R &   R# )rw   N)rw   rÊ   s   &,r$   Úadd_generate_presigned_urlr  ð  rÍ   r'   c           	     ó  € TpTpVf   / pTpTpRRR\        V 4      /p	V P                  p
 V P                  V,          pT P
                  P                  P                  T4      pT P                  TTT	R7      p\        P                  ! TP                  RR4      4      pT P                  TTT	T'       * R7      w  pppT P                  TTTT	TR	R
7      pTe   TTR&   T
P                  TTTR7      #   \         d    \	        TR7      hi ; i)aD  Generate a presigned url given a client, its method, and arguments

:type ClientMethod: string
:param ClientMethod: The client method to presign for

:type Params: dict
:param Params: The parameters normally passed to
    ``ClientMethod``.

:type ExpiresIn: int
:param ExpiresIn: The number of seconds the presigned url is valid
    for. By default it expires in an hour (3600 seconds)

:type HttpMethod: string
:param HttpMethod: The http method to use on the generated url. By
    default, the http method is whatever is used in the method's model.

:returns: The presigned url
Úis_presign_requestTÚuse_global_endpoint)Úmethod_name©Ú
api_paramsÚoperation_modelrC   ÚBucketrY   ©Úignore_signing_regionF©r  r  ré   rC   rÚ   Úset_user_agent_headerrÜ   )rv   rM   r1   )Ú_should_use_global_endpointrâ   Ú_PY_TO_OP_NAMEÚKeyErrorr   rá   Úservice_modelr  Ú_emit_api_paramsr   Úis_arnrH   Ú_resolve_endpoint_rulesetÚ_convert_to_request_dictrw   )r   ÚClientMethodÚParamsrñ   Ú
HttpMethodÚclient_methodrœ   rM   Úhttp_methodrC   r8   r1   r  Úbucket_is_arnré   Úadditional_headersÚ
propertiesrv   s   &&&&&             r$   rw   rw   ô  sb  € ð, !€MØ€FØ‚~ØˆØ€JØ€Kà˜dØÔ:¸4Ó@ð€Gð
 ×)Ñ)€NðBØ×,Ñ,¨]Õ;ˆð —i‘i×-Ñ-×=Ñ=¸nÓM€OØ×"Ñ"ØØ'Øð #ó €Fô
 ×$Ò$ V§Z¡Z°¸"Ó%=Ó>€Mð
 	×&Ñ&ØØØØ#0Ô0ð	 	'ó 	ñ	ØØØð ×0Ñ0ØØ'Ø!ØØ"Ø#ð 1ó €Lð ÒØ!,ˆ�XÑð ×0Ñ0Ø!ØØ%ð 1ó ð øôG ô BÜ&°=ÔAÐAðBús   «C/ Ã/Dc                 ó   € \         V R &   R# )r
  N)r
  rÊ   s   &,r$   Úadd_generate_presigned_postr+  C  s   € Ü2IÐÐ.Ó/r'   c           	     ó´  € TpTpTpTp	Tp
Vf   / pMVP                  4       pV	f   . p	RRR\        V 4      /p\        V P                  4      pV P                  P
                  P                  R4      pV P                  RV/VVR7      p\        P                  ! VP                  RR4      4      pV P                  VVVV'       * R	7      w  pppV P                  VVVVVR
R7      pV	P                  RV/4       VP                  R4      '       d#   V	P                  RRVR\        R4      )  .4       MV	P                  RV/4       WxR&   VP!                  VVV	V
R7      # )a›	  Builds the url and the form fields used for a presigned s3 post

:type Bucket: string
:param Bucket: The name of the bucket to presign the post to. Note that
    bucket related conditions should not be included in the
    ``conditions`` parameter.

:type Key: string
:param Key: Key name, optionally add ${filename} to the end to
    attach the submitted filename. Note that key related conditions and
    fields are filled out for you and should not be included in the
    ``Fields`` or ``Conditions`` parameter.

:type Fields: dict
:param Fields: A dictionary of prefilled form fields to build on top
    of. Elements that may be included are acl, Cache-Control,
    Content-Type, Content-Disposition, Content-Encoding, Expires,
    success_action_redirect, redirect, success_action_status,
    and x-amz-meta-.

    Note that if a particular element is included in the fields
    dictionary it will not be automatically added to the conditions
    list. You must specify a condition for the element as well.

:type Conditions: list
:param Conditions: A list of conditions to include in the policy. Each
    element can be either a list or a structure. For example:

    .. code:: python

        [
            {"acl": "public-read"},
            ["content-length-range", 2, 5],
            ["starts-with", "$success_action_redirect", ""]
        ]

    Conditions that are included may pertain to acl,
    content-length-range, Cache-Control, Content-Type,
    Content-Disposition, Content-Encoding, Expires,
    success_action_redirect, redirect, success_action_status,
    and/or x-amz-meta-.

    Note that if you include a condition, you must specify
    a valid value in the fields dictionary as well. A value will
    not be added automatically to the fields dictionary based on the
    conditions.

:type ExpiresIn: int
:param ExpiresIn: The number of seconds the presigned post
    is valid for.

:rtype: dict
:returns: A dictionary with two elements: ``url`` and ``fields``.
    Url is the url to post to. Fields is a dictionary filled with
    the form fields and respective values to use when submitting the
    post. For example:

    .. code:: python

        {
            'url': 'https://amzn-s3-demo-bucket.s3.amazonaws.com',
            'fields': {
                'acl': 'public-read',
                'key': 'mykey',
                'signature': 'mysignature',
                'policy': 'mybase64 encoded policy'
            }
        }
Nr  Tr  ÚCreateBucketr  r  rY   r  Fr  Úbucketz${filename}zstarts-withz$keyrp   )rv   r  r   rM   )Úcopyr  rù   râ   rá   r  r  r  r   r  rH   r   r!  r  r[   rã   r
  )r   r  ÚKeyÚFieldsÚ
Conditionsrñ   r.  rp   r  r   rM   rC   Úpost_presignerr  rœ   r'  ré   r(  r)  rv   s   &&&&&&              r$   r
  r
  G  sª  € ðP €FØ
€CØ€FØ€JØ€Jà‚~Ø‰à—‘“ˆàÒØˆ
ð 	˜dØÔ:¸4Ó@ð€Gô
 % T×%9Ñ%9Ó:€Nð —i‘i×-Ñ-×=Ñ=¸nÓM€OØ×"Ñ"Ø˜fÐ%Ø'Øð #ó €Fô
 ×$Ò$ V§Z¡Z°¸"Ó%=Ó>€Mð
 	×&Ñ&ØØØØ#0Ô0ð	 	'ó 	ñ	ØØØð ×0Ñ0ØØ'Ø!ØØ"Ø#ð 1ó €Lð ×Ñ�x Ð(Ô)ð ‡|�|�M×"Ò"Ø×Ñ˜=¨&°#Ð6K¼¸]Ó9KÐ8KÐ2LÐMÕNà×Ñ˜5 #˜,Ô'ð ˆ5�Mà×1Ñ1Ø!ØØØð	 2ó ð r'   c                 ón  € V P                   P                  R 8w  d   R# V P                   P                  P                  pV'       dp   VP	                  RR4      '       d   R# VP	                  R4      R8X  d(   V P                   P                  P
                  R8X  d   R# VP	                  R4      R8X  d   R# R# )	ÚawsFÚuse_dualstack_endpointÚus_east_1_regional_endpointÚregionalz	us-east-1Úaddressing_styleÚvirtualT)rá   Ú	partitionÚconfigÚs3rH   r   )ÚclientÚ	s3_configs   & r$   r  r  Ö  s‰   € Ø‡{�{×Ñ Ô%ÙØ—‘×"Ñ"×%Ñ%€IßØ�=‰=Ð1°5×9Ò9Ùà�M‰MÐ7Ó8¸JÔFØ—‘×"Ñ"×.Ñ.°+Ô=áØ�=‰=Ð+Ó,°	Ô9ÙÙr'   r   )Nrß   )Nrz   N)NNrz   )%rÃ   r  r²   r   rF   Úbotocore.authÚbotocore.awsrequestr   r   Úbotocore.compatr   r   Úbotocore.exceptionsr   r   r	   r
   Úbotocore.tokensr   Úbotocore.utilsr   r   r   r   r‡   rÌ   rÓ   rÉ   ró   rÑ   rÒ   rù   r  rw   r+  r
  r  rA   r'   r$   Ú<module>rF     sŸ   ðó Û Û Û ã Û ß Kß =÷ó õ ,÷ñ ÷Iñ I÷X
C
ñ C
òLHòô3(ôl0(ôfô*÷*W6ñ W6òtHôLò^JôLô^r'   