Skip to content

Commit

Permalink
Test #13 LSP POTENTIAL PID with nationalitie IT is failing
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkbee1 committed May 30, 2024
1 parent 4994e51 commit ec80bb5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,31 +84,20 @@ class SelectiveDisclosureCubit extends Cubit<SelectiveDisclosureState> {
int? index;

if (threeDotValue != null) {
final disclosureToContentEntries =
selectiveDisclosure.disclosureToContent.entries.toList();

for (final element in disclosureToContentEntries) {
final sh256Hash = oidc4vc.sh256HashOfContent(element.value.toString());

if (sh256Hash == threeDotValue) {
final disclosure = element.key.replaceAll('=', '');
index = disclosureToContentEntries
.indexWhere((entry) => entry.key == disclosure);
break;
}
}
index = selectiveDisclosure.disclosureFromJWT
.indexWhere((entry) => entry == threeDotValue);
} else if (claimsKey != null) {
index =
selectiveDisclosure.disclosureToContent.entries.toList().indexWhere(
(entry) => entry.value.toString().contains(claimsKey),
);
}

if (index == null) {
if (index == null || index == -1) {
throw ResponseMessage(
data: {
'error': 'invalid_request',
'error_description': 'Issue with the dislosuer of jwt.',
'error_description': 'Issue with the dislosure of jwt.',
},
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,6 @@ class _SelectiveDisclosurePickViewState
}
}

final selectiveDisclosure =
SelectiveDisclosure(widget.credentialToBePresented);

final encryptedValues = widget.credentialToBePresented.jwt
?.split('~')
.where((element) => element.isNotEmpty)
Expand Down
2 changes: 1 addition & 1 deletion lib/selective_disclosure/selective_disclosure.dart
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class SelectiveDisclosure {
ClaimsData(
isfromDisclosureOfJWT: true,
data: trimmedElement.last.replaceAll('"', ''),
threeDotValue: threeDotValue.toString(),
threeDotValue: oidc4vc.getDisclosure(element),
),
);
}
Expand Down

0 comments on commit ec80bb5

Please sign in to comment.