Skip to content
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

Q: is JWTSigners() thread safe? #69

Closed
crontab opened this issue May 9, 2022 · 3 comments
Closed

Q: is JWTSigners() thread safe? #69

crontab opened this issue May 9, 2022 · 3 comments
Assignees
Milestone

Comments

@crontab
Copy link

crontab commented May 9, 2022

I'm building a server app based on SwiftNIO (i.e. not Vapor) and I was wondering if I should create one instance of JWTSigners per app, per EventLoop or per each request handler?

This is something worth mentioning in the documentation btw - unless I missed it somehow, of course.

Edit: do I understand it correctly that if I create a JWTSigner instead of JWTSigners at program startup then any calls to sign() or verify() can be considered thread-safe?

@0xTim
Copy link
Member

0xTim commented May 10, 2022

JWTSigners is not thread safe due to the lack of locks in the dictionary. JWTSigner should be thread safe, I don't think there are any issues with BoringSSL across threads

@0xTim 0xTim added this to the v5 milestone Oct 9, 2023
@0xTim
Copy link
Member

0xTim commented Oct 9, 2023

This will be covered by #101

@0xTim 0xTim linked a pull request Oct 9, 2023 that will close this issue
@0xTim 0xTim removed a link to a pull request Oct 20, 2023
@ptoffy
Copy link
Member

ptoffy commented Nov 11, 2023

Done in #116

@ptoffy ptoffy closed this as completed Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants