go-http-auth
go-http-auth copied to clipboard
Imlement http.Handler interface
It good that we may set basic auth on per-endpoint level
http.HandleFunc("/user/", authenticator.Wrap(handleUser))
http.HandleFunc("/book/", authenticator.Wrap(handleBook))
But for most cases it would be better to have some global "interceptor" for all endpoints. And looks like the most simple way is to make a delegating Handler and use it with SericeMux. Here I created a basic sample: https://gist.github.com/stokito/24b3e6efb3e1e9357c7d964a7df2c18c
Can you add such AuthHandler into the library?