/**
  * {@inheritdoc}
  */
 public function update(Subject $subject, $event, $context = null)
 {
     if ($event == 'request.before_send') {
         $path = $subject->getResourceUri() ?: '';
         $headers = array_change_key_case($subject->getHeaders()->getAll());
         if (!array_key_exists('Content-Length', $headers)) {
             $headers['Content-Type'] = $subject->getHeader('Content-Type');
         }
         $canonicalizedString = $this->signature->createCanonicalizedString($headers, $path, $subject->getMethod());
         $subject->setHeader('Authorization', 'AWS ' . $this->signature->getAccessKeyId() . ':' . $this->signature->signString($canonicalizedString));
     }
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function update(Subject $subject, $event, $context = null)
 {
     if ($event == 'request.before_send') {
         $subject->setHeader('x-amz-security-token', $this->userToken . ', ' . $this->productToken);
     }
 }