Webhook dispatch reimplementation as a tracer
This commit is contained in:
@@ -267,10 +267,10 @@ pub async fn test(params: &mut JMAPTest) {
|
||||
|
||||
// Check webhook events
|
||||
params.webhook.assert_contains(&[
|
||||
"auth.failure",
|
||||
"auth.success",
|
||||
"auth.banned",
|
||||
"\"login\": \"jdoe@example.com\"",
|
||||
"\"accountType\": \"individual\"",
|
||||
"authFailure",
|
||||
"authSuccess",
|
||||
"authBanned",
|
||||
"\"name\": \"jdoe@example.com\"",
|
||||
"\"type\": \"individual\"",
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -276,10 +276,7 @@ vrfy = true
|
||||
|
||||
[webhook."test"]
|
||||
url = "http://127.0.0.1:8821/hook"
|
||||
events = ["auth.success", "auth.failure", "auth.banned", "auth.error",
|
||||
"message.accepted", "message.rejected", "message.appended",
|
||||
"account.over-quota", "dsn", "double-bounce", "report.incoming.dmarc",
|
||||
"report.incoming.tls", "report.incoming.arf", "report.outgoing"]
|
||||
events = ["*"]
|
||||
signature-key = "ovos-moles"
|
||||
throttle = "100ms"
|
||||
|
||||
@@ -454,6 +451,7 @@ async fn init_jmap_tests(store_id: &str, delete_if_exists: bool) -> JMAPTest {
|
||||
.cloned()
|
||||
.unwrap_or_default(),
|
||||
};
|
||||
let tracers = Tracers::parse(&mut config);
|
||||
let core = Core::parse(&mut config, stores, config_manager).await;
|
||||
let store = core.storage.data.clone();
|
||||
let shared_core = core.into_shared();
|
||||
@@ -461,6 +459,9 @@ async fn init_jmap_tests(store_id: &str, delete_if_exists: bool) -> JMAPTest {
|
||||
// Parse acceptors
|
||||
servers.parse_tcp_acceptors(&mut config, shared_core.clone());
|
||||
|
||||
// Enable tracing
|
||||
tracers.enable();
|
||||
|
||||
// Setup IPC channels
|
||||
let (delivery_tx, delivery_rx) = mpsc::channel(IPC_CHANNEL_BUFFER);
|
||||
let ipc = Ipc { delivery_tx };
|
||||
|
||||
@@ -42,7 +42,7 @@ pub async fn test(params: &mut JMAPTest) {
|
||||
tokio::time::sleep(Duration::from_millis(1000)).await;
|
||||
|
||||
// Check for events
|
||||
params.webhook.assert_contains(&["auth.success"]);
|
||||
params.webhook.assert_contains(&["authSuccess"]);
|
||||
}
|
||||
|
||||
impl MockWebhookEndpoint {
|
||||
|
||||
Reference in New Issue
Block a user