CoreFiles by mySites.guru
UnencodedPayloadChecker.php34 lines, 789 bytes, from Joomla_5.3.2-Stable-Full_Package.zip
Raw History Compare with 5.3.1
md5
53f70e53902f4d07da8be8883ec3c2f3
sha1
2d31a61bcf3b5deb9a3b41cf25218bcc466d9b8b
sha256
007f8218055c3b88adaf05ad36f7b48b0df9b6e25e28571f80d0883ae4379112
<?php

declare(strict_types=1);

namespace Jose\Component\Checker;

use function is_bool;

/**
 * This class is a header parameter checker. When the "b64" is present, it will check if the value is a boolean or not.
 *
 * The use of this checker will allow the use of token with unencoded payload.
 */
final class UnencodedPayloadChecker implements HeaderChecker
{
    private const HEADER_NAME = 'b64';

    public function checkHeader(mixed $value): void
    {
        if (! is_bool($value)) {
            throw new InvalidHeaderException('"b64" must be a boolean.', self::HEADER_NAME, $value);
        }
    }

    public function supportedHeader(): string
    {
        return self::HEADER_NAME;
    }

    public function protectedHeaderOnly(): bool
    {
        return true;
    }
}

The same content is in 136 releases, Joomla 5.1.0-beta1 to 6.3.0-alpha1. See them all, or every version of this file.