X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/380a54a7d97b34119cbaa3bee05d6b6cd241eee5..bdc069a04fd98529f5c79c6b8a7164fb9119723d:/lib/controller/handler.go?ds=sidebyside diff --git a/lib/controller/handler.go b/lib/controller/handler.go index d524195e44..01f2161632 100644 --- a/lib/controller/handler.go +++ b/lib/controller/handler.go @@ -5,24 +5,22 @@ package controller import ( - "bytes" "context" "database/sql" "errors" "fmt" - "io" "net/http" "net/url" "strings" "sync" "time" - "git.curoverse.com/arvados.git/lib/config" - "git.curoverse.com/arvados.git/lib/controller/railsproxy" - "git.curoverse.com/arvados.git/lib/controller/router" - "git.curoverse.com/arvados.git/sdk/go/arvados" - "git.curoverse.com/arvados.git/sdk/go/health" - "git.curoverse.com/arvados.git/sdk/go/httpserver" + "git.arvados.org/arvados.git/lib/controller/federation" + "git.arvados.org/arvados.git/lib/controller/railsproxy" + "git.arvados.org/arvados.git/lib/controller/router" + "git.arvados.org/arvados.git/sdk/go/arvados" + "git.arvados.org/arvados.git/sdk/go/health" + "git.arvados.org/arvados.git/sdk/go/httpserver" _ "github.com/lib/pq" ) @@ -69,6 +67,10 @@ func (h *Handler) CheckHealth() error { return err } +func (h *Handler) Done() <-chan struct{} { + return nil +} + func neverRedirect(*http.Request, []*http.Request) error { return http.ErrUseLastResponse } func (h *Handler) setup() { @@ -79,21 +81,17 @@ func (h *Handler) setup() { Routes: health.Routes{"ping": func() error { _, err := h.db(&http.Request{}); return err }}, }) - mux.Handle("/arvados/v1/config", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - var buf bytes.Buffer - err := config.ExportJSON(&buf, h.Cluster) - if err != nil { - httpserver.Error(w, err.Error(), http.StatusInternalServerError) - return - } - w.Header().Set("Content-Type", "application/json") - io.Copy(w, &buf) - })) + rtr := router.New(federation.New(h.Cluster)) + mux.Handle("/arvados/v1/config", rtr) + mux.Handle("/"+arvados.EndpointUserAuthenticate.Path, rtr) - if h.Cluster.EnableBetaController14287 { - rtr := router.New(h.Cluster) + if !h.Cluster.ForceLegacyAPI14 { mux.Handle("/arvados/v1/collections", rtr) mux.Handle("/arvados/v1/collections/", rtr) + mux.Handle("/arvados/v1/users", rtr) + mux.Handle("/arvados/v1/users/", rtr) + mux.Handle("/login", rtr) + mux.Handle("/logout", rtr) } hs := http.NotFoundHandler()