feat(Docker): Upgrade to PHP 8.5.0RC3 with native ext-uri support
BREAKING CHANGE: Requires PHP 8.5.0RC3 Changes: - Update Docker base image from php:8.4-fpm to php:8.5.0RC3-fpm - Enable ext-uri for native WHATWG URL parsing support - Update composer.json PHP requirement from ^8.4 to ^8.5 - Add ext-uri as required extension in composer.json - Move URL classes from Url.php85/ to Url/ directory (now compatible) - Remove temporary PHP 8.4 compatibility workarounds Benefits: - Native URL parsing with Uri\WhatWg\Url class - Better performance for URL operations - Future-proof with latest PHP features - Eliminates PHP version compatibility issues
This commit is contained in:
@@ -35,19 +35,49 @@ final readonly class TelegramSignatureProvider implements SignatureProvider
|
||||
return hash_equals($secret, $signature);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse signature from header value
|
||||
*
|
||||
* For Telegram, the signature is simply the secret token value
|
||||
*/
|
||||
public function parseSignature(string $headerValue): \App\Framework\Webhook\ValueObjects\WebhookSignature
|
||||
{
|
||||
return new \App\Framework\Webhook\ValueObjects\WebhookSignature(
|
||||
algorithm: 'token',
|
||||
signature: $headerValue,
|
||||
timestamp: null
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate signature (not applicable for Telegram)
|
||||
*
|
||||
* Telegram doesn't generate signatures from payload.
|
||||
* This method exists for SignatureProvider interface compliance.
|
||||
*/
|
||||
public function generate(string $payload, string $secret): string
|
||||
public function generateSignature(string $payload, string $secret): string
|
||||
{
|
||||
// For Telegram, we just return the secret token
|
||||
// It's sent as-is in the X-Telegram-Bot-Api-Secret-Token header
|
||||
return $secret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the expected header name for Telegram webhooks
|
||||
*/
|
||||
public function getSignatureHeader(): string
|
||||
{
|
||||
return 'X-Telegram-Bot-Api-Secret-Token';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get provider name
|
||||
*/
|
||||
public function getProviderName(): string
|
||||
{
|
||||
return 'telegram';
|
||||
}
|
||||
|
||||
public function getAlgorithm(): string
|
||||
{
|
||||
return 'token';
|
||||
|
||||
Reference in New Issue
Block a user