From ab6d5cefbea1e8ddf41f385dd85918f651958287 Mon Sep 17 00:00:00 2001
From: benj <benj@rse8.com>
Date: Mon, 19 Jun 2023 17:18:21 -0700
Subject: hack to allow impersonator to impersonate target

---
 crates/secd/store/sqlite/sql/write_impersonator.sql | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 crates/secd/store/sqlite/sql/write_impersonator.sql

(limited to 'crates/secd/store/sqlite/sql/write_impersonator.sql')

diff --git a/crates/secd/store/sqlite/sql/write_impersonator.sql b/crates/secd/store/sqlite/sql/write_impersonator.sql
new file mode 100644
index 0000000..ae81466
--- /dev/null
+++ b/crates/secd/store/sqlite/sql/write_impersonator.sql
@@ -0,0 +1,11 @@
+insert into impersonator (
+    impersonator_id
+    , target_id
+    , credential_id
+    , created_at
+) values (
+  (select identity_id from identity where identity_public_id = $1)
+  , (select identity_id from identity where identity_public_id = $2)
+  , (select credential_id from credential where credential_public_id = $3)
+  , $4
+);
-- 
cgit v1.2.3

