Skip to content

Restore .Valid() Functionality Somehow #348

Closed
@jcburley

Description

@jcburley

Please restore the .Valid() method; export the new validation functions so we can reimplement it ourselves; or, (and this is currently my favored solution) support a WithNoSignatureValidation option for the .Parse* functions.

The goal here is to be able to validate just the (standard, and perhaps optionally any new custom) claims, while ignoring the signature, while parsing a jwt. (I.e. assume the context is one in which signature makes no sense, such as unit-test code; or is wasteful/difficult, such as in code within a "pipeline" where the signature validation has already occurred.)

This will allow us to port to v5.0.0 (from v4.5.0) without having to copy/duplicate validation code, use reflection, somehow disable signature checking (which I've been struggling with), fork our own version, etc.

(We've been blocked on this upgrade for months while dealing with other more-pressing issues, and hoped to knock this out in a day or so. That hasn't worked out due to this one problem.)

Background: We have a wrapper package that a lot of our code uses, and while I can't say I fully understand why the wrapping function that calls .Valid() is used everywhere, at least beyond test code, it does seem to have been working previously. We have a separate wrapping function that calls .ParseWithClaims(), which is the more-normal code path.

Would a PR be welcome? If so, which approach would you prefer?

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