devboy_fireflies/liveness.rs
1//! Fireflies [`LivenessProbe`] stub per [ADR-021] §6.
2//!
3//! The Fireflies GraphQL API has a `me` query that returns the
4//! authenticated user; routing the response through the typed
5//! liveness shape (active / revoked / expired) is a follow-up.
6//! The stub uses the trait's default `test` impl (returns
7//! [`LivenessStatus::NotImplemented`]) so `doctor` shows a clear
8//! "not implemented" line until the real probe lands.
9//!
10//! [ADR-021]: https://github.com/meteora-pro/devboy-tools/blob/main/docs/architecture/adr/ADR-021-external-secret-sources.md
11//! [`LivenessStatus::NotImplemented`]: devboy_core::liveness::LivenessStatus
12
13use async_trait::async_trait;
14use devboy_core::LivenessProbe;
15
16use crate::client::FirefliesClient;
17
18#[async_trait]
19impl LivenessProbe for FirefliesClient {
20 fn provider_name(&self) -> &str {
21 "fireflies"
22 }
23}
24
25#[cfg(test)]
26mod tests {
27 use super::*;
28 use devboy_core::liveness::LivenessStatus;
29 use secrecy::SecretString;
30
31 #[tokio::test]
32 async fn provider_name_is_fireflies_and_default_returns_not_implemented() {
33 let client = FirefliesClient::new(SecretString::from("any".to_owned()));
34 assert_eq!(client.provider_name(), "fireflies");
35 let r = client
36 .test(&SecretString::from("any".to_owned()))
37 .await
38 .unwrap();
39 assert_eq!(r.status, LivenessStatus::NotImplemented);
40 }
41}