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
18 changes: 14 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,18 @@ jobs:
# Probably has to do with forking the test processes.
run: meson test --interactive
working-directory: build/
- name: Check clippy recommendations
run: env CARGO_HOME=build/cargo-home cargo clippy --manifest-path credsd/Cargo.toml --target-dir build/credsd/target/release
- name: Check formatting
- name: Check clippy recommendations (Common)
run: env CARGO_HOME=build/cargo-home cargo clippy --manifest-path credentialsd-common/Cargo.toml --target-dir build/credentialsd-common/target/release
- name: Check clippy recommendations (UI)
run: env CARGO_HOME=build/cargo-home cargo clippy --manifest-path credentialsd-ui/Cargo.toml --target-dir build/credentialsd-ui/target/release
- name: Check clippy recommendations (Server)
run: env CARGO_HOME=build/cargo-home cargo clippy --manifest-path credentialsd/Cargo.toml --target-dir build/credentialsd/target/release
- name: Check formatting (Common)
run: cargo fmt --check
working-directory: credsd
working-directory: credentialsd-common
- name: Check formatting (UI)
run: cargo fmt --check
working-directory: credentialsd-ui
- name: Check formatting (Server)
run: cargo fmt --check
working-directory: credentialsd
14 changes: 7 additions & 7 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
{
"type": "lldb",
"request": "launch",
"name": "Debug Daemon (credsd)",
"program": "${workspaceFolder}/build/credsd/src/credsd",
"name": "Debug Daemon (credentialsd)",
"program": "${workspaceFolder}/build/credentialsd/src/credentialsd",
"args": [],
"env": {
"RUST_LOG": "credsd=debug,libwebauthn=debug,libwebauthn::webauthn=debug,libwebauthn=warn,libwebauthn::proto::ctap2::preflight=debug,libwebauthn::transport::channel=debug,zbus::object_server::debug,zbus=debug"
"RUST_LOG": "credentialsd=debug,libwebauthn=debug,libwebauthn::webauthn=debug,libwebauthn=warn,libwebauthn::proto::ctap2::preflight=debug,libwebauthn::transport::channel=debug,zbus::object_server::debug,zbus=debug"
},
"sourceLanguages": ["rust"],
"cwd": "${workspaceFolder}",
Expand All @@ -20,11 +20,11 @@
{
"type": "lldb",
"request": "launch",
"name": "Debug UI (creds-ui)",
"program": "${workspaceFolder}/build/creds-ui/src/creds-ui",
"name": "Debug UI (credentialsd-ui)",
"program": "${workspaceFolder}/build/credentialsd-ui/src/credentialsd-ui",
"args": [],
"env": {
"GSETTINGS_SCHEMA_DIR": "${workspaceFolder}/build/creds-ui/data",
"GSETTINGS_SCHEMA_DIR": "${workspaceFolder}/build/credentialsd-ui/data",
"RUST_LOG": "creds_ui=debug,zbus::trace,zbus::object_server::debug"
},
"sourceLanguages": ["rust"],
Expand All @@ -35,7 +35,7 @@
"compounds": [
{
"name": "Server/Client",
"configurations": ["Debug UI (creds-ui)", "Debug Daemon (credsd)"]
"configurations": ["Debug UI (credentialsd-ui)", "Debug Daemon (credentialsd)"]
}
]
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ ninja -C build

```shell
# Run the server, with debug logging enabled
export GSETTINGS_SCHEMA_DIR=build/creds-ui/data
export RUST_LOG=credsd=debug,creds_ui=debug
./build/credsd/target/debug/credsd &
./build/creds-ui/target/debug/creds-ui
export GSETTINGS_SCHEMA_DIR=build/credentialsd-ui/data
export RUST_LOG=credentialsd=debug,credentials_ui=debug
./build/credentialsd/target/debug/credentialsd &
./build/credentialsd-ui/target/debug/credentialsd-ui
```

### Clients
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="xyz.iinuwa.credentials.Credentials1">
<interface name="xyz.iinuwa.credentialsd.Credentials1">
<method name="CreateCredential">
<arg name="request" type="a{sv}" direction="in"/>
<arg type="a{sv}" direction="out"/>
Expand Down
2 changes: 1 addition & 1 deletion creds-lib/Cargo.lock → credentialsd-common/Cargo.lock

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

2 changes: 1 addition & 1 deletion creds-lib/Cargo.toml → credentialsd-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "creds-lib"
name = "credentialsd-common"
version = "0.1.0"
edition = "2024"
authors = ["Isaiah Inuwa <isaiah.inuwa@gmail.com>", "Martin Sirringhaus <martin.sirringhaus@suse.com>", "Alfie Fresta <alfie.fresta@gmail.com>"]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions creds-ui/Cargo.lock → credentialsd-ui/Cargo.lock

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

4 changes: 2 additions & 2 deletions creds-ui/Cargo.toml → credentialsd-ui/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "creds-ui"
name = "credentialsd-ui"
version = "0.1.0"
edition = "2024"
authors = ["Isaiah Inuwa <isaiah.inuwa@gmail.com>", "Martin Sirringhaus <martin.sirringhaus@suse.com>", "Alfie Fresta <alfie.fresta@gmail.com>"]
license = "LGPL-3.0-only"

[dependencies]
async-std = { version = "1.13.1", features = ["unstable"] }
creds-lib = { path = "../creds-lib" }
credentialsd-common = { path = "../credentialsd-common" }
futures-lite = "2.6.0"
gettext-rs = { version = "0.7", features = ["gettext-system"] }
gtk = { version = "0.9.6", package = "gtk4", features = ["v4_6"] }
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/xyz/iinuwa/CredentialManager/">
<gresource prefix="/xyz/iinuwa/credentialsd/CredentialsUi/">
<!-- see https://gtk-rs.org/gtk4-rs/git/docs/gtk4/struct.Application.html#automatic-resources -->
<file compressed="true" preprocess="xml-stripblanks" alias="gtk/help-overlay.ui">ui/shortcuts.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/window.ui</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Name=Credential Manager
Comment=Write a GTK + Rust application
Type=Application
Exec=credsd
Exec=credentialsd
Terminal=false
Categories=GNOME;GTK;
# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
Expand Down
6 changes: 3 additions & 3 deletions creds-ui/meson.build → credentialsd-ui/meson.build
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
i18n = import('i18n')
gnome = import('gnome')

gui_executable_name = 'creds-ui'
gui_executable_name = 'credentialsd-ui'
gui_build_dir = meson.current_build_dir()
gui_source_dir = meson.current_source_dir()
base_id = 'xyz.iinuwa.CredentialManagerUi'
base_id = 'xyz.iinuwa.credentialsd.CredentialsUi'

dependency('dbus-1', version: '>= 1.6')
dependency('glib-2.0', version: '>= 2.66')
Expand Down Expand Up @@ -71,4 +71,4 @@ gnome.post_install(
gtk_update_icon_cache: true,
glib_compile_schemas: true,
update_desktop_database: true,
)
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions creds-ui/src/client.rs → credentialsd-ui/src/client.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use async_std::stream::Stream;
use creds_lib::client::FlowController;
use credentialsd_common::client::FlowController;
use futures_lite::StreamExt;
use zbus::{Connection, zvariant};

Expand All @@ -23,7 +23,7 @@ impl DbusCredentialClient {
impl FlowController for DbusCredentialClient {
async fn get_available_public_key_devices(
&self,
) -> std::result::Result<Vec<creds_lib::model::Device>, ()> {
) -> std::result::Result<Vec<credentialsd_common::model::Device>, ()> {
let dbus_devices = self
.proxy()
.await?
Expand Down Expand Up @@ -56,7 +56,9 @@ impl FlowController for DbusCredentialClient {
async fn initiate_event_stream(
&mut self,
) -> std::result::Result<
std::pin::Pin<Box<dyn Stream<Item = creds_lib::model::BackgroundEvent> + Send + 'static>>,
std::pin::Pin<
Box<dyn Stream<Item = credentialsd_common::model::BackgroundEvent> + Send + 'static>,
>,
(),
> {
let stream = self
Expand Down
File renamed without changes.
15 changes: 9 additions & 6 deletions creds-ui/src/dbus.rs → credentialsd-ui/src/dbus.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use async_std::channel::Sender;
use creds_lib::server::{BackgroundEvent, Device, ViewRequest};
use credentialsd_common::server::{BackgroundEvent, Device, ViewRequest};
use zbus::{fdo, interface, proxy};

#[proxy(
gen_blocking = false,
interface = "xyz.iinuwa.credentials.FlowControl1",
default_path = "/xyz/iinuwa/credentials/FlowControl",
default_service = "xyz.iinuwa.credentials.FlowControl"
interface = "xyz.iinuwa.credentialsd.FlowControl1",
default_path = "/xyz/iinuwa/credentialsd/FlowControl",
default_service = "xyz.iinuwa.credentialsd.FlowControl"
)]
pub trait FlowControlService {
async fn initiate_event_stream(&self) -> fdo::Result<()>;
Expand All @@ -30,9 +30,12 @@ pub struct UiControlService {
}

/// These methods are called by the credential service to control the UI.
#[interface(name = "xyz.iinuwa.credentials.UiControl1")]
#[interface(name = "xyz.iinuwa.credentialsd.UiControl1")]
impl UiControlService {
async fn launch_ui(&self, request: creds_lib::server::ViewRequest) -> fdo::Result<()> {
async fn launch_ui(
&self,
request: credentialsd_common::server::ViewRequest,
) -> fdo::Result<()> {
tracing::debug!("Received UI launch request");
self.request_tx
.send(request)
Expand Down
4 changes: 2 additions & 2 deletions creds-ui/src/gui/mod.rs → credentialsd-ui/src/gui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use std::{sync::Arc, thread::JoinHandle};

use async_std::{channel::Receiver, sync::Mutex as AsyncMutex};

use creds_lib::server::ViewRequest;
use creds_lib::{client::FlowController, model::ViewUpdate};
use credentialsd_common::server::ViewRequest;
use credentialsd_common::{client::FlowController, model::ViewUpdate};

use view_model::ViewEvent;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl ExampleApplication {

fn setup_css(&self) {
let provider = gtk::CssProvider::new();
provider.load_from_resource("/xyz/iinuwa/CredentialManager/style.css");
provider.load_from_resource("/xyz/iinuwa/credentialsd/CredentialsUi/style.css");
if let Some(display) = gdk::Display::default() {
gtk::style_context_add_provider_for_display(
&display,
Expand All @@ -155,7 +155,7 @@ impl ExampleApplication {
}

pub fn run(&self) -> glib::ExitCode {
info!("Credential Manager ({})", APP_ID);
info!("Credentials UI ({})", APP_ID);
info!("Version: {} ({})", VERSION, PROFILE);
info!("Datadir: {}", PKGDATADIR);

Expand All @@ -165,7 +165,10 @@ impl ExampleApplication {
pub(crate) fn new(tx: Sender<ViewEvent>, rx: Receiver<ViewUpdate>) -> Self {
let app: Self = glib::Object::builder()
.property("application-id", APP_ID)
.property("resource-base-path", "/xyz/iinuwa/CredentialManager/")
.property(
"resource-base-path",
"/xyz/iinuwa/credentialsd/CredentialUI/",
)
.build();
app.imp().tx.replace(Some(tx));
app.imp().rx.replace(Some(rx));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mod imp {

#[derive(Debug, Properties, gtk::CompositeTemplate)]
#[properties(wrapper_type = super::ExampleApplicationWindow)]
#[template(resource = "/xyz/iinuwa/CredentialManager/ui/window.ui")]
#[template(resource = "/xyz/iinuwa/credentialsd/CredentialsUi/ui/window.ui")]
pub struct ExampleApplicationWindow {
#[template_child]
pub headerbar: TemplateChild<gtk::HeaderBar>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use async_std::{
use serde::{Deserialize, Serialize};
use tracing::{error, info};

use creds_lib::{
use credentialsd_common::{
client::FlowController,
model::{
BackgroundEvent, Credential, Device, Error, HybridState, Operation, Transport, UsbState,
Expand Down
6 changes: 3 additions & 3 deletions creds-ui/src/main.rs → credentialsd-ui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async fn run() -> Result<(), Box<dyn Error>> {
// this allows the D-Bus service to signal to the GUI to draw a window for
// executing the credential flow.
let conn = zbus::connection::Builder::session()?
.name("xyz.iinuwa.credentials.UiControl")?
.name("xyz.iinuwa.credentialsd.UiControl")?
.build()
.await?;
let cred_client = DbusCredentialClient::new(conn);
Expand All @@ -29,8 +29,8 @@ async fn run() -> Result<(), Box<dyn Error>> {

print!("Starting UI Control listener...\t");
let interface = UiControlService { request_tx };
let path = "/xyz/iinuwa/credentials/UiControl";
let service = "xyz.iinuwa.credentials.UiControl";
let path = "/xyz/iinuwa/credentialsd/UiControl";
let service = "xyz.iinuwa.credentialsd.UiControl";
let _server_conn = zbus::connection::Builder::session()?
.name(service)?
.serve_at(path, interface)?
Expand Down
File renamed without changes.
File renamed without changes.
24 changes: 12 additions & 12 deletions credsd/Cargo.lock → credentialsd/Cargo.lock

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

4 changes: 2 additions & 2 deletions credsd/Cargo.toml → credentialsd/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "credsd"
name = "credentialsd"
version = "0.1.0"
authors = ["Isaiah Inuwa <isaiah.inuwa@gmail.com>", "Martin Sirringhaus <martin.sirringhaus@suse.com>", "Alfie Fresta <alfie.fresta@gmail.com>"]
edition = "2021"
Expand All @@ -12,7 +12,7 @@ lto = true
async-stream = "0.3.6"
async-trait = "0.1.88"
base64 = "0.22.1"
creds-lib = { path = "../creds-lib" }
credentialsd-common = { path = "../credentialsd-common" }
futures-lite = "2.6.0"
libwebauthn = "~0.2.2"
openssl = "0.10.72"
Expand Down
4 changes: 2 additions & 2 deletions credsd/meson.build → credentialsd/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
backend_executable_name = 'credsd'
backend_executable_name = 'credentialsd'
backend_build_dir = meson.current_build_dir()
base_id = 'xyz.iinuwa.CredentialManagerUi'
base_id = 'xyz.iinuwa.credentialsd.Credentialsd'

dependency('dbus-1', version: '>= 1.6')
dependency('glib-2.0', version: '>= 2.66')
Expand Down
File renamed without changes.
File renamed without changes.
Loading
Loading