vertexcover-io / falcon-auth

A falcon middleware + authentication backends that adds authentication layer to you app/api service.
MIT License
103 stars 31 forks source link

Can we use this middleware only for a specific route? #12

Closed paulocoutinhox closed 5 years ago

paulocoutinhox commented 5 years ago

Hi,

Can we use this middleware only for a specific route instead on put it in "api" object?

Thanks.

jcwilson commented 5 years ago

I haven't tried this, but it looks like FalconAuthMiddleware.process_resource(), the middleware method, supports the same interface as falcon hooks. So in theory, you could instantiate an instance of FalconAuthMiddleware without adding it to the middleware stack and then pass FalconAuthMiddleware.process_resource as your hook callable. The falcon hook feature provides the flexibility to apply a hook to all responder methods for a resource, or just particular ones like on_get() or on_post(), too.

kgritesh commented 5 years ago

@prsolucoes i believe @jcwilson answer your issue. In any case, this is kind of outside the scope of the project as of now, so i am closing the issue. Let me know, if you have any suggestion around an easy way to support your need and we can discuss.