Exemple #1
0
 /**
  * Get request authorization string as defined.
  *
  * @return string
  */
 public static function getRequestAuthorization($method, $resource, $key, $stsToken, $params, $headers)
 {
     if (!$key) {
         return '';
     }
     $content = $method . "\n";
     if (isset($headers['Content-MD5'])) {
         $content .= $headers['Content-MD5'];
     }
     $content .= "\n";
     if (isset($headers['Content-Type'])) {
         $content .= $headers['Content-Type'];
     }
     $content .= "\n";
     $content .= $headers['Date'] . "\n";
     $content .= Aliyun_Log_Util::canonicalizedLOGHeaders($headers) . "\n";
     $content .= Aliyun_Log_Util::canonicalizedResource($resource, $params);
     return Aliyun_Log_Util::hmacSHA1($content, $key);
 }