CoreFiles by mySites.guru
PermittedFor.php27 lines, 609 bytes, from Joomla_4.2.2-Stable-Full_Package.zip
Raw History Compare with 4.2.1
md5
265e9158b52bffd8bfe45c16b417bd9f
sha1
75484761d5615f530d2f2cba457a76c5db9a57e1
sha256
e8634d23ad43bf00559c44e4ec916e85372ddfb2c131f033ef0f2e78635090a3
<?php

namespace Lcobucci\JWT\Validation\Constraint;

use Lcobucci\JWT\Token;
use Lcobucci\JWT\Validation\Constraint;
use Lcobucci\JWT\Validation\ConstraintViolation;

final class PermittedFor implements Constraint
{
    /** @var string  */
    private $audience;

    public function __construct($audience)
    {
        $this->audience = $audience;
    }

    public function assert(Token $token)
    {
        if (! $token->isPermittedFor($this->audience)) {
            throw new ConstraintViolation(
                'The token is not allowed to be used by this audience'
            );
        }
    }
}

The same content is in 75 releases, Joomla 4.2.0-beta3 to 4.4.14. See them all, or every version of this file.