Skip to content

Commit a647888

Browse files
authored
Merge pull request #62 from linux-credentials/dbus-service
Split UI into separate process
2 parents 0eae5fb + d591301 commit a647888

82 files changed

Lines changed: 11798 additions & 2150 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: meson test --interactive
3838
working-directory: build/
3939
- name: Check clippy recommendations
40-
run: env CARGO_HOME=build/cargo-home cargo clippy --manifest-path xyz-iinuwa-credential-manager-portal-gtk/Cargo.toml --target-dir build/xyz-iinuwa-credential-manager-portal-gtk/src
40+
run: env CARGO_HOME=build/cargo-home cargo clippy --manifest-path credsd/Cargo.toml --target-dir build/credsd/target/release
4141
- name: Check formatting
4242
run: cargo fmt --check
43-
working-directory: xyz-iinuwa-credential-manager-portal-gtk
43+
working-directory: credsd

.vscode/launch.json

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,35 @@
77
{
88
"type": "lldb",
99
"request": "launch",
10-
"name": "Debug executable 'xicm-portal-gtk'",
11-
"program": "${workspaceFolder}/build/xyz-iinuwa-credential-manager-portal-gtk/src/xyz-iinuwa-credential-manager-portal-gtk",
10+
"name": "Debug Daemon (credsd)",
11+
"program": "${workspaceFolder}/build/credsd/src/credsd",
1212
"args": [],
1313
"env": {
14-
"GSETTINGS_SCHEMA_DIR": "${workspaceFolder}/build/xyz-iinuwa-credential-manager-portal-gtk/data",
15-
"RUST_LOG": "xyz_iinuwa_credential_manager_portal_gtk=debug,libwebauthn=debug,libwebauthn::webauthn=debug,libwebauthn=warn,libwebauthn::proto::ctap2::preflight=debug,libwebauthn::transport::channel=debug"
14+
"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"
1615
},
1716
"sourceLanguages": ["rust"],
1817
"cwd": "${workspaceFolder}",
19-
"preLaunchTask": "Meson: Build all targets"
18+
"preLaunchTask": "Meson: Build Daemon"
2019
},
20+
{
21+
"type": "lldb",
22+
"request": "launch",
23+
"name": "Debug UI (creds-ui)",
24+
"program": "${workspaceFolder}/build/creds-ui/src/creds-ui",
25+
"args": [],
26+
"env": {
27+
"GSETTINGS_SCHEMA_DIR": "${workspaceFolder}/build/creds-ui/data",
28+
"RUST_LOG": "creds_ui=debug,zbus::trace,zbus::object_server::debug"
29+
},
30+
"sourceLanguages": ["rust"],
31+
"cwd": "${workspaceFolder}",
32+
"preLaunchTask": "Meson: Build UI"
33+
},
34+
],
35+
"compounds": [
36+
{
37+
"name": "Server/Client",
38+
"configurations": ["Debug UI (creds-ui)", "Debug Daemon (credsd)"]
39+
}
2140
]
2241
}

README.md

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@
99
This project uses Meson and Ninja.
1010

1111
Package requirements:
12-
- GTK4
13-
- gettext
14-
- libdbus-1
15-
- libssl/openssl
16-
- libudev
17-
- desktop-file-utils
12+
13+
- GTK4
14+
- gettext
15+
- libdbus-1
16+
- libssl/openssl
17+
- libudev
18+
- desktop-file-utils
1819

1920
For example, on Ubuntu:
21+
2022
```shell
2123
sudo apt update && sudo apt install \
2224
# Build dependencies
@@ -42,9 +44,10 @@ ninja -C build
4244

4345
```shell
4446
# Run the server, with debug logging enabled
45-
export GSETTINGS_SCHEMA_DIR=build/xyz-iinuwa-credential-manager-portal-gtk/data
46-
export RUST_LOG=xyz_iinuwa_credential_manager_portal_gtk=debug
47-
./build/xyz-iinuwa-credential-manager-portal-gtk/src/xyz-iinuwa-credential-manager-portal-gtk
47+
export GSETTINGS_SCHEMA_DIR=build/creds-ui/data
48+
export RUST_LOG=credsd=debug,creds_ui=debug
49+
./build/credsd/target/debug/credsd &
50+
./build/creds-ui/target/debug/creds-ui
4851
```
4952

5053
### Clients
@@ -59,7 +62,6 @@ cd demo_client/
5962

6063
There is also a demo web extension that can be used to test the service in Firefox. Instructions are in [webext/README.md]().
6164

62-
6365
## Goals
6466

6567
The goal of this repository is to define a spec for clients (apps, browsers,
@@ -77,37 +79,39 @@ Some high-level goals:
7779
etc.) to hook into
7880

7981
Some nice-to-haves:
82+
8083
- Design a specification for a platform authenticator. I'm not sure whether this
81-
needs to be specified, or whether it could be considered and implemented as a
82-
first-party credential provider.
84+
needs to be specified, or whether it could be considered and implemented as a
85+
first-party credential provider.
8386

8487
Some non-goals:
8588

86-
- Fully implement the proposed specification. This repo is focused on defining
87-
the D-Bus API for clients and portal frontend/backend implementations to use.
88-
Though I would love to help implement, I don't think I will have the time to
89-
fully implement the features specced by the API, so I welcome collaboration
90-
from others to help implement. For now, any implementation in this repository
91-
is for reference purposes.
89+
- Fully integrate with any specific desktop environment. Each desktop
90+
environment (GNOME, KDE, etc.) has its own UI and UX conventions, as well as
91+
system configuration methods (e.g., GNOME Settings), which this API will need to integrate with.
92+
Because of the variation, we intend to leave integration with these other
93+
components to developers more familiar with each of the desktop environments.
94+
For now, we are using bare GTK to build a UI for testing, but any UI
95+
implementation in this repository is for reference purposes. If anyone is willing to do some of this integration work, feel free to contact us!
9296

9397
- Create a full-featured password manager. Features like Password syncing,
94-
password generation, rotation, etc. is not part of this specficiation. Other
95-
password manager projects should be able to use this to make their credentials
96-
available to the user uniformly, though.
98+
password generation, rotation, etc. is not part of this specficiation. Other
99+
password manager projects should be able to use this to make their credentials
100+
available to the user uniformly, though.
97101

98-
- BSD support. While I'd love to help out all open desktop environments, I don't
99-
know enough about any BSD to make it useful for them. Hopefully, the design
100-
process is transparent enough that someone else could design something that
101-
works for BSDs.
102+
- BSD support. While we'd love to help out all open desktop environments, we don't
103+
know enough about any BSD to make it useful for them. Hopefully, the design
104+
process is transparent enough that someone else could design something that
105+
works for BSDs.
102106

103107
## Current Work
104108

105109
- April 2025: Added web extension for testing in Firefox.
106110
- March 2025: Integrated libwebauthn to support USB authenticators.
107111
- May 2024: Met with developers in GNOME and systemd to design internals for
108112
securely storing device credentials.
109-
- Jan 2024: I've defined the [scenarios](doc/scenarios.md) that I expect this
110-
API to cover. I am working on extracting [API methods](doc/api.md) required to
113+
- Jan 2024: Defined the [scenarios](doc/scenarios.md) that we expect this
114+
API to cover. We are working on extracting [API methods](doc/api.md) required to
111115
implement the interactions between the client, portal frontend, portal backend,
112116
machine and mobile devices. Once that is done, I intend to convert the API into
113117
a [portal spec](doc/design-doc.md), making it fit normal D-Bus/portal patterns.
@@ -141,9 +145,8 @@ Alternatively, lock out the credential based on incorrect attempts.
141145
![](images/security-key-3.png)
142146
![](images/end.png)
143147

144-
145-
146148
## Related projects:
149+
147150
- https://github.com/linux-credentials/libwebauthn (previously https://github.com/AlfioEmanueleFresta/xdg-credentials-portal)
148151
- authenticator-rs
149152
- webauthn-rs

contrib/xyz.iinuwa.credentials.CredentialManager.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<arg type="s" direction="out"/>
88
</method>
99
</interface>
10-
<interface name="xyz.iinuwa.credentials.CredentialManagerUi1">
10+
<interface name="xyz.iinuwa.credentials.Credentials1">
1111
<method name="CreateCredential">
1212
<arg name="request" type="a{sv}" direction="in"/>
1313
<arg type="a{sv}" direction="out"/>

0 commit comments

Comments
 (0)