Skip to content

Commit

Permalink
Merge branch 'main' into tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkbee1 committed Oct 31, 2024
2 parents 6d37b88 + c5418bc commit abe2d59
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
3 changes: 3 additions & 0 deletions lib/dashboard/connection/operation/view/operation_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ class _OperationViewState extends State<OperationView> {

return PopScope(
onPopInvoked: (didPop) {
if (didPop) {
return;
}
context.read<OperationCubit>().rejectOperation(
connectionBridgeType: widget.connectionBridgeType,
);
Expand Down
5 changes: 4 additions & 1 deletion lib/dashboard/src/view/dashboard_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ class _DashboardViewState extends State<DashboardView> {

return PopScope(
canPop: false,
onPopInvoked: (_) async {
onPopInvoked: (didPop) async {
if (didPop) {
return;
}
if (scaffoldKey.currentState!.isDrawerOpen) {
// Navigator.of(context).pop();
}
Expand Down
17 changes: 2 additions & 15 deletions lib/scan/cubit/scan_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -821,16 +821,6 @@ class ScanCubit extends Cubit<ScanState> {
final customOidc4vcProfile =
profileSetting.selfSovereignIdentityOptions.customOidc4vcProfile;

final vcFormatType = customOidc4vcProfile.vcFormatType;

final supportingFormats = getPresentVCDetails(
clientMetaData: clientMetaData,
presentationDefinition: presentationDefinition,
vcFormatType: vcFormatType,
credentialsToBePresented: credentialsToBePresented,
);

// if (supportingFormats.contains(VCFormatType.vcSdJWT)) {
if (formatFromPresentationSubmission == VCFormatType.vcSdJWT) {
final credentialList = getStringCredentialsForToken(
credentialsToBePresented: credentialsToBePresented,
Expand All @@ -841,9 +831,6 @@ class ScanCubit extends Cubit<ScanState> {
// considering only one

return vpToken;
// } else if (supportingFormats.contains(VCFormatType.jwtVc) ||
// supportingFormats.contains(VCFormatType.jwtVcJson) ||
// supportingFormats.contains(VCFormatType.jwtVcJsonLd)) {
} else if (formatFromPresentationSubmission == VCFormatType.jwtVc ||
formatFromPresentationSubmission == VCFormatType.jwtVcJson ||
formatFromPresentationSubmission == VCFormatType.jwtVcJsonLd) {
Expand All @@ -863,7 +850,6 @@ class ScanCubit extends Cubit<ScanState> {
);

return vpToken;
// } else if (supportingFormats.contains(VCFormatType.ldpVc)) {
} else if (formatFromPresentationSubmission == VCFormatType.ldpVc) {
/// proof is done with a creation date 20 seconds in the past to avoid
/// proof check to fail because of time difference on server
Expand Down Expand Up @@ -954,7 +940,8 @@ class ScanCubit extends Cubit<ScanState> {

final String responseOrRedirectUri =
uri.queryParameters['redirect_uri'] ??
uri.queryParameters['response_uri']!;
uri.queryParameters['response_uri'] ??
uri.origin;

await activityLogManager.saveLog(
LogData(
Expand Down
13 changes: 8 additions & 5 deletions packages/oidc4vc/lib/src/oidc4vc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1052,19 +1052,22 @@ class OIDC4VC {

return jsonDecode(jsonEncode(data)) as Map<String, dynamic>;
} else {
final totoPath = JsonPath(r'$..[?(@.verificationMethod)]');
final toto =
(totoPath.read(didDocument).first.value!) as Map<String, dynamic>;
final jsonPath = JsonPath(r'$..verificationMethod');
late List<dynamic> data;

if (holderKid == null) {
data = (jsonPath.read(didDocument).first.value! as List).toList();
} else {
data = (jsonPath.read(didDocument).first.value! as List).where(
data = (toto['verificationMethod'] as List).where(
(dynamic e) {
final id = toto['id'];
final kid = e['id'].toString();

if (holderKid.contains('#')) {
final identifier = '#${holderKid.split('#')[1]}';
if (kid == identifier) return true;
if (kid.startsWith('#')) {
if (holderKid == id + kid) return true;
} else {
if (holderKid == kid) return true;
}
Expand Down Expand Up @@ -1750,7 +1753,7 @@ class OIDC4VC {
'aud': tokenParameters.audience, // devrait être verifier
'exp': iat + 1000,
'sub': issAndSub,
// 'iss': issAndSub,
'iss': issAndSub,
};

if (tokenParameters.nonce != null) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: altme
description: AltMe Flutter App

version: 2.15.8+534
version: 2.16.0+535

publish_to: "none" # Remove this line if you wish to publish to pub.dev
environment:
Expand Down

0 comments on commit abe2d59

Please sign in to comment.