Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

October #2891

Merged
merged 12 commits into from
Sep 18, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,16 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType {
final oidc4vcDraftType = profileSetting
.selfSovereignIdentityOptions.customOidc4vcProfile.oidc4vciDraft;

final discoverCardsOptions = profileSetting.discoverCardsOptions;

var format = VCFormatType.ldpVc.urlValue;

if (vcFormatType == VCFormatType.auto && discoverCardsOptions != null) {
format = discoverCardsOptions.vcFormatTypeForAuto;
} else {
format = vcFormatType.urlValue;
}

switch (this) {
case CredentialSubjectType.defiCompliance:
image = ImageStrings.dummyDefiComplianceCard;
Expand Down Expand Up @@ -793,7 +803,7 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType {

link = '${Urls.emailPassUrl}'
'?draft=${oidc4vcDraftType.numbering}'
'&format=${vcFormatType.urlValue}';
'&format=$format';

whyGetThisCard = ResponseString.RESPONSE_STRING_emailPassWhyGetThisCard;
expirationDateDetails =
Expand All @@ -805,7 +815,7 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType {

link = '${Urls.id360Url}'
'?draft=${oidc4vcDraftType.numbering}'
'&format=${vcFormatType.urlValue}'
'&format=$format'
'&type=over13';

whyGetThisCard = ResponseString.RESPONSE_STRING_over13WhyGetThisCard;
Expand All @@ -818,7 +828,7 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType {

link = '${Urls.id360Url}'
'?draft=${oidc4vcDraftType.numbering}'
'&format=${vcFormatType.urlValue}'
'&format=$format'
'&type=over15';

whyGetThisCard = ResponseString.RESPONSE_STRING_over15WhyGetThisCard;
Expand All @@ -831,7 +841,7 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType {

link = '${Urls.id360Url}'
'?draft=${oidc4vcDraftType.numbering}'
'&format=${vcFormatType.urlValue}'
'&format=$format'
'&type=over18';

whyGetThisCard = ResponseString.RESPONSE_STRING_over18WhyGetThisCard;
Expand All @@ -844,7 +854,7 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType {

link = '${Urls.id360Url}'
'?draft=${oidc4vcDraftType.numbering}'
'&format=${vcFormatType.urlValue}'
'&format=$format'
'&type=over21';

whyGetThisCard = ResponseString.RESPONSE_STRING_over18WhyGetThisCard;
Expand All @@ -857,7 +867,7 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType {

link = '${Urls.id360Url}'
'?draft=${oidc4vcDraftType.numbering}'
'&format=${vcFormatType.urlValue}'
'&format=$format'
'&type=over50';

whyGetThisCard = ResponseString.RESPONSE_STRING_over18WhyGetThisCard;
Expand All @@ -870,7 +880,7 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType {

link = '${Urls.id360Url}'
'?draft=${oidc4vcDraftType.numbering}'
'&format=${vcFormatType.urlValue}'
'&format=$format'
'&type=over65';

whyGetThisCard = ResponseString.RESPONSE_STRING_over18WhyGetThisCard;
Expand Down Expand Up @@ -916,7 +926,7 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType {

link = '${Urls.id360Url}'
'?draft=${oidc4vcDraftType.numbering}'
'&format=${vcFormatType.urlValue}'
'&format=$format'
'&type=$type';

whyGetThisCard =
Expand Down Expand Up @@ -963,7 +973,7 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType {

link = '${Urls.phonePassUrl}'
'?draft=${oidc4vcDraftType.numbering}'
'&format=${vcFormatType.urlValue}';
'&format=$format';

whyGetThisCard =
ResponseString.RESPONSE_STRING_phoneProofWhyGetThisCard;
Expand All @@ -976,7 +986,7 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType {

link = '${Urls.id360Url}'
'?draft=${oidc4vcDraftType.numbering}'
'&format=${vcFormatType.urlValue}'
'&format=$format'
'&type=liveness';

whyGetThisCard =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ List<CredentialModel> getCredentialsFromFilterList({
/// a valid candidate
if (searchList.isNotEmpty) {
selectedCredential.add(credential);
} else {
break;
}
}
}
Expand Down
27 changes: 27 additions & 0 deletions lib/dashboard/profile/models/profile_setting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,33 @@ class DiscoverCardsOptions extends Equatable {
);
}

String get vcFormatTypeForAuto {
if (displayDefi ||
displayEmailPass ||
displayGender ||
displayHumanity ||
displayOver13 ||
displayOver15 ||
displayOver18 ||
displayOver21 ||
displayOver50 ||
displayOver65 ||
displayPhonePass ||
displayVerifiableId) {
return VCFormatType.ldpVc.urlValue;
} else if (displayPhonePassJwt ||
displayOver18Jwt ||
displayEmailPassJwt ||
displayVerifiableIdJwt ||
displayHumanityJwt) {
return VCFormatType.jwtVcJson.urlValue;
} else if (displayVerifiableIdSdJwt) {
return VCFormatType.vcSdJWT.urlValue;
}

return VCFormatType.ldpVc.urlValue;
}

@override
List<Object?> get props => [
displayDefi,
Expand Down
4 changes: 2 additions & 2 deletions packages/key_generator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ dependencies:
dart_web3: ^0.0.3
ed25519_hd_key: ^2.2.0
hex: ^0.2.0
pinenacl: ^0.3.3
pinenacl: ^0.6.0
secp256k1: ^0.3.0
tezart:
git:
url: https://github.com/autonomy-system/tezart.git
ref: 7534512ff7c874251e5b1e1a426f5822a3837b51
ref: 85070e8ddafe5140c0bfd2cb9d569ecf986e7234

dev_dependencies:
flutter_test:
Expand Down
4 changes: 2 additions & 2 deletions packages/oidc4vc/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ dependencies:
jose_plus: ^0.4.5
json_annotation: ^4.8.1
json_path: ^0.7.2 #latest version creates test issue
pinenacl: ^0.6.0
secp256k1: ^0.3.0
secure_storage:
path: ../secure_storage
tezart:
git:
url: https://github.com/autonomy-system/tezart.git
ref: 7534512ff7c874251e5b1e1a426f5822a3837b51
ref: 85070e8ddafe5140c0bfd2cb9d569ecf986e7234
uuid: ^3.0.7

dependency_overrides:
ffi: 2.1.0 #didkit from path which depends on ffi ^1.0.0
pinenacl: ^0.5.1 # tezart from git depends on pinenacl ^0.3.3

dev_dependencies:
build_runner: ^2.4.4
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -651,10 +651,10 @@ packages:
dependency: "direct main"
description:
name: dio
sha256: "0dfb6b6a1979dac1c1245e17cef824d7b452ea29bd33d3467269f9bef3715fb0"
sha256: "5598aa796bbf4699afd5c67c0f5f6e2ed542afc956884b9cd58c306966efc260"
url: "https://pub.dev"
source: hosted
version: "5.6.0"
version: "5.7.0"
dio_cache_interceptor:
dependency: transitive
description:
Expand Down
6 changes: 2 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: altme
description: AltMe Flutter App

version: 2.12.5+510

version: 2.12.6+511

publish_to: "none" # Remove this line if you wish to publish to pub.dev
environment:
Expand Down Expand Up @@ -108,7 +107,7 @@ dependencies:
tezart:
git:
url: https://github.com/autonomy-system/tezart.git
ref: 7534512ff7c874251e5b1e1a426f5822a3837b51
ref: 85070e8ddafe5140c0bfd2cb9d569ecf986e7234
timezone: ^0.9.2
url_launcher: ^6.1.11
visibility_detector: ^0.4.0+2
Expand All @@ -128,7 +127,6 @@ dependency_overrides:
pointycastle: ^3.7.4 #polygonid from path requires pointycastle 3.7.3
uuid: ^3.0.7 #web3dart >=2.7.2 depends on uuid ^4.0.0
web3dart: ^2.5.1 #alletconnect_flutter_v2 >=2.2.2-beta01 depends on web3dart ^2.7.3


dev_dependencies:
bloc_test: ^9.1.2
Expand Down