This commit is contained in:
Joe 2025-12-16 12:23:42 -08:00
parent ab5f97d05f
commit 13a8f5dc8a
2 changed files with 10 additions and 7 deletions

View file

@ -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()

View file

@ -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) {