Skip to content

Commit 386dab3

Browse files
committed
Rename Flow to Ceremony
1 parent b98d7e3 commit 386dab3

6 files changed

Lines changed: 26 additions & 26 deletions

File tree

ARCHITECTURE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The **UI Controller** is used to launch a UI for the user to respond to
2121
authenticator requests for user interaction. The **Flow Controller** interacts
2222
with the OS and hardware, like detecting available transports and
2323
authenticators. It then relays the information needed for the UI to guide the
24-
user through the authentication flow, like prompts for a user to enter their PIN
24+
user through the authentication ceremony, like prompts for a user to enter their PIN
2525
or touch the device. The UI Controller takes user input and responds back to the
2626
Flow Controller.
2727

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ make sure that your changes can build and pass all tests, as well as running the
194194
formatting and linting tools [mentioned above](#code-formatting-and-linting).
195195

196196
You should also follow the install instructions in [`BUILDING.md`](/BUILDING.md)
197-
and execute authentication flows in a browser to ensure that everything
197+
and execute authentication ceremonies in a browser to ensure that everything
198198
still works as it should.
199199

200200
# Translations

credentialsd-ui/src/dbus.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,30 +172,30 @@ impl CredentialPortalBackend {
172172
app_path,
173173
options,
174174
};
175-
let flow_object = FlowObject {
175+
let ceremony = CeremonyObject {
176176
ui_context,
177177
request_tx: self.request_tx.clone(),
178178
return_address: sender.to_owned().into(),
179179
ui_events_forwarder_task: None,
180180
bg_events_tx: None,
181181
};
182-
object_server.at(object_path.clone(), flow_object).await?;
182+
object_server.at(object_path.clone(), ceremony).await?;
183183
tracing::debug!("Received UI launch request");
184184
Ok(object_path)
185185
}
186186
}
187187

188-
pub struct FlowObject {
188+
pub struct CeremonyObject {
189189
ui_context: UiContext,
190190
pub request_tx: Sender<(ViewRequest, Arc<AsyncMutex<FlowControlClient>>)>,
191191
pub return_address: OwnedUniqueName,
192192
ui_events_forwarder_task: Option<JoinHandle<()>>,
193193
bg_events_tx: Option<Sender<BackgroundEvent>>,
194194
}
195195

196-
#[interface(name = "org.freedesktop.impl.portal.experimental.Credential.FlowObject")]
197-
impl FlowObject {
198-
/// Start the UI flow with an initial set of available credential interfaces.
196+
#[interface(name = "org.freedesktop.impl.portal.experimental.Credential.Ceremony")]
197+
impl CeremonyObject {
198+
/// Start the UI ceremony with an initial set of available credential interfaces.
199199
/// Call this method after subscribing to the signals.
200200
async fn start(
201201
&mut self,
@@ -218,7 +218,7 @@ impl FlowObject {
218218
if emitter.user_interacted(&ui_event).await.is_err() {
219219
tracing::error!("Failed to send UI event signal.");
220220
// TODO: we need to cancel the request here, so we need a
221-
// channel back to the flow object to send the cancellation.
221+
// channel back to the ceremony object to send the cancellation.
222222
break;
223223
}
224224
}
@@ -284,7 +284,7 @@ impl FlowObject {
284284
}
285285
if let Some(path) = header.path() {
286286
// TODO: Send clean up task to GUI thread.
287-
object_server.remove::<FlowObject, _>(path).await?;
287+
object_server.remove::<CeremonyObject, _>(path).await?;
288288
}
289289
Ok(())
290290
}

credentialsd/src/dbus/flow_control.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use zbus::{
2727
};
2828

2929
use crate::credential_service::ManageDevice;
30-
use crate::dbus::ui_control::Flow;
30+
use crate::dbus::ui_control::Ceremony;
3131
use crate::dbus::UiControlServiceClient;
3232
use crate::{
3333
credential_service::{hybrid::HybridState, nfc::NfcState, UsbState},
@@ -247,7 +247,7 @@ async fn handle<M: ManageDevice + Debug + Send + Sync + 'static, UC: UiControlle
247247
}
248248

249249
fn forward_background_event_stream(
250-
flow: Flow,
250+
flow: Ceremony,
251251
mut stream: impl Stream<Item = BackgroundEvent> + Send + Unpin + 'static,
252252
) {
253253
tokio::spawn(async move {

credentialsd/src/dbus/ui_control.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub trait UiController {
3737
app_pid: u32,
3838
app_path: String,
3939
options: PortalBackendOptions,
40-
) -> impl Future<Output = std::result::Result<Flow, Box<dyn Error>>> + Send;
40+
) -> impl Future<Output = std::result::Result<Ceremony, Box<dyn Error>>> + Send;
4141
}
4242

4343
#[proxy(
@@ -74,12 +74,12 @@ trait UiControlService2 {
7474
}
7575

7676
#[derive(Clone, Debug)]
77-
pub struct Flow {
78-
proxy: Arc<FlowObjectProxy<'static>>,
77+
pub struct Ceremony {
78+
proxy: Arc<CeremonyObjectProxy<'static>>,
7979
ui_events_rx: Arc<AsyncMutex<Receiver<BackendRequest>>>,
8080
}
8181

82-
impl Flow {
82+
impl Ceremony {
8383
pub async fn receive_ui_event(&self) -> Option<BackendRequest> {
8484
self.ui_events_rx.lock().await.recv().await
8585
}
@@ -99,10 +99,10 @@ impl Flow {
9999
}
100100
#[proxy(
101101
gen_blocking = false,
102-
interface = "org.freedesktop.impl.portal.experimental.Credential.FlowObject",
102+
interface = "org.freedesktop.impl.portal.experimental.Credential.Ceremony",
103103
default_service = "xyz.iinuwa.credentialsd.UiControl"
104104
)]
105-
trait FlowObject {
105+
trait CeremonyObject {
106106
async fn start(&self) -> fdo::Result<()>;
107107
async fn notify_state_changed(&self, event: BackgroundEvent) -> fdo::Result<()>;
108108

@@ -133,12 +133,12 @@ impl UiControlServiceClient {
133133
async fn request_proxy(
134134
&self,
135135
request_id: RequestId,
136-
) -> Result<FlowObjectProxy<'_>, zbus::Error> {
136+
) -> Result<CeremonyObjectProxy<'_>, zbus::Error> {
137137
let object_path = ObjectPath::from_string_unchecked(format!(
138138
"/org/freedesktop/portal/Credential/{}",
139139
request_id
140140
));
141-
FlowObjectProxy::new(&self.conn, object_path).await
141+
CeremonyObjectProxy::new(&self.conn, object_path).await
142142
}
143143
}
144144

@@ -163,7 +163,7 @@ impl UiController for UiControlServiceClient {
163163
app_pid: u32,
164164
app_path: String,
165165
options: PortalBackendOptions,
166-
) -> Result<Flow, Box<dyn Error>> {
166+
) -> Result<Ceremony, Box<dyn Error>> {
167167
let path = self
168168
.proxy2()
169169
.await?
@@ -181,15 +181,15 @@ impl UiController for UiControlServiceClient {
181181
)
182182
.await?;
183183
tracing::debug!(?path, "Path initialized");
184-
let flow_object = FlowObjectProxy::new(&self.conn, path).await?;
184+
let flow_object = CeremonyObjectProxy::new(&self.conn, path).await?;
185185
let (from_ui_tx, from_ui_rx) = mpsc::channel(32);
186186
let ui_event_stream = flow_object.receive_user_interacted().await?;
187187
tokio::task::spawn(async move {
188188
_ = forward_ui_events(ui_event_stream, from_ui_tx).await;
189189
});
190190
// Mark as ready to receive messages.
191191
flow_object.start().await?;
192-
Ok(Flow {
192+
Ok(Ceremony {
193193
proxy: Arc::new(flow_object),
194194
ui_events_rx: Arc::new(AsyncMutex::new(from_ui_rx)),
195195
})
@@ -235,7 +235,7 @@ pub mod test {
235235
Mutex as AsyncMutex, Notify,
236236
};
237237

238-
use crate::dbus::ui_control::Flow;
238+
use crate::dbus::ui_control::Ceremony;
239239

240240
use super::UiController;
241241

@@ -270,7 +270,7 @@ pub mod test {
270270
_app_pid: u32,
271271
_app_path: String,
272272
_options: PortalBackendOptions,
273-
) -> Result<Flow, Box<dyn Error>> {
273+
) -> Result<Ceremony, Box<dyn Error>> {
274274
unimplemented!()
275275
}
276276
}

doc/xyz.iinuwa.credentialsd.FlowControl.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<arg name="invalidated_properties" type="as"/>
3636
</signal>
3737
</interface>
38-
<interface name="org.freedesktop.impl.portal.experimental.Credential.FlowObject">
38+
<interface name="org.freedesktop.impl.portal.experimental.Credential.Ceremony">
3939
<!--
4040
Start the UI flow with an initial set of available credential interfaces.
4141
Call this method after subscribing to the signals.

0 commit comments

Comments
 (0)