Giter Site home page Giter Site logo

sop / jwx Goto Github PK

View Code? Open in Web Editor NEW
24.0 2.0 6.0 958 KB

A PHP library for JSON web tokens (JWT) with signature (JWS) and encryption (JWE) support.

License: MIT License

PHP 100.00%
jwt json-web-token jws json-web-signature jwe json-web-encryption jwa json-web-algorithms jwk json-web-key jose

jwx's Issues

Declaration of JWK X509CertificateChainParameter's constructor must be compatible with JWX ArrayParameterValue's constructor

Hi there, thanks for the great package!

Trying to instantiate a JWK X509CertificateChainParameter throws the following error on PHP v8.0.10:

Declaration of Sop\JWX\JWK\Parameter\X509CertificateChainParameter::__construct(string ...$certs) must be compatible with Sop\JWX\Parameter\Feature\ArrayParameterValue::__construct(...$values)

I wonder if the X509 parameter's constructor definition can be changed to something like:

/**
 * Constructor.
 *
 * @param string[] $certs Base64 encoded DER certificates
 */
public function __construct(...$certs)
{
    /** @var string $cert */
    foreach ($certs as $cert) {
        if (!Base64::isValid($cert)) {
            throw new \UnexpectedValueException(
                'Certificate must be base64 encoded.');
        }
    }
    parent::__construct(self::PARAM_X509_CERTIFICATE_CHAIN, $certs);
}

Happy to open a PR with the change :)

Reporting a vulnerability

Hi,

I discovered a vulnerability in JWX that I would like to report. However, I can't seem to find an appropriate (private) channel to contact the maintainer for responsible disclosure.

@sop How would you like to receive this report?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.