node-jwks-rsa icon indicating copy to clipboard operation
node-jwks-rsa copied to clipboard

[Fix] Change type of unused req param to unknown to resolve type conflicts

Open zackdotcomputer opened this issue 1 year ago • 1 comments

Description

This PR resolves #393 by relaxing the type requirements around the req parameter in the callbacks returned by both the expressJwtSecret and passportJwtSecret integrations. This parameter is not used by the implementations of either function, so it can be safely relaxed to an unknown type. This would allow any value to be inputted, maintaining both backwards and forwards compatibility with type changes in the related express and passport libraries.

The alternative proposed in the issue would be to resolve this new conflict by updating the type to stay precisely in step with passport, but that would introduce unnecessary backwards-compatibility problems for people who were on earlier versions of @types/passport. Since this type's only purpose is to maintain conformance with the external library's types, going with the most permissive solution seems best.

References

Testing

This change is only to make the typescript typing more permissive, and so I believe no change to the testing plan is required.

Checklist

  • [x] I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • [x] All active GitHub checks for tests, formatting, and security are passing
  • [ ] The correct base branch is being used, if not the default branch (I think so, I'm using the default branch?)

zackdotcomputer avatar Jan 04 '24 12:01 zackdotcomputer

@evansims could we please get this merged?

icco avatar Jan 25 '24 00:01 icco