okta / okta-oidc-js

okta-oidc-js
https://github.com/okta/okta-oidc-js
Other
395 stars 232 forks source link

feat[jwt-verifier]: Add type definitions for jwt-verifier #976

Closed ryansonshine closed 3 years ago

ryansonshine commented 3 years ago

Updates jwt-verifier with type definitions

Resolves: #393

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

What is the current behavior?

Issue Number: 393

What is the new behavior?

Type definitions for jwt-verifier

Does this PR introduce a breaking change?

Other information

Reviewers

swiftone commented 3 years ago

@ryansonshine - Thanks for the PR (tests included, nice!)

We'll give this a look over and see about moving it forward.

swiftone commented 3 years ago

Internal ref: OKTA-279270

brandonchinn178 commented 3 years ago

I don't believe this works without esModuleInterop. Using this type definition, I get

[server] const oktaJwtVerifier = new OktaJwtVerifier({
[server]                         ^
[server] TypeError: jwt_verifier_1.default is not a constructor

It works if I change to export = OktaJwtVerifier.

ryansonshine commented 3 years ago

I don't believe this works without esModuleInterop. Using this type definition, I get

[server] const oktaJwtVerifier = new OktaJwtVerifier({
[server]                         ^
[server] TypeError: jwt_verifier_1.default is not a constructor

It works if I change to export = OktaJwtVerifier.

@brandonchinn178 You're right, good catch! export updated

shellscape commented 3 years ago

@ryansonshine any chance you'd be willing to put these up on https://github.com/DefinitelyTyped/DefinitelyTyped while this is under review?

ryansonshine commented 3 years ago

@shellscape If we believe it may be some time before this makes it into a release of okta-oidc-js, I'd be happy to

@swiftone Do we have a rough estimate on when this could make its way into a release?

shellscape commented 3 years ago

@ryansonshine it's not a knock on Okta by any means, but they don't tend to move too quickly. They have an internal process that creates some friction, as compared to other open source projects.

ryansonshine commented 3 years ago

@ryansonshine it's not a knock on Okta by any means, but they don't tend to move too quickly. They have an internal process that creates some friction, as compared to other open source projects.

Fair enough; I'll work on getting this added to DefinitelyTyped

ryansonshine commented 3 years ago

@shellscape @brandonchinn178 If you could please review https://github.com/DefinitelyTyped/DefinitelyTyped/pull/51418

shellscape commented 3 years ago

Thank you!

denysoblohin-okta commented 3 years ago

Closing in favour of https://github.com/okta/okta-oidc-js/pull/979 (copy)