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

question: Add user level value to connection? #1699

Open
stevedw opened this issue Jan 20, 2024 · 1 comment
Open

question: Add user level value to connection? #1699

stevedw opened this issue Jan 20, 2024 · 1 comment

Comments

@stevedw
Copy link

stevedw commented Jan 20, 2024

Would it be possible to add an exposed user level value (something like a uint64) to the underlying connection on the request context.

This would make adding stuff like rate limit much easier without having to maintain another book keeping data structure keyed by conn id and then having to deal with connection timeouts and book-keeping etc in the user code.

Ideally it would be useful to have it as a direct value so the caller can decide on atomic or not.

Obviously, one could do it with user level attributes, but often the dos spam type stuff is just brute forcing at a conn level and rates are useful to apply at this level prior to identifying a user identity.

@erikdubbelboer
Copy link
Collaborator

A pull request would be welcome!

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

2 participants