18288: when running the db:check_long_lived_tokens and
authorWard Vandewege <ward@curii.com>
Thu, 21 Oct 2021 20:16:04 +0000 (16:16 -0400)
committerWard Vandewege <ward@curii.com>
Fri, 22 Oct 2021 18:29:41 +0000 (14:29 -0400)
       db:fix_long_lived_tokens rake tasks, do not expire the
       anonymouspublic token.

Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward@curii.com>

services/api/lib/tasks/manage_long_lived_tokens.rake

index d83c2b6030e1e7cc12f6ad4902bda1d13624e756..7a665ff7e77d81eee221534a547591d5750ac1b6 100644 (file)
@@ -29,7 +29,7 @@ namespace :db do
         # skip this token
         next
       end
-      if (auth.user.uuid =~ /-tpzed-000000000000000/).nil?
+      if (auth.user.uuid =~ /-tpzed-000000000000000/).nil? and (auth.user.uuid =~ /-tpzed-anonymouspublic/).nil?
         CurrentApiClientHelper.act_as_system_user do
           auth.update_attributes!(expires_at: exp_date)
         end
@@ -58,7 +58,7 @@ namespace :db do
         # skip this token
         next
       end
-      if not auth.user.nil? and (auth.user.uuid =~ /-tpzed-000000000000000/).nil?
+      if not auth.user.nil? and (auth.user.uuid =~ /-tpzed-000000000000000/).nil? and (auth.user.uuid =~ /-tpzed-anonymouspublic/).nil?
         user_ids.add(auth.user_id)
         token_count += 1
       end