feat: add proxy backend errors interceptor

This commit is contained in:
Jonas Kaninda
2024-10-29 09:39:31 +01:00
parent c405882943
commit 9f14c2fa08
10 changed files with 154 additions and 29 deletions

View File

@@ -94,7 +94,9 @@ type AuthBasic struct {
Params map[string]string
}
// AuthMiddleware function, which will be called for each request
// AuthMiddleware authenticate the client using JWT
//
// authorization based on the result of backend's response and continue the request when the client is authorized
func (amw AuthJWT) AuthMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
for _, header := range amw.RequiredHeaders {