8000 [v4.0] Add stricter ValidAt constraint · Issue #554 · lcobucci/jwt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[v4.0] Add stricter ValidAt constraint #554
Closed
@Slamdunk

Description

@Slamdunk

Hi, it seems to me that the new ValidAt constraint is very dangerous:

public function assertShouldNotRaiseExceptionWhenTokenDoesNotHaveTimeClaims(): void
{
$token = $this->buildToken();
$constraint = new ValidAt($this->clock);
$constraint->assert($token);
$this->addToAssertionCount(1);
}

It creates a false sense of security, and it's easy to mess with: I've already had a successful token misused because no time claim was set.

I propose to rename ValidAt to LooseValidAt, and introduce a new StrictValidAt that requires all time claims to be set

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0