following https://dev.arvados.org/issues/17014#note-8
authorNico Cesar <nico@nicocesar.com>
Mon, 16 Nov 2020 19:58:41 +0000 (14:58 -0500)
committerNico Cesar <nico@nicocesar.com>
Mon, 16 Nov 2020 19:58:41 +0000 (14:58 -0500)
removed "len(token) < 41" case

Arvados-DCO-1.1-Signed-off-by: Nico Cesar <nico@curii.com>

lib/controller/federation.go

index 869fec58e4c21b200453880aecb7028344ef7c32..bc93cc9eaf5ce41bd78231a9e165b2086a9f67fc 100644 (file)
@@ -165,11 +165,6 @@ func (h *Handler) validateAPItoken(req *http.Request, token string) (*CurrentUse
                token = sp[2]
        }
 
-       if len(token) < 41 {
-               ctxlog.FromContext(req.Context()).Debugf("validateAPItoken(%s): The lenght of the token is not 41", token)
-               return nil, false, nil
-       }
-
        user.Authorization.APIToken = token
        var scopes string
        err = db.QueryRowContext(req.Context(), `SELECT api_client_authorizations.uuid, api_client_authorizations.scopes, users.uuid FROM api_client_authorizations JOIN users on api_client_authorizations.user_id=users.id WHERE api_token=$1 AND (expires_at IS NULL OR expires_at > current_timestamp AT TIME ZONE 'UTC') LIMIT 1`, token).Scan(&user.Authorization.UUID, &scopes, &user.UUID)