Skip to content

Commit 9945cd6

Browse files
committed
Add PID and binary path to the GUI and reformat it a bit.
1 parent 69dd579 commit 9945cd6

File tree

13 files changed

+298
-134
lines changed

13 files changed

+298
-134
lines changed

credentialsd-common/src/model.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::fmt::Display;
1+
use std::{fmt::Display, path::PathBuf};
22

33
use serde::{Deserialize, Serialize};
44
use zvariant::{SerializeDict, Type};
@@ -170,9 +170,22 @@ impl Transport {
170170
}
171171
}
172172

173+
#[derive(Debug, Default, Clone, Serialize, Deserialize, Type)]
174+
pub struct RequestingApplication {
175+
pub name: String,
176+
pub path: PathBuf,
177+
pub pid: u32,
178+
}
179+
180+
#[derive(Debug, Default, Clone, Serialize, Deserialize, Type)]
181+
pub struct RequestingParty {
182+
pub rp_id: String,
183+
pub origin: String,
184+
}
185+
173186
#[derive(Serialize, Deserialize)]
174187
pub enum ViewUpdate {
175-
SetTitle(String),
188+
SetTitle((String, String)),
176189
SetDevices(Vec<Device>),
177190
SetCredentials(Vec<Credential>),
178191

credentialsd-common/src/server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use zvariant::{
99
Signature, Structure, StructureBuilder, Type, Value, signature::Fields,
1010
};
1111

12-
use crate::model::{BackgroundEvent, Operation};
12+
use crate::model::{BackgroundEvent, Operation, RequestingApplication};
1313

1414
const TAG_VALUE_SIGNATURE: &Signature = &Signature::Structure(Fields::Static {
1515
fields: &[&Signature::U8, &Signature::Variant],
@@ -485,7 +485,7 @@ pub struct ViewRequest {
485485
pub operation: Operation,
486486
pub id: RequestId,
487487
pub rp_id: String,
488-
pub requesting_app: String,
488+
pub requesting_app: RequestingApplication,
489489
}
490490

491491
fn value_to_owned(value: &Value<'_>) -> OwnedValue {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.title-header{
2-
font-size: 36px;
2+
font-size: 24px;
33
font-weight: bold;
44
}

credentialsd-ui/data/resources/ui/window.ui

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<child>
2121
<object class="GtkBox">
2222
<property name="orientation">vertical</property>
23+
<property name="spacing">10</property>
2324
<child>
2425
<object class="GtkLabel">
2526
<binding name="label">
@@ -34,6 +35,30 @@
3435
</style>
3536
</object>
3637
</child>
38+
<child>
39+
<object class="GtkSeparator"></object>
40+
</child>
41+
<child>
42+
<object class="GtkLabel">
43+
<property name="wrap">true</property>
44+
<property name="use-markup">true</property>
45+
<binding name="label">
46+
<lookup name="subtitle">
47+
<lookup name="view-model">
48+
CredentialsUiWindow
49+
</lookup>
50+
</lookup>
51+
</binding>
52+
<style>
53+
<class name="subtitle-header"/>
54+
</style>
55+
</object>
56+
</child>
57+
58+
<child>
59+
<object class="GtkSeparator"></object>
60+
</child>
61+
3762
<child>
3863
<object class="GtkStack" id="stack">
3964

credentialsd-ui/po/credentialsd-ui.pot

Lines changed: 53 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ msgstr ""
33
"Project-Id-Version: credentialsd-ui\n"
44
"Report-Msgid-Bugs-To: \"https://github.com/linux-credentials/credentialsd/"
55
"issues\"\n"
6-
"POT-Creation-Date: 2025-10-29 13:04+0100\n"
6+
"POT-Creation-Date: 2025-10-30 14:43+0100\n"
77
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
88
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
99
"Language: \n"
@@ -16,7 +16,7 @@ msgstr ""
1616
#. <project_license>LGPL-3.0-only</project_license>
1717
#: data/xyz.iinuwa.credentialsd.CredentialsUi.desktop.in.in:2
1818
#: data/xyz.iinuwa.credentialsd.CredentialsUi.metainfo.xml.in.in:8
19-
#: src/gui/view_model/gtk/mod.rs:372
19+
#: src/gui/view_model/gtk/mod.rs:378
2020
msgid "Credential Manager"
2121
msgstr ""
2222

@@ -79,87 +79,87 @@ msgstr ""
7979
msgid "_Keyboard Shortcuts"
8080
msgstr ""
8181

82-
#: data/resources/ui/window.ui:43
82+
#: data/resources/ui/window.ui:68
8383
msgid "Choose device"
8484
msgstr ""
8585

86-
#: data/resources/ui/window.ui:49
86+
#: data/resources/ui/window.ui:74
8787
msgid "Devices"
8888
msgstr ""
8989

90-
#: data/resources/ui/window.ui:72
90+
#: data/resources/ui/window.ui:97
9191
msgid "Plug in security key"
9292
msgstr ""
9393

94-
#: data/resources/ui/window.ui:113
94+
#: data/resources/ui/window.ui:138
9595
msgid "Scan the QR code to connect your device"
9696
msgstr ""
9797

98-
#: data/resources/ui/window.ui:158 data/resources/ui/window.ui:164
98+
#: data/resources/ui/window.ui:183 data/resources/ui/window.ui:189
9999
msgid "Choose credential"
100100
msgstr ""
101101

102-
#: data/resources/ui/window.ui:187
102+
#: data/resources/ui/window.ui:212
103103
msgid "Complete"
104104
msgstr ""
105105

106-
#: data/resources/ui/window.ui:193
106+
#: data/resources/ui/window.ui:218
107107
msgid "Done!"
108108
msgstr ""
109109

110-
#: data/resources/ui/window.ui:204
110+
#: data/resources/ui/window.ui:229
111111
msgid "Something went wrong."
112112
msgstr ""
113113

114-
#: data/resources/ui/window.ui:217 src/gui/view_model/mod.rs:247
114+
#: data/resources/ui/window.ui:242 src/gui/view_model/mod.rs:280
115115
msgid ""
116116
"Something went wrong while retrieving a credential. Please try again later "
117117
"or use a different authenticator."
118118
msgstr ""
119119

120-
#: src/gui/view_model/gtk/mod.rs:139
120+
#: src/gui/view_model/gtk/mod.rs:145
121121
msgid "Enter your PIN. One attempt remaining."
122122
msgid_plural "Enter your PIN. %d attempts remaining."
123123
msgstr[0] ""
124124
msgstr[1] ""
125125

126-
#: src/gui/view_model/gtk/mod.rs:145
126+
#: src/gui/view_model/gtk/mod.rs:151
127127
msgid "Enter your PIN."
128128
msgstr ""
129129

130-
#: src/gui/view_model/gtk/mod.rs:154
130+
#: src/gui/view_model/gtk/mod.rs:160
131131
msgid "Touch your device again. One attempt remaining."
132132
msgid_plural "Touch your device again. %d attempts remaining."
133133
msgstr[0] ""
134134
msgstr[1] ""
135135

136-
#: src/gui/view_model/gtk/mod.rs:160
136+
#: src/gui/view_model/gtk/mod.rs:166
137137
msgid "Touch your device."
138138
msgstr ""
139139

140-
#: src/gui/view_model/gtk/mod.rs:165
140+
#: src/gui/view_model/gtk/mod.rs:171
141141
msgid "Touch your device"
142142
msgstr ""
143143

144-
#: src/gui/view_model/gtk/mod.rs:168
144+
#: src/gui/view_model/gtk/mod.rs:174
145145
msgid "Scan the QR code with your device to begin authentication."
146146
msgstr ""
147147

148-
#: src/gui/view_model/gtk/mod.rs:178
148+
#: src/gui/view_model/gtk/mod.rs:184
149149
msgid ""
150150
"Connecting to your device. Make sure both devices are near each other and "
151151
"have Bluetooth enabled."
152152
msgstr ""
153153

154-
#: src/gui/view_model/gtk/mod.rs:186
154+
#: src/gui/view_model/gtk/mod.rs:192
155155
msgid "Device connected. Follow the instructions on your device"
156156
msgstr ""
157157

158-
#: src/gui/view_model/gtk/mod.rs:312
158+
#: src/gui/view_model/gtk/mod.rs:318
159159
msgid "Insert your security key."
160160
msgstr ""
161161

162-
#: src/gui/view_model/gtk/mod.rs:328
162+
#: src/gui/view_model/gtk/mod.rs:334
163163
msgid "Multiple devices found. Please select with which to proceed."
164164
msgstr ""
165165

@@ -187,36 +187,58 @@ msgstr ""
187187
msgid "A security key"
188188
msgstr ""
189189

190-
#: src/gui/view_model/mod.rs:70
190+
#: src/gui/view_model/mod.rs:75
191191
msgid "unknown application"
192192
msgstr ""
193193

194-
#: src/gui/view_model/mod.rs:75
195-
msgid "Create a new credential for %s1 via %s2"
194+
#. TRANSLATORS: %s1 is the "relying party" (think: domain name) where the request is coming from
195+
#: src/gui/view_model/mod.rs:80
196+
msgid "Create a passkey for %s1"
196197
msgstr ""
197198

198-
#: src/gui/view_model/mod.rs:76
199-
msgid "Use a credential on %s1 via %s2"
199+
#. TRANSLATORS: %s1 is the "relying party" (think: domain name) where the request is coming from
200+
#: src/gui/view_model/mod.rs:84
201+
msgid "Use a passkey for %s1"
202+
msgstr ""
203+
204+
#. TRANSLATORS: %s1 is the "relying party" (e.g.: domain name) where the request is coming from
205+
#. TRANSLATORS: %s2 is the application name (e.g.: firefox) where the request is coming from, <b></b> must be left untouched to make the name bold
206+
#. TRANSLATORS: %i1 is the process ID of the requesting application
207+
#. TRANSLATORS: %s3 is the absolute path (think: /usr/bin/firefox) of the requesting application
208+
#: src/gui/view_model/mod.rs:96
209+
msgid ""
210+
"<b>\"%s2\"</b> (process ID: %i1, binary: %s3) is asking to create a "
211+
"credential to sign in to \"%s1\". Only proceed if you trust this process."
212+
msgstr ""
213+
214+
#. TRANSLATORS: %s1 is the "relying party" (think: domain name) where the request is coming from
215+
#. TRANSLATORS: %s2 is the application name (e.g.: firefox) where the request is coming from, <b></b> must be left untouched to make the name bold
216+
#. TRANSLATORS: %i1 is the process ID of the requesting application
217+
#. TRANSLATORS: %s3 is the absolute path (think: /usr/bin/firefox) of the requesting application
218+
#: src/gui/view_model/mod.rs:103
219+
msgid ""
220+
"<b>\"%s2\"</b> (process ID: %i1, binary: %s3) is asking to use a credential "
221+
"to sign in to \"%s1\". Only proceed if you trust this process."
200222
msgstr ""
201223

202-
#: src/gui/view_model/mod.rs:187
224+
#: src/gui/view_model/mod.rs:220
203225
msgid "Failed to select credential from device."
204226
msgstr ""
205227

206-
#: src/gui/view_model/mod.rs:241
228+
#: src/gui/view_model/mod.rs:274
207229
msgid "No matching credentials found on this authenticator."
208230
msgstr ""
209231

210-
#: src/gui/view_model/mod.rs:244
232+
#: src/gui/view_model/mod.rs:277
211233
msgid ""
212234
"No more PIN attempts allowed. Try removing your device and plugging it back "
213235
"in."
214236
msgstr ""
215237

216-
#: src/gui/view_model/mod.rs:250
238+
#: src/gui/view_model/mod.rs:283
217239
msgid "This credential is already registered on this authenticator."
218240
msgstr ""
219241

220-
#: src/gui/view_model/mod.rs:298
242+
#: src/gui/view_model/mod.rs:331
221243
msgid "Something went wrong. Try again later or use a different authenticator."
222244
msgstr ""

0 commit comments

Comments
 (0)