[ARVADOS] updated: 2.1.0-1530-gdedf333ef
Git user
git at public.arvados.org
Wed Oct 27 19:50:16 UTC 2021
Summary of changes:
...20211027154300_delete_disabled_user_tokens_and_keys.rb | 15 +++++++++++++++
1 file changed, 15 insertions(+)
create mode 100644 services/api/db/migrate/20211027154300_delete_disabled_user_tokens_and_keys.rb
via dedf333efd0dbd40ebb6d1bf41200cb9bb6cfa6b (commit)
from 79a442f391a68925ae56c80bcb9bae4343cb9844 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit dedf333efd0dbd40ebb6d1bf41200cb9bb6cfa6b
Author: Ward Vandewege <ward at curii.com>
Date: Wed Oct 27 15:48:54 2021 -0400
18183: add a database migration that deletes tokens and ssh keys that
belong to inactive users.
Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>
diff --git a/services/api/db/migrate/20211027154300_delete_disabled_user_tokens_and_keys.rb b/services/api/db/migrate/20211027154300_delete_disabled_user_tokens_and_keys.rb
new file mode 100644
index 000000000..df3db6f5f
--- /dev/null
+++ b/services/api/db/migrate/20211027154300_delete_disabled_user_tokens_and_keys.rb
@@ -0,0 +1,15 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+class DeleteDisabledUserTokensAndKeys < ActiveRecord::Migration[5.2]
+ def up
+ execute "delete from api_client_authorizations where user_id in (select id from users where is_active ='false' and uuid not like '%-tpzed-anonymouspublic' and uuid not like '%-tpzed-000000000000000')"
+ execute "delete from authorized_keys where owner_uuid in (select uuid from users where is_active ='false' and uuid not like '%-tpzed-anonymouspublic' and uuid not like '%-tpzed-000000000000000')"
+ execute "delete from authorized_keys where authorized_user_uuid in (select uuid from users where is_active ='false' and uuid not like '%-tpzed-anonymouspublic' and uuid not like '%-tpzed-000000000000000')"
+ end
+
+ def down
+ # This migration is not reversible.
+ end
+end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list