From 386dab3293faa4fac4747cfc95eadef8a0a3a24d Mon Sep 17 00:00:00 2001 From: Isaiah Inuwa Date: Sat, 9 May 2026 11:57:49 -0500 Subject: [PATCH] Rename Flow to Ceremony --- ARCHITECTURE.md | 2 +- CONTRIBUTING.md | 2 +- credentialsd-ui/src/dbus.rs | 16 ++++++------- credentialsd/src/dbus/flow_control.rs | 4 ++-- credentialsd/src/dbus/ui_control.rs | 26 ++++++++++----------- doc/xyz.iinuwa.credentialsd.FlowControl.xml | 2 +- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 35b21934..8dbb3f23 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -21,7 +21,7 @@ The **UI Controller** is used to launch a UI for the user to respond to authenticator requests for user interaction. The **Flow Controller** interacts with the OS and hardware, like detecting available transports and authenticators. It then relays the information needed for the UI to guide the -user through the authentication flow, like prompts for a user to enter their PIN +user through the authentication ceremony, like prompts for a user to enter their PIN or touch the device. The UI Controller takes user input and responds back to the Flow Controller. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 50c62c45..22a26ffd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -194,7 +194,7 @@ make sure that your changes can build and pass all tests, as well as running the formatting and linting tools [mentioned above](#code-formatting-and-linting). You should also follow the install instructions in [`BUILDING.md`](/BUILDING.md) -and execute authentication flows in a browser to ensure that everything +and execute authentication ceremonies in a browser to ensure that everything still works as it should. # Translations diff --git a/credentialsd-ui/src/dbus.rs b/credentialsd-ui/src/dbus.rs index 29694a36..37b278b6 100644 --- a/credentialsd-ui/src/dbus.rs +++ b/credentialsd-ui/src/dbus.rs @@ -172,20 +172,20 @@ impl CredentialPortalBackend { app_path, options, }; - let flow_object = FlowObject { + let ceremony = CeremonyObject { ui_context, request_tx: self.request_tx.clone(), return_address: sender.to_owned().into(), ui_events_forwarder_task: None, bg_events_tx: None, }; - object_server.at(object_path.clone(), flow_object).await?; + object_server.at(object_path.clone(), ceremony).await?; tracing::debug!("Received UI launch request"); Ok(object_path) } } -pub struct FlowObject { +pub struct CeremonyObject { ui_context: UiContext, pub request_tx: Sender<(ViewRequest, Arc>)>, pub return_address: OwnedUniqueName, @@ -193,9 +193,9 @@ pub struct FlowObject { bg_events_tx: Option>, } -#[interface(name = "org.freedesktop.impl.portal.experimental.Credential.FlowObject")] -impl FlowObject { - /// Start the UI flow with an initial set of available credential interfaces. +#[interface(name = "org.freedesktop.impl.portal.experimental.Credential.Ceremony")] +impl CeremonyObject { + /// Start the UI ceremony with an initial set of available credential interfaces. /// Call this method after subscribing to the signals. async fn start( &mut self, @@ -218,7 +218,7 @@ impl FlowObject { if emitter.user_interacted(&ui_event).await.is_err() { tracing::error!("Failed to send UI event signal."); // TODO: we need to cancel the request here, so we need a - // channel back to the flow object to send the cancellation. + // channel back to the ceremony object to send the cancellation. break; } } @@ -284,7 +284,7 @@ impl FlowObject { } if let Some(path) = header.path() { // TODO: Send clean up task to GUI thread. - object_server.remove::(path).await?; + object_server.remove::(path).await?; } Ok(()) } diff --git a/credentialsd/src/dbus/flow_control.rs b/credentialsd/src/dbus/flow_control.rs index 079809b5..74341a07 100644 --- a/credentialsd/src/dbus/flow_control.rs +++ b/credentialsd/src/dbus/flow_control.rs @@ -27,7 +27,7 @@ use zbus::{ }; use crate::credential_service::ManageDevice; -use crate::dbus::ui_control::Flow; +use crate::dbus::ui_control::Ceremony; use crate::dbus::UiControlServiceClient; use crate::{ credential_service::{hybrid::HybridState, nfc::NfcState, UsbState}, @@ -247,7 +247,7 @@ async fn handle + Send + Unpin + 'static, ) { tokio::spawn(async move { diff --git a/credentialsd/src/dbus/ui_control.rs b/credentialsd/src/dbus/ui_control.rs index 8383d2ca..c55dc1db 100644 --- a/credentialsd/src/dbus/ui_control.rs +++ b/credentialsd/src/dbus/ui_control.rs @@ -37,7 +37,7 @@ pub trait UiController { app_pid: u32, app_path: String, options: PortalBackendOptions, - ) -> impl Future>> + Send; + ) -> impl Future>> + Send; } #[proxy( @@ -74,12 +74,12 @@ trait UiControlService2 { } #[derive(Clone, Debug)] -pub struct Flow { - proxy: Arc>, +pub struct Ceremony { + proxy: Arc>, ui_events_rx: Arc>>, } -impl Flow { +impl Ceremony { pub async fn receive_ui_event(&self) -> Option { self.ui_events_rx.lock().await.recv().await } @@ -99,10 +99,10 @@ impl Flow { } #[proxy( gen_blocking = false, - interface = "org.freedesktop.impl.portal.experimental.Credential.FlowObject", + interface = "org.freedesktop.impl.portal.experimental.Credential.Ceremony", default_service = "xyz.iinuwa.credentialsd.UiControl" )] -trait FlowObject { +trait CeremonyObject { async fn start(&self) -> fdo::Result<()>; async fn notify_state_changed(&self, event: BackgroundEvent) -> fdo::Result<()>; @@ -133,12 +133,12 @@ impl UiControlServiceClient { async fn request_proxy( &self, request_id: RequestId, - ) -> Result, zbus::Error> { + ) -> Result, zbus::Error> { let object_path = ObjectPath::from_string_unchecked(format!( "/org/freedesktop/portal/Credential/{}", request_id )); - FlowObjectProxy::new(&self.conn, object_path).await + CeremonyObjectProxy::new(&self.conn, object_path).await } } @@ -163,7 +163,7 @@ impl UiController for UiControlServiceClient { app_pid: u32, app_path: String, options: PortalBackendOptions, - ) -> Result> { + ) -> Result> { let path = self .proxy2() .await? @@ -181,7 +181,7 @@ impl UiController for UiControlServiceClient { ) .await?; tracing::debug!(?path, "Path initialized"); - let flow_object = FlowObjectProxy::new(&self.conn, path).await?; + let flow_object = CeremonyObjectProxy::new(&self.conn, path).await?; let (from_ui_tx, from_ui_rx) = mpsc::channel(32); let ui_event_stream = flow_object.receive_user_interacted().await?; tokio::task::spawn(async move { @@ -189,7 +189,7 @@ impl UiController for UiControlServiceClient { }); // Mark as ready to receive messages. flow_object.start().await?; - Ok(Flow { + Ok(Ceremony { proxy: Arc::new(flow_object), ui_events_rx: Arc::new(AsyncMutex::new(from_ui_rx)), }) @@ -235,7 +235,7 @@ pub mod test { Mutex as AsyncMutex, Notify, }; - use crate::dbus::ui_control::Flow; + use crate::dbus::ui_control::Ceremony; use super::UiController; @@ -270,7 +270,7 @@ pub mod test { _app_pid: u32, _app_path: String, _options: PortalBackendOptions, - ) -> Result> { + ) -> Result> { unimplemented!() } } diff --git a/doc/xyz.iinuwa.credentialsd.FlowControl.xml b/doc/xyz.iinuwa.credentialsd.FlowControl.xml index 1557b2f6..73ae5eaf 100644 --- a/doc/xyz.iinuwa.credentialsd.FlowControl.xml +++ b/doc/xyz.iinuwa.credentialsd.FlowControl.xml @@ -35,7 +35,7 @@ - +