mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-03 15:38:46 +00:00
Allow /api/ routes without WebAuthentication (#2455)
This commit is contained in:
@@ -15,6 +15,7 @@ package server
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/runatlantis/atlantis/server/logging"
|
||||
"github.com/urfave/negroni"
|
||||
@@ -46,7 +47,8 @@ func (l *RequestLogger) ServeHTTP(rw http.ResponseWriter, r *http.Request, next
|
||||
if !l.WebAuthentication ||
|
||||
r.URL.Path == "/events" ||
|
||||
r.URL.Path == "/healthz" ||
|
||||
r.URL.Path == "/status" {
|
||||
r.URL.Path == "/status" ||
|
||||
strings.HasPrefix(r.URL.Path, "/api/") {
|
||||
allowed = true
|
||||
} else {
|
||||
user, pass, ok := r.BasicAuth()
|
||||
|
||||
Reference in New Issue
Block a user