MCPcopy Index your code
hub / github.com/aws/aws-cli / add_auth

Method add_auth

awscli/botocore/auth.py:164–186  ·  view source on GitHub ↗
(self, request)

Source from the content-addressed store, hash-verified

162 return (qs, b64)
163
164 def add_auth(self, request):
165 # The auth handler is the last thing called in the
166 # preparation phase of a prepared request.
167 # Because of this we have to parse the query params
168 # from the request body so we can update them with
169 # the sigv2 auth params.
170 if self.credentials is None:
171 raise NoCredentialsError()
172 if request.data:
173 # POST
174 params = request.data
175 else:
176 # GET
177 params = request.params
178 params['AWSAccessKeyId'] = self.credentials.access_key
179 params['SignatureVersion'] = '2'
180 params['SignatureMethod'] = 'HmacSHA256'
181 params['Timestamp'] = time.strftime(ISO8601, time.gmtime())
182 if self.credentials.token:
183 params['SecurityToken'] = self.credentials.token
184 qs, signature = self.calc_signature(request, params)
185 params['Signature'] = signature
186 return request
187
188
189class SigV3Auth(BaseSigner):

Calls 2

calc_signatureMethod · 0.95
NoCredentialsErrorClass · 0.90