Skip to content

Commit ae00a6f

Browse files
committed
Merge pull request #105 from msirringhaus/ui_more_request_context
2 parents b96de61 + 279a5a2 commit ae00a6f

File tree

14 files changed

+500
-127
lines changed

14 files changed

+500
-127
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(Debug, Clone, 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: 3 additions & 1 deletion
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],
@@ -617,6 +617,8 @@ where
617617
pub struct ViewRequest {
618618
pub operation: Operation,
619619
pub id: RequestId,
620+
pub rp_id: String,
621+
pub requesting_app: RequestingApplication,
620622
}
621623

622624
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: 29 additions & 2 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

@@ -51,7 +76,8 @@
5176
</child>
5277
<child>
5378
<object class="GtkScrolledWindow">
54-
<property name="min-content-height">256</property>
79+
<property name="vexpand">true</property>
80+
<property name="max-content-height">256</property>
5581
<binding name="child">
5682
<lookup name="devices">
5783
<lookup name="view-model">
@@ -166,7 +192,8 @@
166192
</child>
167193
<child>
168194
<object class="GtkScrolledWindow">
169-
<property name="min-content-height">256</property>
195+
<property name="vexpand">true</property>
196+
<property name="max-content-height">256</property>
170197
<binding name="child">
171198
<lookup name="credentials">
172199
<lookup name="view-model">

credentialsd-ui/po/credentialsd-ui.pot

Lines changed: 57 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ msgstr ""
2121

2222
#: data/xyz.iinuwa.credentialsd.CredentialsUi.desktop.in.in:2
2323
#: data/xyz.iinuwa.credentialsd.CredentialsUi.metainfo.xml.in.in:8
24-
#: src/gui/view_model/gtk/mod.rs:377
24+
#: src/gui/view_model/gtk/mod.rs:380
2525
msgid "Credential Manager"
2626
msgstr ""
2727

@@ -85,89 +85,84 @@ msgstr ""
8585
msgid "_Keyboard Shortcuts"
8686
msgstr ""
8787

88-
#: data/resources/ui/window.ui:43
88+
#: data/resources/ui/window.ui:68
8989
msgid "Choose device"
9090
msgstr ""
9191

92-
#: data/resources/ui/window.ui:49
92+
#: data/resources/ui/window.ui:74
9393
msgid "Devices"
9494
msgstr ""
9595

96-
#: data/resources/ui/window.ui:72
96+
#: data/resources/ui/window.ui:98
9797
msgid "Connect a security key"
9898
msgstr ""
9999

100-
#: data/resources/ui/window.ui:113
100+
#: data/resources/ui/window.ui:138
101101
msgid "Scan the QR code to connect your device"
102102
msgstr ""
103103

104-
#: data/resources/ui/window.ui:158 data/resources/ui/window.ui:164
104+
#: data/resources/ui/window.ui:183 data/resources/ui/window.ui:189
105105
msgid "Choose credential"
106106
msgstr ""
107107

108-
#: data/resources/ui/window.ui:187
108+
#: data/resources/ui/window.ui:212
109109
msgid "Complete"
110110
msgstr ""
111111

112-
#: data/resources/ui/window.ui:193
112+
#: data/resources/ui/window.ui:218
113113
msgid "Done!"
114114
msgstr ""
115115

116-
#: data/resources/ui/window.ui:204
116+
#: data/resources/ui/window.ui:229
117117
msgid "Something went wrong."
118118
msgstr ""
119119

120-
#: data/resources/ui/window.ui:217 src/gui/view_model/mod.rs:240
120+
#: data/resources/ui/window.ui:242 src/gui/view_model/mod.rs:244
121121
msgid ""
122122
"Something went wrong while retrieving a credential. Please try again later "
123123
"or use a different authenticator."
124124
msgstr ""
125125

126-
#: src/gui/view_model/gtk/mod.rs:140
127-
#, c-format
126+
#: src/gui/view_model/gtk/mod.rs:146
128127
msgid "Enter your PIN. One attempt remaining."
129128
msgid_plural "Enter your PIN. %d attempts remaining."
130129
msgstr[0] ""
131130
msgstr[1] ""
132131

133-
#: src/gui/view_model/gtk/mod.rs:146
132+
#: src/gui/view_model/gtk/mod.rs:152
134133
msgid "Enter your PIN."
135134
msgstr ""
136135

137-
#: src/gui/view_model/gtk/mod.rs:156
138-
#, c-format
136+
#: src/gui/view_model/gtk/mod.rs:162
139137
msgid "Touch your device again. One attempt remaining."
140138
msgid_plural "Touch your device again. %d attempts remaining."
141139
msgstr[0] ""
142140
msgstr[1] ""
143141

144-
#: src/gui/view_model/gtk/mod.rs:162
145-
msgid "Touch your device."
146-
msgstr ""
147-
148-
#: src/gui/view_model/gtk/mod.rs:167
142+
#: src/gui/view_model/gtk/mod.rs:168
143+
#: src/gui/view_model/gtk/mod.rs:173
149144
msgid "Touch your device"
150145
msgstr ""
151146

152-
#: src/gui/view_model/gtk/mod.rs:170
147+
#: src/gui/view_model/gtk/mod.rs:176
153148
msgid "Scan the QR code with your device to begin authentication."
154149
msgstr ""
155150

156-
#: src/gui/view_model/gtk/mod.rs:180
151+
#: src/gui/view_model/gtk/mod.rs:186
157152
msgid ""
158153
"Connecting to your device. Make sure both devices are near each other and "
159154
"have Bluetooth enabled."
160155
msgstr ""
161156

162-
#: src/gui/view_model/gtk/mod.rs:188
157+
#: src/gui/view_model/gtk/mod.rs:194
163158
msgid "Device connected. Follow the instructions on your device"
164159
msgstr ""
165160

166-
#: src/gui/view_model/gtk/mod.rs:314
161+
#: src/gui/view_model/gtk/mod.rs:320
167162
msgid "Insert your security key."
168163
msgstr ""
169164

170-
#: src/gui/view_model/gtk/mod.rs:333
165+
#: src/gui/view_model/gtk/mod.rs:339
171166
msgid "Multiple devices found. Please select with which to proceed."
172167
msgstr ""
173168

@@ -195,32 +190,60 @@ msgstr ""
195190
msgid "A security key (USB)"
196191
msgstr ""
197192

198-
#: src/gui/view_model/mod.rs:65
199-
msgid "Create new credential"
193+
#: src/gui/view_model/mod.rs:75
194+
msgid "unknown application"
195+
msgstr ""
196+
197+
#. TRANSLATORS: %s1 is the "relying party" (think: domain name) where the request is coming from
198+
#: src/gui/view_model/mod.rs:80
199+
msgid "Create a passkey for %s1"
200+
msgstr ""
201+
202+
#. TRANSLATORS: %s1 is the "relying party" (think: domain name) where the request is coming from
203+
#: src/gui/view_model/mod.rs:84
204+
msgid "Use a passkey for %s1"
200205
msgstr ""
201206

202-
#: src/gui/view_model/mod.rs:66
203-
msgid "Use a credential"
207+
#. TRANSLATORS: %s1 is the "relying party" (e.g.: domain name) where the request is coming from
208+
#. 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
209+
#. TRANSLATORS: %i1 is the process ID of the requesting application
210+
#. TRANSLATORS: %s3 is the absolute path (think: /usr/bin/firefox) of the requesting application
211+
#: src/gui/view_model/mod.rs:96
212+
msgid ""
213+
"<b>\"%s2\"</b> (process ID: %i1, binary: %s3) is asking to create a "
214+
"credential to sign in to \"%s1\". Only proceed if you trust this process."
215+
msgstr ""
216+
217+
#. TRANSLATORS: %s1 is the "relying party" (think: domain name) where the request is coming from
218+
#. 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
219+
#. TRANSLATORS: %i1 is the process ID of the requesting application
220+
#. TRANSLATORS: %s3 is the absolute path (think: /usr/bin/firefox) of the requesting application
221+
#: src/gui/view_model/mod.rs:103
222+
msgid ""
223+
"<b>\"%s2\"</b> (process ID: %i1, binary: %s3) is asking to use a credential "
224+
"to sign in to \"%s1\". Only proceed if you trust this process."
204225
msgstr ""
205226

206-
#: src/gui/view_model/mod.rs:180
227+
#: src/gui/view_model/mod.rs:224
207228
msgid "Failed to select credential from device."
208229
msgstr ""
209230

210-
#: src/gui/view_model/mod.rs:234
231+
#: src/gui/view_model/mod.rs:281
232+
#: src/gui/view_model/mod.rs:332
211233
msgid "No matching credentials found on this authenticator."
212234
msgstr ""
213235

214-
#: src/gui/view_model/mod.rs:237
236+
#: src/gui/view_model/mod.rs:284
237+
#: src/gui/view_model/mod.rs:335
215238
msgid ""
216239
"No more PIN attempts allowed. Try removing your device and plugging it back "
217240
"in."
218241
msgstr ""
219242

220-
#: src/gui/view_model/mod.rs:243
243+
#: src/gui/view_model/mod.rs:290
221244
msgid "This credential is already registered on this authenticator."
222245
msgstr ""
223246

224-
#: src/gui/view_model/mod.rs:342
247+
#: src/gui/view_model/mod.rs:389
225248
msgid "Something went wrong. Try again later or use a different authenticator."
226249
msgstr ""

0 commit comments

Comments
 (0)