Skip to content

Commit

Permalink
feat: optimise and pass OIDC4VCP test 13 #2600
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Apr 17, 2024
1 parent 12f10ac commit 7925112
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
26 changes: 24 additions & 2 deletions lib/app/shared/helper_functions/helper_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1802,14 +1802,16 @@ Map<String, dynamic> createJsonByDecryptingSDValues({
}) {
final json = <String, dynamic>{};

final sh256HashToContent = selectiveDisclosure.sh256HashToContent;

encryptedJson.forEach((key, value) {
if (key == '_sd') {
final sd = encryptedJson['_sd'];

if (sd is List<dynamic>) {
for (final sdValue in sd) {
if (selectiveDisclosure.sh256HashToContent.containsKey(sdValue)) {
final content = selectiveDisclosure.sh256HashToContent[sdValue];
if (sh256HashToContent.containsKey(sdValue)) {
final content = sh256HashToContent[sdValue];
if (content is Map) {
content.forEach((key, value) {
json[key.toString()] = value;
Expand All @@ -1825,6 +1827,26 @@ Map<String, dynamic> createJsonByDecryptingSDValues({
encryptedJson: value,
);
json[key] = nestedJson;
} else if (value is List<dynamic>) {
final list = <String>[];

for (final ele in value) {
if (ele is Map) {
final threeDotValue = ele['...'];
if (sh256HashToContent.containsKey(threeDotValue)) {
final content = sh256HashToContent[threeDotValue];
if (content is Map) {
content.forEach((key, value) {
list.add(value.toString());
});
}
}
} else {
list.add(ele.toString());
}
}

json[key] = list;
} else {
json[key] = value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ List<CredentialModel> getCredentialsFromFilterList({
} else if (field.filter?.contains?.containsConst != null) {
pattern = field.filter?.contains?.containsConst;
} else {
/// sd-jwt vc case
/// sd-jwt vc bool case
if (searchParameter == 'true') return false;
}

Expand Down

0 comments on commit 7925112

Please sign in to comment.