Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/main/lib/mail/smtp/ |
Upload File : |
<?php namespace Bitrix\Main\Mail\Smtp; use Bitrix\Main\Security\Sign\Signer; class CloudOAuthRefreshData { public function __construct( public readonly string $uid, public readonly int $expires, ) {} protected function getSignPayload(): string { return implode('_', [ $this->uid, $this->expires, ]); } public function getSign(): string { return $this->getSigner()->getSignature($this->getSignPayload(), static::getSignSalt()); } public function isSignValid(string $sign): bool { try { return $this->getSigner()->validate($this->getSignPayload(), $sign, static::getSignSalt()); } catch (\Exception $exception) { return false; } } protected function getSigner(): Signer { return new Signer(); } protected static function getSignSalt(): string { return 'oauth_email_token_refresh'; } }