From 13a8f5dc8abf993d68affb1d46aed35d8fa2dc1a Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 16 Dec 2025 12:23:42 -0800 Subject: [PATCH] tweak --- src/lib.rs | 12 ++++++------ src/server.rs | 5 ++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index a9c16fe..956f518 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -31,8 +31,8 @@ pub struct BlogdorTheAggregator { endpoint: String, channel_id: u32, email: String, - password: String, // sent *to zulip* in POSTs *from us* - token: String, // checked against incoming POSTs *from zulip* + zulip_token: String, // sent *to zulip* in POSTs *from us* + blogdor_token: String, // sent *from zulip* in POSTs *to us* } #[derive(Debug, Default, Clone, PartialEq, Eq)] @@ -85,8 +85,8 @@ impl BlogdorTheAggregator { endpoint, channel_id, email, - password, - token, + zulip_token: password, + blogdor_token: token, } } @@ -95,7 +95,7 @@ impl BlogdorTheAggregator { } pub async fn spawn_http(&self) { - let state = ServerState::new(self.db.clone(), &self.email, &self.token); + let state = ServerState::new(self.db.clone(), &self.email, &self.blogdor_token); server::spawn_server(state, self.cancel.clone()).await; } @@ -161,7 +161,7 @@ impl BlogdorTheAggregator { match self .client .post(&self.endpoint) - .basic_auth(&self.email, Some(&self.password)) + .basic_auth(&self.email, Some(&self.zulip_token)) .body(msg) .header("Content-Type", "application/x-www-form-urlencoded") .send() diff --git a/src/server.rs b/src/server.rs index a207b17..db1e013 100644 --- a/src/server.rs +++ b/src/server.rs @@ -65,10 +65,13 @@ async fn handle_add_feed( } = request; if state.email == bot_email && state.token == token { tracing::debug!("gonna do a thing with {message:?}"); + // things + + (StatusCode::IM_A_TEAPOT, "nee-ope") } else { tracing::debug!("psych"); + (StatusCode::IM_A_TEAPOT, "nee-ope") } - (StatusCode::IM_A_TEAPOT, "nee-ope") } async fn graceful_shutdown(cancel: CancellationToken) {