File: //home/arjun/projects/env/lib/python3.10/site-packages/boto/__pycache__/auth.cpython-310.pyc
o
weV� � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl m
Z
ddlZddlZddl
Z
ddlmZmZmZmZ ddlmZ ddlmZ zddlmZ ddlmZ W n eyi ddlZdZY nw g d �Zg d
�ZG dd� de�ZG d
d� dee�ZG dd� dee�ZG dd� dee�Z G dd� dee�Z!G dd� dee�Z"G dd� dee�Z#G dd� de#e�Z$G dd� de�Z%G dd� de�Z&G dd � d e&e�Z'G d!d"� d"e&e�Z(G d#d$� d$e&e�Z)G d%d&� d&e)e�Z*d-d'd(�Z+d)d*� Z,d+d,� Z-dS ).z/
Handles authentication required to AWS and GS
� N)�
formatdate)�urllib�encodebytes�
parse_qs_safe�urlparse)�AuthHandler)�BotoClientError)�sha1)�sha256)z-ap-northeast-1z.ap-northeast-1z-ap-southeast-1z.ap-southeast-1z-ap-southeast-2z.ap-southeast-2z
-eu-west-1z
.eu-west-1z-external-1z.external-1z
-sa-east-1z
.sa-east-1z
-us-east-1z
.us-east-1z-us-gov-west-1z.us-gov-west-1z
-us-west-1z
.us-west-1z
-us-west-2z
.us-west-2)
z.cn-z.eu-centralz-eu-centralz.ap-northeast-2z-ap-northeast-2z.ap-south-1z-ap-south-1z
.us-east-2z
-us-east-2z-ca-centralz.ca-centralz
.eu-west-2z
-eu-west-2c @ sH e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� Zdd
� Z dd� Z
dS )�HmacKeyszKey based Auth handler helper.c C s2 |j d u s
|jd u rtj�� �|| _| �|� d S �N)�
access_key�
secret_key�boto�auth_handler�NotReadyToAuthenticate�host�update_provider��selfr �config�provider� r �B/home/arjun/projects/env/lib/python3.10/site-packages/boto/auth.py�__init__e s
zHmacKeys.__init__c C sL || _ tj| j j�d�td�| _tr!tj| j j�d�td�| _d S d | _d S �N�utf-8)� digestmod) � _provider�hmac�newr �encode�sha�_hmacr
� _hmac_256�r r r r r r k s ��
zHmacKeys.update_providerc C s | j rdS dS )N�
HmacSHA256�HmacSHA1)r$ �r r r r � algorithmu s zHmacKeys.algorithmc C s( | j rt}nt}tj| jj�d�|d�S r )r$ r
r"