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/pg/sql/write_impersonator.sql | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 crates/secd/store/pg/sql/write_impersonator.sql

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

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

