18676: more tweaks after review comments: clarify logic in checkToken
[arvados.git] / services / api / app / models / api_client_authorization.rb
index a6beaa07ab38b6a177e9a466f7cd50f737b0edaa..f8454029d6b8cf2561505080ac5b74b8d57b8c70 100644 (file)
@@ -115,8 +115,9 @@ class ApiClientAuthorization < ArvadosModel
     case token[0..2]
     when 'v2/'
       _, token_uuid, secret, optional = token.split('/')
-      unless token_uuid.andand.length == 27 && secret.andand.length.andand > 0
-        # invalid token
+      unless token_uuid.andand.length == 27 && secret.andand.length.andand > 0 &&
+             token_uuid == Rails.configuration.ClusterID+"-gj3su-anonymouspublic"
+        # invalid v2 token, or v2 token for another user
         return nil
       end
     else