From: Ward Vandewege Date: Thu, 21 Oct 2021 20:16:04 +0000 (-0400) Subject: 18288: when running the db:check_long_lived_tokens and X-Git-Tag: 2.3.0~5 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/1b95927d6b17cfa2a4c8a8f20bee7dafa59e3d34 18288: when running the db:check_long_lived_tokens and db:fix_long_lived_tokens rake tasks, do not expire the anonymouspublic token. Arvados-DCO-1.1-Signed-off-by: Ward Vandewege --- diff --git a/services/api/lib/tasks/manage_long_lived_tokens.rake b/services/api/lib/tasks/manage_long_lived_tokens.rake index d83c2b6030..7a665ff7e7 100644 --- a/services/api/lib/tasks/manage_long_lived_tokens.rake +++ b/services/api/lib/tasks/manage_long_lived_tokens.rake @@ -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