Exemplo n.º 1
0
 private function generateNormalizedString($type, Artifacts $attributes)
 {
     $normalized = 'hawk.' . self::HEADER_VERSION . '.' . $type . "\n" . $attributes->timestamp() . "\n" . $attributes->nonce() . "\n" . strtoupper($attributes->method()) . "\n" . $attributes->resource() . "\n" . strtolower($attributes->host()) . "\n" . $attributes->port() . "\n" . $attributes->hash() . "\n";
     if ($attributes->ext()) {
         // TODO: escape ext
         $normalized .= $attributes->ext();
     }
     $normalized .= "\n";
     if ($attributes->app()) {
         $normalized .= $attributes->app() . "\n" . $attributes->dlg() . "\n";
     }
     return $normalized;
 }