kipukun / sanic_highway

MIT License
1 stars 0 forks source link

http: implement middleware #9

Open kipukun opened 5 years ago

kipukun commented 5 years ago

Currently, authentication is done through a function inside each Handler. This is ugly, and does not correspond to the way Handlers are currently utilized throughout the rest of the (local) http package. The authentication function's type signature is exactly the same as the HandlerFunc, so this may be implemented as some sort of Middleware field inside a Handler.

kipukun commented 5 years ago

Edit: authenticate's type signature is nearly the same as HandlerFunc, with the exception of an added model.User in the return. This may require some different Middleware type.