X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9df4cad4500d092bb07909b6f49e4eaaa6d31984..09cbdc3074b3f1e69c9c537875146f6da0a6ed8f:/lib/controller/federation.go diff --git a/lib/controller/federation.go b/lib/controller/federation.go index cd69727ecb..93b8315a63 100644 --- a/lib/controller/federation.go +++ b/lib/controller/federation.go @@ -142,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 @@ -179,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 } @@ -214,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