o
    Ü!d°	  ã                   @   s8   d Z dZdZdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ ZdS )zGive better S3 error messages.
a-  You can fix this issue by explicitly providing the correct region location using the --region argument, the AWS_DEFAULT_REGION environment variable, or the region variable in the AWS CLI configuration file.  You can get the bucket's location by running "aws s3api get-bucket-location --bucket BUCKET".zl You can enable AWS Signature Version 4 by running the command: 
aws configure set s3.signature_version s3v4c                 C   s   |   dt¡ d S )Nzafter-call.s3)ÚregisterÚenhance_error_msg)Zevent_handlers© r   úDusr/lib/python3.10/site-packages/awscli/customizations/s3errormsg.pyÚregister_s3_error_msg   s   r   c                 K   s¨   | d u sd| vr
d S t | ƒrd}|t7 }|| d d< d S t| ƒrB| d d }| d d }|d d… d|  }|t7 }|| d d< d S t| ƒrR| d d  t7  < d S d S )NÚErrorzZYou are attempting to operate on a bucket in a region that requires Signature Version 4.  ÚMessageZEndpointéÿÿÿÿz: %s
)Ú_is_sigv4_error_messageÚREGION_ERROR_MSGÚ_is_permanent_redirect_messageÚ_is_kms_sigv4_error_messageÚENABLE_SIGV4_MSG)ÚparsedÚkwargsÚmessageZendpointZnew_messager   r   r   r   #   s    ÿÿr   c                 C   ó   d|   di ¡  dd¡v S )NzPlease use AWS4-HMAC-SHA256r   r   Ú ©Úget©r   r   r   r   r	   8   ó   ÿr	   c                 C   s   |   di ¡  dd¡dkS )Nr   ZCoder   ZPermanentRedirectr   r   r   r   r   r   =   s   r   c                 C   r   )Nz4AWS KMS managed keys require AWS Signature Version 4r   r   r   r   r   r   r   r   r   A   r   r   N)Ú__doc__r
   r   r   r   r	   r   r   r   r   r   r   Ú<module>   s   ÿ	ÿ