⚝
One Hat Cyber Team
⚝
Your IP:
172.22.0.1
Server IP:
151.80.20.34
Server:
Linux 794f04d97d5e 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64
Server Software:
Apache/2.4.62 (Debian)
PHP Version:
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
html
/
vendor
/
league
/
glide
/
src
/
Signatures
/
View File Name :
Signature.php
<?php namespace League\Glide\Signatures; class Signature implements SignatureInterface { /** * Secret key used to generate signature. * * @var string */ protected $signKey; /** * Create Signature instance. * * @param string $signKey Secret key used to generate signature. */ public function __construct($signKey) { $this->signKey = $signKey; } /** * Add an HTTP signature to manipulation parameters. * * @param string $path The resource path. * @param array $params The manipulation parameters. * * @return array The updated manipulation parameters. */ public function addSignature($path, array $params) { return array_merge($params, ['s' => $this->generateSignature($path, $params)]); } /** * Validate a request signature. * * @param string $path The resource path. * @param array $params The manipulation params. * * @throws SignatureException * * @return void */ public function validateRequest($path, array $params) { if (!isset($params['s'])) { throw new SignatureException('Signature is missing.'); } if ($params['s'] !== $this->generateSignature($path, $params)) { throw new SignatureException('Signature is not valid.'); } } /** * Generate an HTTP signature. * * @param string $path The resource path. * @param array $params The manipulation parameters. * * @return string The generated HTTP signature. */ public function generateSignature($path, array $params) { unset($params['s']); ksort($params); return md5($this->signKey.':'.ltrim($path, '/').'?'.http_build_query($params)); } }