Skip to content

Commit 0d27e6a

Browse files
author
Rob
committed
Merge branch 'PVW-1402-expand-rp-core-model-with-disclosure' into 'main'
PVW-1402: Render disclosure request in wallet_app See merge request wallet/nl-wallet!450
2 parents 3ea1cae + c7164a4 commit 0d27e6a

File tree

68 files changed

+808
-303
lines changed

Some content is hidden

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

68 files changed

+808
-303
lines changed

scripts/devenv/reader_auth.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"en": "My Service Name"
66
},
77
"purposeStatement": {
8-
"nl": "Beschrijving van mijn dienst",
9-
"en": "My Service Description"
8+
"nl": "Reden voor dit verzoek",
9+
"en": "Purpose of this request"
1010
},
1111
"retentionPolicy": {
1212
"intentToRetain": true,
@@ -36,7 +36,8 @@
3636
"nl": "Den Haag",
3737
"en": "The Hague"
3838
},
39-
"country": "nl",
39+
"countryCode": "nl",
40+
"kvk": "5684 6846",
4041
"privacyPolicyUrl": "https://example.com/privacy"
4142
},
4243
"attributes": {

wallet_app/lib/bridge_generated.dart

Lines changed: 82 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,36 @@ enum PinValidationResult {
203203
}
204204

205205
class RelyingParty {
206-
final String name;
206+
final List<LocalizedString> legalName;
207+
final List<LocalizedString> displayName;
208+
final List<LocalizedString> description;
209+
final String? webUrl;
210+
final String? kvk;
211+
final List<LocalizedString>? city;
212+
final String? countryCode;
207213

208214
const RelyingParty({
209-
required this.name,
215+
required this.legalName,
216+
required this.displayName,
217+
required this.description,
218+
this.webUrl,
219+
this.kvk,
220+
this.city,
221+
this.countryCode,
222+
});
223+
}
224+
225+
class RequestPolicy {
226+
final int? dataStorageDurationDays;
227+
final bool dataSharedWithThirdParties;
228+
final bool dataDeletionPossible;
229+
final String policyUrl;
230+
231+
const RequestPolicy({
232+
this.dataStorageDurationDays,
233+
required this.dataSharedWithThirdParties,
234+
required this.dataDeletionPossible,
235+
required this.policyUrl,
210236
});
211237
}
212238

@@ -224,11 +250,16 @@ class RequestedCard {
224250
class StartDisclosureResult with _$StartDisclosureResult {
225251
const factory StartDisclosureResult.request({
226252
required RelyingParty relyingParty,
253+
required RequestPolicy policy,
227254
required List<RequestedCard> requestedCards,
255+
required bool isFirstInteractionWithRelyingParty,
256+
required List<LocalizedString> requestPurpose,
228257
}) = StartDisclosureResult_Request;
229258
const factory StartDisclosureResult.requestAttributesMissing({
230259
required RelyingParty relyingParty,
231260
required List<MissingAttribute> missingAttributes,
261+
required bool isFirstInteractionWithRelyingParty,
262+
required List<LocalizedString> requestPurpose,
232263
}) = StartDisclosureResult_RequestAttributesMissing;
233264
}
234265

@@ -645,10 +676,18 @@ class WalletCoreImpl implements WalletCore {
645676
return raw as bool;
646677
}
647678

679+
int _wire2api_box_autoadd_i64(dynamic raw) {
680+
return _wire2api_i64(raw);
681+
}
682+
648683
RelyingParty _wire2api_box_autoadd_relying_party(dynamic raw) {
649684
return _wire2api_relying_party(raw);
650685
}
651686

687+
RequestPolicy _wire2api_box_autoadd_request_policy(dynamic raw) {
688+
return _wire2api_request_policy(raw);
689+
}
690+
652691
Card _wire2api_card(dynamic raw) {
653692
final arr = raw as List<dynamic>;
654693
if (arr.length != 3) throw Exception('unexpected arr length: expect 3 but see ${arr.length}');
@@ -722,6 +761,10 @@ class WalletCoreImpl implements WalletCore {
722761
return raw as int;
723762
}
724763

764+
int _wire2api_i64(dynamic raw) {
765+
return castInt(raw);
766+
}
767+
725768
IdentifyUriResult _wire2api_identify_uri_result(dynamic raw) {
726769
return IdentifyUriResult.values[raw as int];
727770
}
@@ -763,15 +806,44 @@ class WalletCoreImpl implements WalletCore {
763806
);
764807
}
765808

809+
String? _wire2api_opt_String(dynamic raw) {
810+
return raw == null ? null : _wire2api_String(raw);
811+
}
812+
813+
int? _wire2api_opt_box_autoadd_i64(dynamic raw) {
814+
return raw == null ? null : _wire2api_box_autoadd_i64(raw);
815+
}
816+
817+
List<LocalizedString>? _wire2api_opt_list_localized_string(dynamic raw) {
818+
return raw == null ? null : _wire2api_list_localized_string(raw);
819+
}
820+
766821
PinValidationResult _wire2api_pin_validation_result(dynamic raw) {
767822
return PinValidationResult.values[raw as int];
768823
}
769824

770825
RelyingParty _wire2api_relying_party(dynamic raw) {
771826
final arr = raw as List<dynamic>;
772-
if (arr.length != 1) throw Exception('unexpected arr length: expect 1 but see ${arr.length}');
827+
if (arr.length != 7) throw Exception('unexpected arr length: expect 7 but see ${arr.length}');
773828
return RelyingParty(
774-
name: _wire2api_String(arr[0]),
829+
legalName: _wire2api_list_localized_string(arr[0]),
830+
displayName: _wire2api_list_localized_string(arr[1]),
831+
description: _wire2api_list_localized_string(arr[2]),
832+
webUrl: _wire2api_opt_String(arr[3]),
833+
kvk: _wire2api_opt_String(arr[4]),
834+
city: _wire2api_opt_list_localized_string(arr[5]),
835+
countryCode: _wire2api_opt_String(arr[6]),
836+
);
837+
}
838+
839+
RequestPolicy _wire2api_request_policy(dynamic raw) {
840+
final arr = raw as List<dynamic>;
841+
if (arr.length != 4) throw Exception('unexpected arr length: expect 4 but see ${arr.length}');
842+
return RequestPolicy(
843+
dataStorageDurationDays: _wire2api_opt_box_autoadd_i64(arr[0]),
844+
dataSharedWithThirdParties: _wire2api_bool(arr[1]),
845+
dataDeletionPossible: _wire2api_bool(arr[2]),
846+
policyUrl: _wire2api_String(arr[3]),
775847
);
776848
}
777849

@@ -789,12 +861,17 @@ class WalletCoreImpl implements WalletCore {
789861
case 0:
790862
return StartDisclosureResult_Request(
791863
relyingParty: _wire2api_box_autoadd_relying_party(raw[1]),
792-
requestedCards: _wire2api_list_requested_card(raw[2]),
864+
policy: _wire2api_box_autoadd_request_policy(raw[2]),
865+
requestedCards: _wire2api_list_requested_card(raw[3]),
866+
isFirstInteractionWithRelyingParty: _wire2api_bool(raw[4]),
867+
requestPurpose: _wire2api_list_localized_string(raw[5]),
793868
);
794869
case 1:
795870
return StartDisclosureResult_RequestAttributesMissing(
796871
relyingParty: _wire2api_box_autoadd_relying_party(raw[1]),
797872
missingAttributes: _wire2api_list_missing_attribute(raw[2]),
873+
isFirstInteractionWithRelyingParty: _wire2api_bool(raw[3]),
874+
requestPurpose: _wire2api_list_localized_string(raw[4]),
798875
);
799876
default:
800877
throw Exception("unreachable");

0 commit comments

Comments
 (0)