Skip to content

Cannot make the expiration validation work #844

Answered by Slamdunk
geoffroyp asked this question in Q&A
Discussion options

You must be logged in to vote

As the method name suggests, $config->setValidationConstraints doesn't append constraints, it sets them, so the last call overwrites the previous ones.

The following edit is enough:

    $config->setValidationConstraints(
        new StrictValidAt($clock),
        new SignedWith($signer, $key)
    );

The upcoming version v4.2 will contain a simplified API that should ease DX like this.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by geoffroyp
Comment options

You must be logged in to vote
1 reply
@lcobucci
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants