Skip to content

Validation defaults for iat and nbf conflicts with documentation #66

Closed

Description

@matthew-nichols-westtel

In the documentation (https://docs.rs/jsonwebtoken/5.0.1/jsonwebtoken/struct.Validation.html#structfield.validate_iat) it's mentioned that the validate_iat and validate_nbf fields are true by default, but in the source (https://docs.rs/jsonwebtoken/5.0.1/src/jsonwebtoken/validation.rs.html#98-99) the default value is false. This is also the behavior of the current release (5.0.1).

Activity

  1. Keats commented on Nov 9, 2018

    @Keats
    Owner

    Looks like I forgot to update the docs :(

  2. Keats commented on Nov 9, 2018

    @Keats
    Owner

    Although it is interesting in terms of UX what should be done there. We want good, secure defaults for the decoding so it should probably validate those by default if possible, meaning the api of v4 was better despite the buggy implementation (#51).

    I'll think about it over the next couple of days but it looks like this needs to be re-done and it is a breaking change :(
    I'll welcome any input on it, here are the things I would also like to change:

    Probably a few other things but it's already a good start.

  3. Keats commented on Nov 9, 2018

    @Keats
    Owner

    Ah I also don't remember why Validation:algorithm is a vec sadly...

  4. PSeitz commented on Jan 7, 2019

    @PSeitz

    There may be cases where there are multiple validation algorithms are used, but it's only secure if they are paired with their keys.

  5. Keats commented on Jan 10, 2019

    @Keats
    Owner

    Yes that's in the spec but I thought I changed that before, weird. Will be fixed in the next version

  6. Keats commented on Feb 4, 2019

    @Keats
    Owner

    iat validation removed for now, will open another issue to discuss the rest

  7. Keats commented on May 25, 2019

    @Keats
    Owner

    I think the validation issues are fixed in v6 so closing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions