@lumiapassport/ui-kit 1.4.17 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/iframe/_headers +3 -2
- package/dist/iframe/index.html +226 -68
- package/dist/iframe/lumia-logo.svg +1 -0
- package/dist/iframe/main.js +113 -25
- package/dist/iframe/main.js.map +1 -1
- package/dist/index.cjs +948 -938
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +947 -937
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/iframe/_headers
CHANGED
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
# Content Security Policy - Strict security policy for iframe
|
|
6
6
|
# IMPORTANT: frame-ancestors 'https:' allows embedding on any HTTPS site
|
|
7
7
|
# Domain validation is performed via projectId check in JavaScript
|
|
8
|
-
# connect-src whitelist: only allowed TSS servers (where the second key share is stored)
|
|
9
|
-
|
|
8
|
+
# connect-src whitelist: only allowed TSS servers (where the second key share is stored) and lumiapassport.com subdomains
|
|
9
|
+
# NOTE: http://localhost:* in frame-ancestors is for development testing only
|
|
10
|
+
Content-Security-Policy: default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https: blob:; font-src 'self'; connect-src 'self' https://*.lumiapassport.com; frame-ancestors https: http://localhost:*; base-uri 'self'; form-action 'self';
|
|
10
11
|
|
|
11
12
|
# Allow iframe embedding from HTTPS sites (domain validation in JS)
|
|
12
13
|
# X-Frame-Options is NOT set (CSP frame-ancestors takes precedence)
|
package/dist/iframe/index.html
CHANGED
|
@@ -7,17 +7,29 @@
|
|
|
7
7
|
<!-- Security Headers -->
|
|
8
8
|
<!-- NOTE: These are fallback headers for development. Production uses _headers file from Cloudflare -->
|
|
9
9
|
<!-- WARNING: frame-ancestors MUST be set via HTTP headers, not meta tags (it's ignored in meta) -->
|
|
10
|
+
<!-- WARNING: localhost is allowed ONLY for local development, production CSP in _headers is stricter -->
|
|
10
11
|
<meta
|
|
11
12
|
http-equiv="Content-Security-Policy"
|
|
12
|
-
content="default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self'; connect-src 'self' http://localhost:* https
|
|
13
|
+
content="default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https: blob:; font-src 'self'; connect-src 'self' http://localhost:* https://*.lumiapassport.com; base-uri 'self'; form-action 'self';"
|
|
13
14
|
/>
|
|
14
15
|
<meta http-equiv="X-Content-Type-Options" content="nosniff" />
|
|
15
16
|
<meta http-equiv="Referrer-Policy" content="strict-origin-when-cross-origin" />
|
|
16
17
|
|
|
17
|
-
<title>Lumia Passport Secure Wallet - iframe version 1.
|
|
18
|
+
<title>Lumia Passport Secure Wallet - iframe version 1.5.1</title>
|
|
18
19
|
|
|
19
20
|
<!-- Styles will be injected by build process -->
|
|
20
21
|
<style>
|
|
22
|
+
:root {
|
|
23
|
+
/* Default theme colors (can be overridden via URL params) */
|
|
24
|
+
--iframe-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
25
|
+
--iframe-text: #333;
|
|
26
|
+
--iframe-text-secondary: #666;
|
|
27
|
+
--iframe-border: #e0e0e0;
|
|
28
|
+
--iframe-modal-bg: white;
|
|
29
|
+
--iframe-button-bg: #667eea;
|
|
30
|
+
--iframe-button-text: white;
|
|
31
|
+
}
|
|
32
|
+
|
|
21
33
|
* {
|
|
22
34
|
margin: 0;
|
|
23
35
|
padding: 0;
|
|
@@ -26,8 +38,8 @@
|
|
|
26
38
|
|
|
27
39
|
body {
|
|
28
40
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
|
|
29
|
-
background:
|
|
30
|
-
color:
|
|
41
|
+
background: var(--iframe-bg);
|
|
42
|
+
color: var(--iframe-text);
|
|
31
43
|
min-height: 100vh;
|
|
32
44
|
display: flex;
|
|
33
45
|
align-items: center;
|
|
@@ -45,7 +57,7 @@
|
|
|
45
57
|
/* Ready Indicator */
|
|
46
58
|
.ready-indicator {
|
|
47
59
|
text-align: center;
|
|
48
|
-
background:
|
|
60
|
+
background: var(--iframe-modal-bg);
|
|
49
61
|
padding: 3rem;
|
|
50
62
|
border-radius: 16px;
|
|
51
63
|
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
|
|
@@ -60,11 +72,11 @@
|
|
|
60
72
|
.ready-indicator h2 {
|
|
61
73
|
font-size: 1.5rem;
|
|
62
74
|
margin-bottom: 0.5rem;
|
|
63
|
-
color:
|
|
75
|
+
color: var(--iframe-text);
|
|
64
76
|
}
|
|
65
77
|
|
|
66
78
|
.ready-indicator p {
|
|
67
|
-
color:
|
|
79
|
+
color: var(--iframe-text-secondary);
|
|
68
80
|
margin-bottom: 1.5rem;
|
|
69
81
|
}
|
|
70
82
|
|
|
@@ -164,96 +176,239 @@
|
|
|
164
176
|
}
|
|
165
177
|
|
|
166
178
|
.modal-content {
|
|
167
|
-
background:
|
|
179
|
+
background: var(--iframe-modal-bg);
|
|
168
180
|
border-radius: 12px;
|
|
169
|
-
padding:
|
|
170
|
-
max-width:
|
|
171
|
-
|
|
181
|
+
padding: 0;
|
|
182
|
+
max-width: 520px;
|
|
183
|
+
width: 90%;
|
|
184
|
+
max-height: 90vh;
|
|
172
185
|
overflow-y: auto;
|
|
173
|
-
box-shadow: 0
|
|
186
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
|
|
174
187
|
}
|
|
175
188
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
189
|
+
/* Authorization Header with Logos */
|
|
190
|
+
.auth-header {
|
|
191
|
+
padding: 1rem 1rem 0.75rem;
|
|
192
|
+
text-align: center;
|
|
193
|
+
border-bottom: 1px solid var(--iframe-border);
|
|
180
194
|
}
|
|
181
195
|
|
|
182
|
-
.
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
196
|
+
.logo-container {
|
|
197
|
+
display: flex;
|
|
198
|
+
align-items: center;
|
|
199
|
+
justify-content: center;
|
|
200
|
+
gap: 1rem;
|
|
201
|
+
margin-bottom: 0.75rem;
|
|
186
202
|
}
|
|
187
203
|
|
|
188
|
-
.app-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
border-
|
|
192
|
-
|
|
204
|
+
.app-logo {
|
|
205
|
+
width: 64px;
|
|
206
|
+
height: 64px;
|
|
207
|
+
border-radius: 12px;
|
|
208
|
+
border: 1px solid var(--iframe-border);
|
|
209
|
+
object-fit: cover;
|
|
193
210
|
}
|
|
194
211
|
|
|
195
|
-
.app-logo {
|
|
212
|
+
.app-logo-placeholder {
|
|
196
213
|
width: 64px;
|
|
197
214
|
height: 64px;
|
|
198
|
-
|
|
215
|
+
border-radius: 12px;
|
|
216
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.logo-connector {
|
|
220
|
+
color: #6b7280;
|
|
221
|
+
display: flex;
|
|
222
|
+
align-items: center;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.lumia-logo {
|
|
226
|
+
width: 48px;
|
|
227
|
+
height: 48px;
|
|
228
|
+
object-fit: contain;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/* Authorization Title */
|
|
232
|
+
.auth-title {
|
|
233
|
+
font-size: 1.5rem;
|
|
234
|
+
font-weight: 600;
|
|
235
|
+
color: var(--iframe-text);
|
|
236
|
+
margin: 0;
|
|
237
|
+
padding: 1.5rem 2rem 0;
|
|
238
|
+
text-align: center;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/* Description Section */
|
|
242
|
+
.auth-description {
|
|
243
|
+
padding: 1rem 2rem;
|
|
244
|
+
text-align: center;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.project-description {
|
|
248
|
+
font-size: 0.875rem;
|
|
249
|
+
color: var(--iframe-text-secondary);
|
|
250
|
+
margin: 0 0 0.75rem 0;
|
|
251
|
+
line-height: 1.5;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.domain-info {
|
|
255
|
+
display: inline-flex;
|
|
256
|
+
align-items: center;
|
|
257
|
+
gap: 0.5rem;
|
|
258
|
+
font-size: 0.875rem;
|
|
259
|
+
padding: 0.5rem 1rem;
|
|
260
|
+
border-radius: 6px;
|
|
261
|
+
background: #f6f8fa;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.domain-info.verified {
|
|
265
|
+
background: #dff6dd;
|
|
266
|
+
color: #1a7f37;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.domain-info.unverified {
|
|
270
|
+
background: #fff8c5;
|
|
271
|
+
color: #9a6700;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.domain-label {
|
|
275
|
+
font-weight: 500;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.domain-value {
|
|
279
|
+
font-family: monospace;
|
|
280
|
+
font-size: 0.8125rem;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* Permissions Box */
|
|
284
|
+
.permissions-box {
|
|
285
|
+
margin: 1.5rem 2rem;
|
|
286
|
+
padding: 1rem;
|
|
287
|
+
border: 1px solid #30363d;
|
|
199
288
|
border-radius: 8px;
|
|
289
|
+
background: #161b22;
|
|
200
290
|
}
|
|
201
291
|
|
|
202
|
-
.
|
|
203
|
-
font-size: 0.
|
|
204
|
-
|
|
292
|
+
.permissions-header {
|
|
293
|
+
font-size: 0.875rem;
|
|
294
|
+
color: #c9d1d9;
|
|
295
|
+
margin-bottom: 1rem;
|
|
296
|
+
line-height: 1.5;
|
|
205
297
|
}
|
|
206
298
|
|
|
207
|
-
.
|
|
208
|
-
color: #
|
|
299
|
+
.project-owner {
|
|
300
|
+
color: #8b949e;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.permission-group {
|
|
304
|
+
margin-bottom: 1rem;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.permission-group:last-child {
|
|
308
|
+
margin-bottom: 0;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.permission-group-title {
|
|
312
|
+
font-size: 0.8125rem;
|
|
313
|
+
font-weight: 600;
|
|
314
|
+
color: #c9d1d9;
|
|
315
|
+
margin-bottom: 0.5rem;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.permissions-list ul {
|
|
319
|
+
list-style: none;
|
|
320
|
+
padding: 0;
|
|
321
|
+
margin: 0;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.permissions-list li {
|
|
325
|
+
font-size: 0.8125rem;
|
|
326
|
+
color: #c9d1d9;
|
|
327
|
+
padding: 0.25rem 0;
|
|
328
|
+
padding-left: 1.25rem;
|
|
329
|
+
position: relative;
|
|
209
330
|
}
|
|
210
331
|
|
|
211
|
-
.
|
|
212
|
-
|
|
332
|
+
.permissions-list li:before {
|
|
333
|
+
content: "•";
|
|
334
|
+
position: absolute;
|
|
335
|
+
left: 0.5rem;
|
|
336
|
+
color: #8b949e;
|
|
213
337
|
}
|
|
214
338
|
|
|
339
|
+
/* Actions Section */
|
|
215
340
|
.actions {
|
|
216
341
|
display: flex;
|
|
217
|
-
gap:
|
|
218
|
-
|
|
342
|
+
gap: 0.5rem;
|
|
343
|
+
padding: 1.5rem 2rem;
|
|
344
|
+
border-top: 1px solid var(--iframe-border);
|
|
219
345
|
}
|
|
220
346
|
|
|
221
347
|
button {
|
|
222
348
|
flex: 1;
|
|
223
|
-
padding: 0.
|
|
224
|
-
border:
|
|
225
|
-
border-radius:
|
|
226
|
-
font-size:
|
|
349
|
+
padding: 0.625rem 1.25rem;
|
|
350
|
+
border: 1px solid;
|
|
351
|
+
border-radius: 6px;
|
|
352
|
+
font-size: 0.875rem;
|
|
227
353
|
cursor: pointer;
|
|
228
|
-
font-weight:
|
|
229
|
-
transition: all 0.
|
|
354
|
+
font-weight: 500;
|
|
355
|
+
transition: all 0.15s;
|
|
230
356
|
}
|
|
231
357
|
|
|
232
358
|
.cancel-btn {
|
|
233
|
-
background: #
|
|
234
|
-
color: #
|
|
359
|
+
background: #ffffff;
|
|
360
|
+
color: #24292f;
|
|
361
|
+
border-color: rgba(27, 31, 36, 0.15);
|
|
235
362
|
}
|
|
236
363
|
|
|
237
364
|
.cancel-btn:hover {
|
|
238
|
-
background: #
|
|
365
|
+
background: #f6f8fa;
|
|
366
|
+
border-color: rgba(27, 31, 36, 0.2);
|
|
239
367
|
}
|
|
240
368
|
|
|
241
369
|
.confirm-btn,
|
|
242
370
|
.authorize-btn {
|
|
243
|
-
background: #
|
|
244
|
-
color:
|
|
371
|
+
background: #2da44e;
|
|
372
|
+
color: #ffffff;
|
|
373
|
+
border-color: rgba(27, 31, 36, 0.15);
|
|
245
374
|
}
|
|
246
375
|
|
|
247
376
|
.confirm-btn:hover,
|
|
248
377
|
.authorize-btn:hover {
|
|
249
|
-
background: #
|
|
378
|
+
background: #2c974b;
|
|
250
379
|
}
|
|
251
380
|
|
|
252
381
|
button:disabled {
|
|
253
|
-
opacity: 0.
|
|
382
|
+
opacity: 0.6;
|
|
254
383
|
cursor: not-allowed;
|
|
255
384
|
}
|
|
256
385
|
|
|
386
|
+
button:disabled:hover {
|
|
387
|
+
background: #2da44e;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/* Footer */
|
|
391
|
+
.auth-footer {
|
|
392
|
+
padding: 0 2rem 2rem;
|
|
393
|
+
text-align: center;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.auth-footer p {
|
|
397
|
+
font-size: 0.75rem;
|
|
398
|
+
color: var(--iframe-text-secondary);
|
|
399
|
+
margin: 0.5rem 0;
|
|
400
|
+
line-height: 1.5;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.auth-footer strong {
|
|
404
|
+
font-weight: 600;
|
|
405
|
+
color: var(--iframe-text);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.footer-note {
|
|
409
|
+
color: #6b7280;
|
|
410
|
+
}
|
|
411
|
+
|
|
257
412
|
.tx-details {
|
|
258
413
|
background: #f9fafb;
|
|
259
414
|
border-radius: 8px;
|
|
@@ -278,18 +433,31 @@
|
|
|
278
433
|
color: #6b7280;
|
|
279
434
|
}
|
|
280
435
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
436
|
+
/* Security Warning */
|
|
437
|
+
.security-warning {
|
|
438
|
+
margin: 1rem 2rem;
|
|
284
439
|
padding: 1rem;
|
|
285
|
-
|
|
286
|
-
border
|
|
440
|
+
background: #fff8c5;
|
|
441
|
+
border: 1px solid #d29922;
|
|
442
|
+
border-radius: 6px;
|
|
443
|
+
font-size: 0.8125rem;
|
|
444
|
+
color: #9a6700;
|
|
287
445
|
}
|
|
288
446
|
|
|
289
|
-
.security-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
447
|
+
.security-warning strong {
|
|
448
|
+
display: block;
|
|
449
|
+
margin-bottom: 0.5rem;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.warning-details {
|
|
453
|
+
margin-top: 0.5rem;
|
|
454
|
+
font-family: monospace;
|
|
455
|
+
font-size: 0.75rem;
|
|
456
|
+
color: #7d5d00;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.warning-details div {
|
|
460
|
+
margin: 0.25rem 0;
|
|
293
461
|
}
|
|
294
462
|
|
|
295
463
|
.risk-warning {
|
|
@@ -313,16 +481,6 @@
|
|
|
313
481
|
border-left: 4px solid #ec4899;
|
|
314
482
|
}
|
|
315
483
|
|
|
316
|
-
.permissions-list ul {
|
|
317
|
-
list-style: none;
|
|
318
|
-
padding: 0;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
.permissions-list li {
|
|
322
|
-
padding: 0.5rem 0;
|
|
323
|
-
color: #555;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
484
|
/* Additional modal styles for transaction confirmation */
|
|
327
485
|
.app-identity .app-info h3 {
|
|
328
486
|
font-size: 1.2rem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?><svg id="CIRCLE_OUTLINE_BLACK" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><circle cx="256" cy="256" r="256" fill="#060117" stroke-width="0"/><path d="M264.13948,48.01032l63.62778,132.2788,133.95322,68.65102h-147.34854s-48.55804-10.04649-50.23246-56.93012,0-143.99971,0-143.99971Z" fill="#fefdff" stroke-width="0"/><path d="M50.27932,245.59045l132.27894-63.62734L251.20943,48.01032l-.00012,147.34824s-10.04654,48.55792-56.93019,50.23222c-46.88366,1.6743-143.9998-.00033-143.9998-.00033Z" fill="#fefdff" stroke-width="0"/><path d="M247.86056,463.98968l-63.62772-132.27875-133.95315-68.65092,147.34848-.00011s48.55802,10.04646,50.23242,56.93008c1.6744,46.88362-.00004,143.9997-.00004,143.9997Z" fill="#fefdff" stroke-width="0"/><path d="M461.72068,266.40941l-132.2789,63.62744-68.65118,133.95283.00016-147.34823s10.04655-48.55792,56.93018-50.23226c46.88364-1.67434,143.99974.00023,143.99974.00023Z" fill="#fefdff" stroke-width="0"/></svg>
|
package/dist/iframe/main.js
CHANGED
|
@@ -2921,8 +2921,27 @@ var SigningManager = class extends TokenRefreshApiClient {
|
|
|
2921
2921
|
var AuthorizationManager = class {
|
|
2922
2922
|
constructor() {
|
|
2923
2923
|
this.STORAGE_KEY_PREFIX = "auth";
|
|
2924
|
+
this.METADATA_API_URL = "https://dashboard.lumiapassport.com/api/public/project";
|
|
2924
2925
|
console.log("[iframe][Auth] Initialized");
|
|
2925
2926
|
}
|
|
2927
|
+
/**
|
|
2928
|
+
* Fetch project metadata from public API
|
|
2929
|
+
*/
|
|
2930
|
+
async fetchProjectMetadata(projectId) {
|
|
2931
|
+
try {
|
|
2932
|
+
const response = await fetch(`${this.METADATA_API_URL}/${projectId}/metadata`);
|
|
2933
|
+
if (!response.ok) {
|
|
2934
|
+
console.warn(`[iframe][Auth] Failed to fetch project metadata: ${response.status}`);
|
|
2935
|
+
return null;
|
|
2936
|
+
}
|
|
2937
|
+
const metadata = await response.json();
|
|
2938
|
+
console.log(`[iframe][Auth] Fetched metadata for project: ${metadata.name}`);
|
|
2939
|
+
return metadata;
|
|
2940
|
+
} catch (error) {
|
|
2941
|
+
console.error("[iframe][Auth] Error fetching project metadata:", error);
|
|
2942
|
+
return null;
|
|
2943
|
+
}
|
|
2944
|
+
}
|
|
2926
2945
|
/**
|
|
2927
2946
|
* Check if user has authorized a project
|
|
2928
2947
|
*/
|
|
@@ -2990,8 +3009,9 @@ var AuthorizationManager = class {
|
|
|
2990
3009
|
*/
|
|
2991
3010
|
async requestAuthorization(project, origin) {
|
|
2992
3011
|
this.showIframe();
|
|
3012
|
+
const metadata = await this.fetchProjectMetadata(project.id);
|
|
2993
3013
|
return new Promise((resolve) => {
|
|
2994
|
-
const modal = this.createAuthorizationModal(project, origin);
|
|
3014
|
+
const modal = this.createAuthorizationModal(project, origin, metadata);
|
|
2995
3015
|
const authorizeBtn = modal.querySelector(".authorize-btn");
|
|
2996
3016
|
const cancelBtn = modal.querySelector(".cancel-btn");
|
|
2997
3017
|
const cleanup = (result) => {
|
|
@@ -3039,52 +3059,91 @@ var AuthorizationManager = class {
|
|
|
3039
3059
|
/**
|
|
3040
3060
|
* Create authorization consent modal
|
|
3041
3061
|
*/
|
|
3042
|
-
createAuthorizationModal(project, origin) {
|
|
3062
|
+
createAuthorizationModal(project, origin, metadata) {
|
|
3043
3063
|
const modal = document.createElement("div");
|
|
3044
3064
|
modal.className = "authorization-modal";
|
|
3045
3065
|
const isVerifiedOrigin = project.domains.includes(origin);
|
|
3066
|
+
const displayName = metadata?.name || project.name;
|
|
3067
|
+
const displayLogo = metadata?.logo || project.logoUrl;
|
|
3068
|
+
const displayDescription = metadata?.description;
|
|
3046
3069
|
modal.innerHTML = `
|
|
3047
3070
|
<div class="modal-overlay">
|
|
3048
3071
|
<div class="modal-content">
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
<
|
|
3052
|
-
|
|
3053
|
-
|
|
3072
|
+
<!-- Header with logos -->
|
|
3073
|
+
<div class="auth-header">
|
|
3074
|
+
<div class="logo-container">
|
|
3075
|
+
${displayLogo ? `<img src="${displayLogo}" alt="${displayName}" class="app-logo" />` : '<div class="app-logo-placeholder"></div>'}
|
|
3076
|
+
<div class="logo-connector">
|
|
3077
|
+
<svg width="24" height="16" viewBox="0 0 24 16" fill="currentColor">
|
|
3078
|
+
<path d="M23.7071 8.70711C24.0976 8.31658 24.0976 7.68342 23.7071 7.29289L17.3431 0.928932C16.9526 0.538408 16.3195 0.538408 15.9289 0.928932C15.5384 1.31946 15.5384 1.95262 15.9289 2.34315L21.5858 8L15.9289 13.6569C15.5384 14.0474 15.5384 14.6805 15.9289 15.0711C16.3195 15.4616 16.9526 15.4616 17.3431 15.0711L23.7071 8.70711ZM0 9H23V7H0V9Z"/>
|
|
3079
|
+
</svg>
|
|
3080
|
+
</div>
|
|
3081
|
+
<img src="./lumia-logo.svg" alt="Lumia Passport" class="lumia-logo" />
|
|
3054
3082
|
</div>
|
|
3055
3083
|
</div>
|
|
3056
3084
|
|
|
3057
|
-
|
|
3058
|
-
|
|
3085
|
+
<!-- Authorization title -->
|
|
3086
|
+
<h2 class="auth-title">Authorize ${displayName}</h2>
|
|
3087
|
+
|
|
3088
|
+
<!-- Description section -->
|
|
3089
|
+
<div class="auth-description">
|
|
3090
|
+
${displayDescription ? `<p class="project-description">${displayDescription}</p>` : ""}
|
|
3091
|
+
<div class="domain-info ${isVerifiedOrigin ? "verified" : "unverified"}">
|
|
3092
|
+
<span class="domain-label">
|
|
3093
|
+
${isVerifiedOrigin ? "\u2713 Verified domain:" : "\u26A0\uFE0F Unverified domain:"}
|
|
3094
|
+
</span>
|
|
3095
|
+
<span class="domain-value">${origin}</span>
|
|
3096
|
+
</div>
|
|
3059
3097
|
</div>
|
|
3060
3098
|
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
<
|
|
3064
|
-
<
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3099
|
+
<!-- Permissions box -->
|
|
3100
|
+
<div class="permissions-box">
|
|
3101
|
+
<div class="permissions-header">
|
|
3102
|
+
<strong>${displayName}</strong> by <span class="project-owner">${displayName}</span> wants to access your <strong>Lumia Passport</strong> account
|
|
3103
|
+
</div>
|
|
3104
|
+
|
|
3105
|
+
<div class="permissions-list">
|
|
3106
|
+
<div class="permission-group">
|
|
3107
|
+
<div class="permission-group-title">Personal user data</div>
|
|
3108
|
+
<ul>
|
|
3109
|
+
<li>Wallet address (read-only)</li>
|
|
3110
|
+
<li>Public transaction history (read-only)</li>
|
|
3111
|
+
</ul>
|
|
3112
|
+
</div>
|
|
3113
|
+
|
|
3114
|
+
<div class="permission-group">
|
|
3115
|
+
<div class="permission-group-title">Permissions</div>
|
|
3116
|
+
<ul>
|
|
3117
|
+
<li>Request transaction signatures</li>
|
|
3118
|
+
<li>Initiate blockchain operations</li>
|
|
3119
|
+
</ul>
|
|
3120
|
+
</div>
|
|
3121
|
+
</div>
|
|
3068
3122
|
</div>
|
|
3069
3123
|
|
|
3070
3124
|
${!isVerifiedOrigin ? `
|
|
3071
3125
|
<div class="security-warning">
|
|
3072
|
-
<
|
|
3073
|
-
<
|
|
3074
|
-
|
|
3126
|
+
<strong>\u26A0\uFE0F Warning:</strong> This domain is not verified for ${displayName}
|
|
3127
|
+
<div class="warning-details">
|
|
3128
|
+
<div>Expected: ${project.domains.join(", ")}</div>
|
|
3129
|
+
<div>Actual: ${origin}</div>
|
|
3130
|
+
</div>
|
|
3075
3131
|
</div>
|
|
3076
3132
|
` : ""}
|
|
3077
3133
|
|
|
3078
|
-
|
|
3079
|
-
<p>\u26A0\uFE0F Only authorize applications you trust. You can revoke access at any time in settings.</p>
|
|
3080
|
-
</div>
|
|
3081
|
-
|
|
3134
|
+
<!-- Action buttons -->
|
|
3082
3135
|
<div class="actions">
|
|
3083
3136
|
<button class="cancel-btn">Cancel</button>
|
|
3084
3137
|
<button class="authorize-btn" ${!isVerifiedOrigin ? "disabled" : ""}>
|
|
3085
|
-
Authorize
|
|
3138
|
+
Authorize ${displayName}
|
|
3086
3139
|
</button>
|
|
3087
3140
|
</div>
|
|
3141
|
+
|
|
3142
|
+
<!-- Footer notice -->
|
|
3143
|
+
<div class="auth-footer">
|
|
3144
|
+
<p>Authorizing will redirect to <strong>${origin}</strong></p>
|
|
3145
|
+
<p class="footer-note">You can revoke access at any time in your Lumia Passport settings.</p>
|
|
3146
|
+
</div>
|
|
3088
3147
|
</div>
|
|
3089
3148
|
</div>
|
|
3090
3149
|
`;
|
|
@@ -3600,12 +3659,13 @@ var BackupManager = class {
|
|
|
3600
3659
|
};
|
|
3601
3660
|
|
|
3602
3661
|
// src/iframe/main.ts
|
|
3603
|
-
var IFRAME_VERSION = "1.
|
|
3662
|
+
var IFRAME_VERSION = "1.5.1";
|
|
3604
3663
|
var IframeWallet = class {
|
|
3605
3664
|
constructor() {
|
|
3606
3665
|
console.log("=".repeat(60));
|
|
3607
3666
|
console.log(` Lumia Passport Secure Wallet - iframe version ${IFRAME_VERSION}`);
|
|
3608
3667
|
console.log("=".repeat(60));
|
|
3668
|
+
this.applyThemeColors();
|
|
3609
3669
|
this.messenger = new SecureMessenger();
|
|
3610
3670
|
this.sessionManager = new SessionManager();
|
|
3611
3671
|
this.dkgManager = new DKGManager();
|
|
@@ -3615,6 +3675,34 @@ var IframeWallet = class {
|
|
|
3615
3675
|
this.trustedApps = new TrustedAppsManager();
|
|
3616
3676
|
this.backupManager = new BackupManager();
|
|
3617
3677
|
}
|
|
3678
|
+
applyThemeColors() {
|
|
3679
|
+
try {
|
|
3680
|
+
const params = new URLSearchParams(window.location.search);
|
|
3681
|
+
const bg = params.get("bg");
|
|
3682
|
+
const text = params.get("text");
|
|
3683
|
+
const textSec = params.get("textSec");
|
|
3684
|
+
const border = params.get("border");
|
|
3685
|
+
if (bg || text || textSec || border) {
|
|
3686
|
+
const root = document.documentElement;
|
|
3687
|
+
if (bg) {
|
|
3688
|
+
root.style.setProperty("--iframe-bg", bg);
|
|
3689
|
+
root.style.setProperty("--iframe-modal-bg", bg);
|
|
3690
|
+
}
|
|
3691
|
+
if (text) {
|
|
3692
|
+
root.style.setProperty("--iframe-text", text);
|
|
3693
|
+
}
|
|
3694
|
+
if (textSec) {
|
|
3695
|
+
root.style.setProperty("--iframe-text-secondary", textSec);
|
|
3696
|
+
}
|
|
3697
|
+
if (border) {
|
|
3698
|
+
root.style.setProperty("--iframe-border", border);
|
|
3699
|
+
}
|
|
3700
|
+
console.log("[IframeWallet] Applied theme colors:", { bg, text, textSec, border });
|
|
3701
|
+
}
|
|
3702
|
+
} catch (error) {
|
|
3703
|
+
console.warn("[IframeWallet] Failed to apply theme colors:", error);
|
|
3704
|
+
}
|
|
3705
|
+
}
|
|
3618
3706
|
async initialize() {
|
|
3619
3707
|
if (window.location.hostname !== "localhost" && window.location.hostname !== "127.0.0.1" && !window.location.hostname.includes("lumiapassport.com")) {
|
|
3620
3708
|
console.warn("[iframe] \u26A0\uFE0F Running on unexpected origin!");
|