X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/72d7d41944006d1f48f570784dafe56b9812b0c8..3eb7d9fc324d53f241bce67463c61d69d4f8377a:/lib/controller/federation.go diff --git a/lib/controller/federation.go b/lib/controller/federation.go index 144d41c21b..93b8315a63 100644 --- a/lib/controller/federation.go +++ b/lib/controller/federation.go @@ -121,8 +121,6 @@ func (h *Handler) setupProxyRemoteCluster(next http.Handler) http.Handler { mux.ServeHTTP(w, req) }) - - return mux } type CurrentUser struct { @@ -144,7 +142,7 @@ type CurrentUser struct { // non-nil, true, nil -- if the token is valid func (h *Handler) validateAPItoken(req *http.Request, token string) (*CurrentUser, bool, error) { user := CurrentUser{Authorization: arvados.APIClientAuthorization{APIToken: token}} - db, err := h.db(req.Context()) + db, err := h.dbConnector.GetDB(req.Context()) if err != nil { ctxlog.FromContext(req.Context()).WithError(err).Debugf("validateAPItoken(%s): database error", token) return nil, false, err @@ -181,7 +179,7 @@ func (h *Handler) validateAPItoken(req *http.Request, token string) (*CurrentUse } func (h *Handler) createAPItoken(req *http.Request, userUUID string, scopes []string) (*arvados.APIClientAuthorization, error) { - db, err := h.db(req.Context()) + db, err := h.dbConnector.GetDB(req.Context()) if err != nil { return nil, err } @@ -216,10 +214,9 @@ VALUES ($1, $2, CURRENT_TIMESTAMP AT TIME ZONE 'UTC' + INTERVAL '2 weeks', $3, } return &arvados.APIClientAuthorization{ - UUID: uuid, - APIToken: token, - ExpiresAt: "", - Scopes: scopes}, nil + UUID: uuid, + APIToken: token, + Scopes: scopes}, nil } // Extract the auth token supplied in req, and replace it with a