fasthttp icon indicating copy to clipboard operation
fasthttp copied to clipboard

question: Add user level value to connection?

Open stevedw opened this issue 1 year ago • 1 comments

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.

stevedw avatar Jan 20 '24 12:01 stevedw

A pull request would be welcome!

erikdubbelboer avatar Jan 21 '24 02:01 erikdubbelboer