-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Does not work with Bun #154
Comments
I'm curious how our unit tests in bun behave that import public keys. In the node package.json is
I haven't previously used bun, so dowloaded it, read https://bun.sh/guides/test/migrate-from-jest, and ran
Since you have bun experience, would you mind looking at how to run the equivalent of our unit tests?
|
Looks like this is our fault, see #155 |
Gonna be after the weekend before we release a new version:) Bun users hold your breath |
Should be fixed in v4.0.1 |
Let us know how you now fare with Bun @madsbuch |
Awesome! Really fast turnaround time on this! Overall it works now, I get full verifications through! I will revert back to this from the other implementation I had going. The fetcher is quite wonky, but that can be fixed using the customer fetcher:
|
Ok, cool! Any clue what is wrong with the fetcher, I see |
I use this implementation which is stable: CognitoJwtVerifier.create(
{
userPoolId: config.aws.cognito.userPoolId,
tokenUse: "access",
clientId: config.aws.cognito.authorizedClients,
},
{
jwksCache: new SimpleJwksCache({
fetcher: {
fetch: async (uri, req, data) =>
(
await fetch(uri, {
body: data,
...req,
})
).json(),
},
}),
}
) I really appreciate how you have made that part pluggable. I love the "batteries included" aspect, but in particular when there are multiple runtimes (as in Bun, Node, Deno, etc.) it makes sense to hook into better solutions for each runtime,. Anyways, I really appreciate the work here. I have fully gone back to using this package. |
Cheers! And thanks for the feedback And guess not weird that the default implementation for fetcher doesn't work, it uses the "old" NodeJS way of doing it, with eg a pipeline to collect the response, which is pretty NodeJS specific (although I guess Bun would want to support that, as they strive for great compatibility). Anyway nice that you have it working now with just "fetch". |
This library is dysfunctional in a Bun environment.
There is a parallel bug on the Bun bug tracker: oven-sh/bun#8004
I realize that AWS might not feel inclined to support Bun, I just want make a notice that this issue is happening.
The text was updated successfully, but these errors were encountered: