This is an automated email from the git hooks/post-receive script. New commit to branch bow-v2-go in repository bow. See https://gitlab.nuiton.org/chorem/bow.git commit d746491f40711936563ba1b7bc902d4eb6bce4c6 Author: Benjamin <poussin@codelutin.com> Date: Fri Apr 17 08:08:57 2020 +0200 amélriation de l'exclusion de endpoint du filtre d'auth --- pkg/http/router.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/http/router.go b/pkg/http/router.go index ab3f655..8eb71c4 100644 --- a/pkg/http/router.go +++ b/pkg/http/router.go @@ -96,9 +96,16 @@ func cors(next http.Handler) http.Handler { }) } +func withoutAuthenticationEndpoint(r *http.Request) bool { + result := strings.HasSuffix(r.URL.Path, "/auth") || // no auth to create/delete auth + strings.HasSuffix(r.URL.Path, "/system/liveness") || // no auth to test if server is up + strings.HasSuffix(r.URL.Path, "/users") // no auth for creation of user + return result +} + func authentication(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if strings.HasSuffix(r.URL.Path, "/auth") { + if withoutAuthenticationEndpoint(r) { next.ServeHTTP(w, r) return } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.