Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"tasks": [
{
"type": "meson",
"target": "credentialsd",
"target": "credentialsd/src/credentialsd:custom",
"mode": "build",
"problemMatcher": [
"$meson-gcc"
Expand All @@ -13,7 +13,7 @@
},
{
"type": "meson",
"target": "credentialsd-ui",
"target": "credentialsd-ui/src/credentialsd-ui:custom",
"mode": "build",
"problemMatcher": [
"$meson-gcc"
Expand Down
6 changes: 5 additions & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,15 @@ Actual interaction I/O is performed in the [libwebauthn][libwebauthn] library.

[libwebauthn]: https://github.com/linux-credentials/libwebauthn

### `credentialsd/src/gateway/`

The Gateway service is defined here, along with its D-Bus interface.

### `credentialsd/src/dbus/`

D-Bus clients and services.

The Gateway and Flow Controller services are defined here, as well as a client
The Flow Controller services are defined here, as well as a client
for the UI Controller.

The `model` module contains some methods to convert from D-Bus types to internal
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions credentialsd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ license = "LGPL-3.0-only"

[dependencies]
async-stream = "0.3.6"
async-trait = "0.1.89"
base64 = "0.22.1"
credentialsd-common = { path = "../credentialsd-common" }
futures-lite.workspace = true
Expand Down
10 changes: 7 additions & 3 deletions credentialsd/src/dbus/flow_control.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! This module implements the service to allow the user to control the flow of
//! the credential request through the trusted UI.

use std::future::Future;
use std::{collections::VecDeque, fmt::Debug, sync::Arc};

use async_trait::async_trait;
use credentialsd_common::model::{
BackgroundEvent, Device, Error as CredentialServiceError, RequestingApplication, WebAuthnError,
};
Expand Down Expand Up @@ -341,13 +341,16 @@ enum SignalState {
Active,
}

/// Coordinates between user and various devices connected to the machine to
/// fulfill credential requests.
#[async_trait]
pub trait CredentialRequestController {
fn request_credential(
async fn request_credential(
&self,
requesting_app: Option<RequestingApplication>,
request: CredentialRequest,
window_handle: Option<WindowHandle>,
) -> impl Future<Output = Result<CredentialResponse, WebAuthnError>> + Send;
) -> Result<CredentialResponse, WebAuthnError>;
}

pub struct CredentialRequestControllerClient {
Expand All @@ -359,6 +362,7 @@ pub struct CredentialRequestControllerClient {
)>,
}

#[async_trait]
impl CredentialRequestController for CredentialRequestControllerClient {
async fn request_credential(
&self,
Expand Down
Loading
Loading