waiting-for-dev / warden-jwt_auth

JWT token authentication with warden
MIT License
113 stars 56 forks source link

Add request body matcher for token dispatch / revocation #47

Closed janosrusiczki closed 1 year ago

janosrusiczki commented 1 year ago

Thinking about performance I noticed that Rack::Request.new(env).body returns a StringIO object which is only read if needed - that is, the regular expression to match the request body against is present. So this shouldn't be an issue.

To do:

Fixes #254

waiting-for-dev commented 1 year ago

Hi @janosrusiczki, thanks for your collaboration, and sorry for taking so long to get back to you. To be sure I understand, what is the use case for it? Is it to support GraphQL endpoints?

janosrusiczki commented 1 year ago

Yes, precisely. GraphQL endpoints are actually singular, so it's a GraphQL endpoint. That's why I implemented this, to be able to differentiate somehow which request does the token dispatch and which the revocation.

waiting-for-dev commented 1 year ago

Thanks for giving the context. Using the GraphQL endpoint is an opinionated solution, and I wouldn't like to provide 1st class support here. It adds a complexity that doesn't need to be here. I recommend you implement your custom solution on top of devise-jwt if you want to go that way. Apologies for having taken so long before deciding not integrating this and, again, many thanks for taking the time to submit it.

janosrusiczki commented 1 year ago

No problemo, I've been using a fork for a while now. Maybe I'll see about extending / monkey patching later.