diff --git a/e2e_test/webhook/check.slt.part b/e2e_test/webhook/check.slt.part new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/e2e_test/webhook/create_table.slt.part b/e2e_test/webhook/create_table.slt.part new file mode 100644 index 0000000000000..6f65b017350b0 --- /dev/null +++ b/e2e_test/webhook/create_table.slt.part @@ -0,0 +1,21 @@ + +statement ok +create table github_sha1 ( + data JSONB +) WITH ( + connector = 'webhook', +) VALIDATE SECRET test_secret AS secure_compare( + headers->>'X-Hub-Signature', + hmac(test_secret, data, 'sha1') +); + +statement ok +create table github_sha256 ( + data JSONB +) WITH ( + connector = 'webhook', +) VALIDATE SECRET test_secret AS secure_compare( + headers->>'X-Hub-Signature-256', + hmac(test_secret, data, 'sha256') +); + diff --git a/e2e_test/webhook/sender.py b/e2e_test/webhook/sender.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/e2e_test/webhook/webhook_source.slt b/e2e_test/webhook/webhook_source.slt new file mode 100644 index 0000000000000..984c12e93bad5 --- /dev/null +++ b/e2e_test/webhook/webhook_source.slt @@ -0,0 +1,4 @@ +statement ok +CREATE SECRET test_secret WITH ( backend = 'meta') AS 'TEST_WEBHOOK'; + +include ../create_table.slt.part diff --git a/src/frontend/src/webhook/mod.rs b/src/frontend/src/webhook/mod.rs index d25e8e0ca91e4..35f24aa726d65 100644 --- a/src/frontend/src/webhook/mod.rs +++ b/src/frontend/src/webhook/mod.rs @@ -60,6 +60,10 @@ pub(super) mod handlers { Path((user, database, schema, table)): Path<(String, String, String, String)>, body: Bytes, ) -> Result<()> { + println!( + "WKXLOG receive something: {:?}, database: {}, table: {}", + body, database, table + ); let session_mgr = SESSION_MANAGER .get() .expect("session manager has been initialized");