Add AI service API token auth
This commit is contained in:
@@ -29,6 +29,10 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
if path == "" {
|
||||
path = "/"
|
||||
}
|
||||
if !s.requireAPIToken(path, r) {
|
||||
writeError(w, http.StatusUnauthorized, "unauthorized")
|
||||
return
|
||||
}
|
||||
switch {
|
||||
case r.Method == http.MethodGet && path == "/healthz":
|
||||
writeJSON(w, http.StatusOK, map[string]string{"status": "ok"})
|
||||
|
||||
Reference in New Issue
Block a user