Skip to content

Commit c96dcbf

Browse files
committed
Merge branch 'pvw-3201-add-multi-language-demo-rp' into 'main'
PVW-3201: multi language support demo RP See merge request wallet/nl-wallet!1103
2 parents 637f352 + 05f0128 commit c96dcbf

37 files changed

+833
-397
lines changed

scripts/devenv/mock_relying_party.toml.template

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ sha256 = "${WALLET_WEB_SHA256}"
1515
docType = "com.example.pid"
1616
nameSpaces = { "com.example.pid" = { bsn = true } }
1717

18-
[[usecases.xyz_bank.items_requests]]
18+
[[usecases.online_marketplace.items_requests]]
1919
docType = "com.example.pid"
20-
nameSpaces = { "com.example.pid" = { given_name = true, family_name = true, birth_date = true, bsn = true } }
20+
nameSpaces = { "com.example.pid" = { given_name = true, family_name = true, birth_date = true } }
2121

22-
[[usecases.xyz_bank.items_requests]]
22+
[[usecases.online_marketplace.items_requests]]
2323
docType = "com.example.address"
2424
nameSpaces = { "com.example.address" = { resident_street = true, resident_house_number = true, resident_postal_code = true } }
2525

26-
[[usecases.online_marketplace.items_requests]]
26+
[[usecases.xyz_bank.items_requests]]
2727
docType = "com.example.pid"
28-
nameSpaces = { "com.example.pid" = { given_name = true, family_name = true, birth_date = true } }
28+
nameSpaces = { "com.example.pid" = { given_name = true, family_name = true, birth_date = true, bsn = true } }
2929

30-
[[usecases.online_marketplace.items_requests]]
30+
[[usecases.xyz_bank.items_requests]]
3131
docType = "com.example.address"
3232
nameSpaces = { "com.example.address" = { resident_street = true, resident_house_number = true, resident_postal_code = true } }
3333

scripts/devenv/mrp_verification_server.toml.template

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ ephemeral_id_secret = "${MRP_VERIFICATION_SERVER_EPHEMERAL_ID_SECRET}"
2222
certificate = "${MOCK_RELYING_PARTY_CRT_MIJN_AMSTERDAM}"
2323
private_key = "${MOCK_RELYING_PARTY_KEY_MIJN_AMSTERDAM}"
2424

25-
[verifier.usecases.xyz_bank]
26-
certificate = "${MOCK_RELYING_PARTY_CRT_XYZ_BANK}"
27-
private_key = "${MOCK_RELYING_PARTY_KEY_XYZ_BANK}"
28-
2925
[verifier.usecases.online_marketplace]
3026
certificate = "${MOCK_RELYING_PARTY_CRT_ONLINE_MARKETPLACE}"
3127
private_key = "${MOCK_RELYING_PARTY_KEY_ONLINE_MARKETPLACE}"
3228

29+
[verifier.usecases.xyz_bank]
30+
certificate = "${MOCK_RELYING_PARTY_CRT_XYZ_BANK}"
31+
private_key = "${MOCK_RELYING_PARTY_KEY_XYZ_BANK}"
32+
3333
[verifier.usecases.monkey_bike]
3434
certificate = "${MOCK_RELYING_PARTY_CRT_MONKEY_BIKE}"
3535
private_key = "${MOCK_RELYING_PARTY_KEY_MONKEY_BIKE}"

scripts/setup-devenv.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,20 +221,20 @@ export MOCK_RELYING_PARTY_KEY_MIJN_AMSTERDAM
221221
MOCK_RELYING_PARTY_CRT_MIJN_AMSTERDAM=$(< "${TARGET_DIR}/mock_relying_party/mijn_amsterdam.crt.der" ${BASE64})
222222
export MOCK_RELYING_PARTY_CRT_MIJN_AMSTERDAM
223223

224-
# Generate relying party key and cert
225-
generate_mock_relying_party_key_pair xyz_bank
226-
MOCK_RELYING_PARTY_KEY_XYZ_BANK=$(< "${TARGET_DIR}/mock_relying_party/xyz_bank.key.der" ${BASE64})
227-
export MOCK_RELYING_PARTY_KEY_XYZ_BANK
228-
MOCK_RELYING_PARTY_CRT_XYZ_BANK=$(< "${TARGET_DIR}/mock_relying_party/xyz_bank.crt.der" ${BASE64})
229-
export MOCK_RELYING_PARTY_CRT_XYZ_BANK
230-
231224
# Generate relying party key and cert
232225
generate_mock_relying_party_key_pair online_marketplace
233226
MOCK_RELYING_PARTY_KEY_ONLINE_MARKETPLACE=$(< "${TARGET_DIR}/mock_relying_party/online_marketplace.key.der" ${BASE64})
234227
export MOCK_RELYING_PARTY_KEY_ONLINE_MARKETPLACE
235228
MOCK_RELYING_PARTY_CRT_ONLINE_MARKETPLACE=$(< "${TARGET_DIR}/mock_relying_party/online_marketplace.crt.der" ${BASE64})
236229
export MOCK_RELYING_PARTY_CRT_ONLINE_MARKETPLACE
237230

231+
# Generate relying party key and cert
232+
generate_mock_relying_party_key_pair xyz_bank
233+
MOCK_RELYING_PARTY_KEY_XYZ_BANK=$(< "${TARGET_DIR}/mock_relying_party/xyz_bank.key.der" ${BASE64})
234+
export MOCK_RELYING_PARTY_KEY_XYZ_BANK
235+
MOCK_RELYING_PARTY_CRT_XYZ_BANK=$(< "${TARGET_DIR}/mock_relying_party/xyz_bank.crt.der" ${BASE64})
236+
export MOCK_RELYING_PARTY_CRT_XYZ_BANK
237+
238238
# Generate relying party key and cert
239239
generate_mock_relying_party_key_pair monkey_bike
240240
MOCK_RELYING_PARTY_KEY_MONKEY_BIKE=$(< "${TARGET_DIR}/mock_relying_party/monkey_bike.key.der" ${BASE64})

wallet_core/Cargo.lock

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wallet_core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ rust-version = "1.80"
3737
async_fn_in_trait = "allow"
3838

3939
[workspace.dependencies]
40+
accept-language = "3.1.0"
4041
aes-gcm = "0.10.3"
4142
android_logger = { version = "0.14.1", default-features = false }
4243
anyhow = "1.0.66"

wallet_core/mock_relying_party/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ doctest = false
1515
allow_http_return_url = ["wallet_server/allow_http_return_url"]
1616

1717
[dependencies]
18+
accept-language.workspace = true
1819
anyhow.workspace = true
1920
askama.workspace = true
2021
axum = { workspace = true, features = ["http1", "query", "tokio", "tower-log", "tracing"] }
2122
base64.workspace = true
22-
config = { workspace = true, features = ["toml"] }
23+
config = { workspace = true, features = ["preserve_order", "toml"] }
2324
futures = { workspace = true, features = ["std"] }
2425
http.workspace = true
26+
indexmap.workspace = true
2527
nutype = { workspace = true, features = ["serde"] }
2628
reqwest = { workspace = true, features = ["rustls-tls-webpki-roots"] }
2729
sentry = { workspace = true, features = [
@@ -58,3 +60,6 @@ url = { workspace = true, features = ["serde"] }
5860
nl_wallet_mdoc.path = "../mdoc"
5961
wallet_common = { path = "../wallet_common", features = ["sentry"] }
6062
wallet_server = { path = "../wallet_server", features = ["disclosure"] }
63+
64+
[dev-dependencies]
65+
rstest.workspace = true
Lines changed: 134 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,157 @@
11
aside {
2-
order: -1;
2+
order: -1;
33

4-
width: 100vw;
5-
display: flex;
6-
flex-direction: row;
7-
justify-content: center;
8-
align-items: center;
9-
gap: 16px;
10-
padding: 16px;
11-
background: #f2f1fe;
12-
color: #152a62;
4+
width: 100vw;
5+
display: flex;
6+
flex-direction: row;
7+
justify-content: space-between;
8+
align-items: center;
9+
padding: 16px;
10+
gap: 16px;
11+
color: #152a62;
12+
}
13+
14+
aside:has(.text) {
15+
background: #f2f1fe;
1316
}
1417

1518
@media screen and (min-width: 500px) {
16-
aside {
17-
padding: 8px 24px;
18-
}
19+
aside {
20+
padding: 8px 24px 8px 94px; /* 24 + 16 + 54 */
21+
}
1922
}
2023

2124
aside b {
22-
font-weight: 700;
25+
font-weight: 700;
2326
}
2427

2528
aside a {
26-
color: #383ede;
29+
color: #383ede;
2730
}
2831

2932
aside a:hover {
30-
color: #3237c4;
31-
text-decoration: none;
33+
color: #3237c4;
34+
text-decoration: none;
35+
}
36+
37+
aside .demo-bar {
38+
flex-grow: 0;
39+
display: flex;
40+
justify-content: center;
41+
align-items: center;
42+
gap: 16px;
3243
}
3344

34-
aside::before {
35-
content: " ";
36-
background: url("../non-free/images/nl-wallet.svg") no-repeat center center / cover;
37-
width: 40px;
38-
height: 40px;
45+
aside .demo-bar::before {
46+
content: " ";
47+
background: url("../non-free/images/nl-wallet.svg") no-repeat center center / cover;
48+
width: 40px;
49+
height: 40px;
3950
}
4051

4152
aside .text {
42-
display: flex;
43-
flex-direction: column;
44-
justify-content: center;
53+
display: flex;
54+
flex-direction: column;
55+
justify-content: center;
4556
}
4657

4758
@media screen and (min-width: 500px) {
48-
aside .text {
49-
flex-direction: row;
50-
align-items: center;
51-
gap: 8px;
52-
}
59+
aside {
60+
justify-content: right;
61+
}
62+
63+
aside .demo-bar {
64+
flex-grow: 1;
65+
}
66+
67+
aside .text {
68+
flex-direction: row;
69+
align-items: center;
70+
gap: 8px;
71+
}
72+
}
73+
74+
.lang-selector {
75+
position: relative;
76+
}
77+
78+
.lang-selector label[for="lang_toggle"] {
79+
display: flex;
80+
align-items: center;
81+
82+
padding: 4px 8px;
83+
gap: 4px;
84+
border-radius: 2px;
85+
86+
background: #fcfcfc;
87+
color: #383ede;
88+
font-weight: 700;
89+
text-transform: uppercase;
90+
line-height: 1.25;
91+
92+
user-select: none;
93+
}
94+
95+
.lang-selector label[for="lang_toggle"]:hover {
96+
background-color: #f1f1f1;
97+
cursor: pointer;
98+
}
99+
100+
.lang-selector label[for="lang_toggle"]::after {
101+
content: " ";
102+
background: url("../non-free/images/down.svg") no-repeat center center / contain;
103+
104+
width: 16px;
105+
height: 16px;
106+
}
107+
108+
#lang_toggle {
109+
display: none;
110+
}
111+
112+
#lang_toggle:checked + .lang-modal {
113+
display: block;
114+
}
115+
116+
.lang-selector .lang-modal {
117+
position: absolute;
118+
right: 0;
119+
z-index: 1;
120+
121+
margin-top: 2px;
122+
123+
background: #fcfcfc;
124+
box-shadow: 0px 4px 40px 0px #00000029;
125+
border-radius: 2px;
126+
127+
overflow: hidden;
128+
129+
display: none;
130+
}
131+
132+
.lang-selector .lang-modal button {
133+
display: flex;
134+
padding: 12px 24px 12px 12px;
135+
gap: 12px;
136+
color: #152a62;
137+
width: 100%;
138+
}
139+
140+
.lang-selector .lang-modal button:not(:disabled):hover {
141+
background-color: #f1f1f1;
142+
cursor: pointer;
143+
}
144+
145+
.lang-selector .lang-modal button::before {
146+
content: " ";
147+
width: 24px;
148+
height: 24px;
149+
}
150+
151+
.lang-selector .lang-modal button:disabled::before {
152+
content: " ";
153+
background-color: #152a62;
154+
mask: url("../non-free/images/checkmark.svg") no-repeat center center / contain;
155+
width: 24px;
156+
height: 24px;
53157
}

0 commit comments

Comments
 (0)