Skip to content

Commit

Permalink
OY-4954 Remove non-anonymized application secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
tomikat committed Jan 28, 2025
1 parent 3eb4e78 commit 8aecacb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dev-resources/sql/anonymizer-application-queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ WHERE group_answer_values.application_id = :application_id AND
-- name: sql-application-secret-ids
SELECT id FROM application_secrets;

-- name: delete-non-anonymized-secrets!
DELETE FROM application_secrets WHERE NOT EXISTS(SELECT NULL FROM applications a WHERE a.key = application_key);

-- name: sql-update-multi-by-key!
UPDATE multi_answer_values SET value = :val WHERE key = :key;

Expand Down
4 changes: 3 additions & 1 deletion dev/clj/ataru/anonymizer/anonymizer_application_store.clj
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,6 @@
SET secret = ?
WHERE id = ?"]
(map vector (repeatedly (fn [] (crypto/url-part 34))) id-chunk))
{:multi? true}))))
{:multi? true}))
(log/info "Removing non-anonymized application secrets")
(delete-non-anonymized-secrets! {} {:connection connection})))

0 comments on commit 8aecacb

Please sign in to comment.