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 #3067

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

October #3067

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d17fdcd
refactor: Add missing issuer in discover #3046
bibash28 Nov 4, 2024
3ab5466
feat: Remove registration for developer mode #3008
bibash28 Nov 4, 2024
b67c1cd
feat: Fetch verifier metadata from link #3009
bibash28 Nov 4, 2024
c912e99
refactor: Update token request and use only pincode or txcode #3029
bibash28 Nov 4, 2024
694dbe7
feat: Set default value for pin code length and description #3030
bibash28 Nov 4, 2024
5afb380
feat: Show activity log by default #2993
bibash28 Nov 4, 2024
bc3ceb7
fix: Update decentralised Id page #3055
bibash28 Nov 5, 2024
49a0c48
version update: 2.16.4+539
bibash28 Nov 5, 2024
3128658
refactore: Update profilesetting.g.dart
bibash28 Nov 5, 2024
81ec55c
feat: Cusomise PIN code title based on situation #2977
bibash28 Nov 5, 2024
201b1a8
refactor: Choose first display if locale is not provided #3006
bibash28 Nov 5, 2024
af31109
feat: Add code for dpop support #3034
bibash28 Nov 5, 2024
d9ce52d
fix: Add displayEmailPassSdJwt in copywith part #3046
bibash28 Nov 5, 2024
96a1573
feat: Bypass single credential selection for oidc4vp sd-jwt #2972
bibash28 Nov 6, 2024
0b74940
feat: Show token data and credential data to be sent #3054
bibash28 Nov 6, 2024
f998a84
feat: Show deferred credential data to be sent #3054
bibash28 Nov 6, 2024
bfaad87
feat: Show par data to be sent #3054
bibash28 Nov 6, 2024
0655ccf
feat: Show response data for siopv2 flow and oidc4vp flow #3054
bibash28 Nov 7, 2024
4cbbdac
version update: 2.16.5+540
bibash28 Nov 7, 2024
9cf9aed
feat: Use different format for emailpass #3066
bibash28 Nov 7, 2024
827c0f6
feat: Update oidc4vc tests
bibash28 Nov 7, 2024
d94783e
test update
bibash28 Nov 8, 2024
10c7853
feat: Add continue button while showing data #3054
bibash28 Nov 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/app/shared/constants/parameters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ class Parameters {
// 'https://app.altme.io/wallet_issuer' for altme
static const String walletIssuer = 'https://app.altme.io/wallet_issuer';

// 'https://app.talao.co/wallet-issuer/.well-known/openid-configuration'for talao
// 'https://app.altme.io/wallet-issuer/.well-known/openid-configuration' for altme
static const String walletMetadataForVerifier =
'https://app.altme.io/wallet-issuer/.well-known/openid-configuration';

static const DidKeyType didKeyTypeForEbsiV3 = DidKeyType.ebsiv3;
static const DidKeyType didKeyTypeForEbsiV4 = DidKeyType.ebsiv4;
static const DidKeyType didKeyTypeForDefault = DidKeyType.edDSA;
Expand Down
1 change: 1 addition & 0 deletions lib/app/shared/enum/status/qr_scan_status.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ enum QrScanStatus {
success,
goBack,
pauseForDialog,
pauseForDisplay,
}
Original file line number Diff line number Diff line change
Expand Up @@ -767,15 +767,17 @@ extension CredentialSubjectTypeExtension on CredentialSubjectType {

final discoverCardsOptions = profileSetting.discoverCardsOptions;

var format = VCFormatType.ldpVc.urlValue;
final isEmailPass = this == CredentialSubjectType.emailPass;

var format = VCFormatType.ldpVc.urlValue(isEmailPass: isEmailPass);

if (vcFormatType == VCFormatType.auto && discoverCardsOptions != null) {
format = discoverCardsOptions.vcFormatTypeForAuto(
credentialSubjectType: this,
vcFormatType: assignedVCFormatType,
);
} else {
format = vcFormatType.urlValue;
format = vcFormatType.urlValue(isEmailPass: isEmailPass);
}

switch (this) {
Expand Down
6 changes: 5 additions & 1 deletion lib/app/shared/helper_functions/get_display.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ dynamic getDisplay(dynamic value, String languageCode) {
orElse: () => displays.firstWhere(
(element) =>
element is Map<String, dynamic> && element.containsKey('locale'),
orElse: () => null,
orElse: () => displays.firstWhere(
(element) =>
element is Map<String, dynamic>, // if local is not provided
orElse: () => null,
),
),
),
);
Expand Down
18 changes: 4 additions & 14 deletions lib/app/shared/helper_functions/helper_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,7 @@ ResponseString getErrorResponseString(String errorString) {
return ResponseString.RESPONSE_STRING_theWalletIsNotRegistered;

case 'invalid_grant':
case 'issuance_pending':
case 'invalid_token':
return ResponseString.RESPONSE_STRING_credentialIssuanceDenied;

Expand All @@ -1329,10 +1330,6 @@ ResponseString getErrorResponseString(String errorString) {
case 'server_error':
return ResponseString.RESPONSE_STRING_theServiceIsNotAvailable;

case 'issuance_pending':
return ResponseString
.RESPONSE_STRING_theIssuanceOfThisCredentialIsPending;

case 'invalid_client':
return ResponseString.RESPONSE_STRING_invalidClientErrorDescription;

Expand Down Expand Up @@ -1428,22 +1425,14 @@ Future<String> getFormattedStringOIDC4VPSIOPV2({
uri: Uri.parse(url),
);

final registration = Uri.parse(url).queryParameters['registration'];

final registrationMap = registration != null
? jsonDecode(registration) as Map<String, dynamic>
: null;

final data = '''
<b>SCHEME :</b> ${getSchemeFromUrl(url)}\n
<b>AUTHORIZATION REQUEST :</b>
${response != null ? const JsonEncoder.withIndent(' ').convert(response) : Uri.decodeComponent(url)}\n
<b>CLIENT METADATA :</b>
${clientMetaData != null ? const JsonEncoder.withIndent(' ').convert(clientMetaData) : 'None'}\n
<b>PRESENTATION DEFINITION :</b>
${presentationDefinition != null ? const JsonEncoder.withIndent(' ').convert(presentationDefinition) : 'None'}\n
<b>REGISTRATION :</b>
${registrationMap != null ? const JsonEncoder.withIndent(' ').convert(registrationMap) : 'None'}
${presentationDefinition != null ? const JsonEncoder.withIndent(' ').convert(presentationDefinition) : 'None'}
''';

return data;
Expand Down Expand Up @@ -1763,7 +1752,8 @@ Future<(String?, String?, String?, String?, String?)> getClientDetails({
) ??
credSupportedDisplay.firstWhereOrNull(
(Display display) => display.locale != null,
);
) ??
credSupportedDisplay.first; // if local is not provided
}
}
} else if (openIdConfiguration.credentialConfigurationsSupported != null) {
Expand Down
15 changes: 3 additions & 12 deletions lib/credentials/cubit/credentials_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ class CredentialsCubit extends Cubit<CredentialsState> {
/// We always have the associated Adress credential
/// in the discover since "Do not remove the GET a crypto account
/// in the Discover #2649"
/// in the Discover #2649"
if (isCurrentBlockchainAccount) {
/// if already added do not add
Expand All @@ -1073,9 +1073,7 @@ class CredentialsCubit extends Cubit<CredentialsState> {
/// do not add if format matched
/// there can be same credentials with different format
} else {
if (!alreadyAdded) {
requiredCreds.add(credInfo);
}
requiredCreds.add(credInfo);
}
}
}
Expand All @@ -1087,14 +1085,7 @@ class CredentialsCubit extends Cubit<CredentialsState> {
!isCurrentBlockchainAccount) {
/// do not add if current blockchain acccount does not match
} else {
final alreadyAdded = requiredCreds.any(
(item) =>
item.credentialType == credInfo.credentialType &&
item.formatType == credInfo.formatType,
);
if (!alreadyAdded) {
requiredCreds.add(credInfo);
}
requiredCreds.add(credInfo);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ class FailureWidget extends StatelessWidget {
onPressed: () async {
await securityCheck(
context: context,
title: l10n.typeYourPINCodeToAuthenticate,
localAuthApi: LocalAuthApi(),
onSuccess: () {
Navigator.pushReplacement(
Expand All @@ -226,6 +227,7 @@ class FailureWidget extends StatelessWidget {
onPressed: () async {
await securityCheck(
context: context,
title: l10n.typeYourPINCodeToAuthenticate,
localAuthApi: LocalAuthApi(),
onSuccess: () {
context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class _VerifyAgeViewState extends State<VerifyAgeView> {
onPressed: () async {
await securityCheck(
context: context,
title: l10n.typeYourPINCodeToAuthenticate,
localAuthApi: LocalAuthApi(),
onSuccess: () {
Navigator.push(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class ManageAccountsItem extends StatelessWidget {
if (confirm) {
await securityCheck(
context: context,
title: l10n.typeYourPINCodeToAuthenticate,
localAuthApi: LocalAuthApi(),
onSuccess: () {
Navigator.of(context).push<void>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class ResetWalletView extends StatelessWidget {
? () async {
await securityCheck(
context: context,
title: l10n.typeYourPINCodeToAuthenticate,
localAuthApi: LocalAuthApi(),
onSuccess: () async {
await resetWallet(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class _JWKThumbprintP256KeyPageState extends State<JWKThumbprintP256KeyPage>
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
l10n.did,
l10n.jwk,
style: Theme.of(context).textTheme.headlineSmall,
),
const SizedBox(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class DidPrivateKey extends StatelessWidget {
if (confirm) {
await securityCheck(
context: context,
title: l10n.typeYourPINCodeToAuthenticate,
localAuthApi: LocalAuthApi(),
onSuccess: () {
Navigator.push<void>(context, route);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:convert';

import 'package:altme/app/app.dart';
import 'package:altme/dashboard/dashboard.dart';
import 'package:altme/dashboard/drawer/ssi/verifiers_metadata/view/verifiers_metadata_page.dart';
import 'package:flutter/material.dart';

class Oidc4vcSettingMenu extends StatelessWidget {
Expand Down Expand Up @@ -48,6 +49,7 @@ class Oidc4vcSettingMenuView extends StatelessWidget {
const ProofHeaderWidget(),
const PushAuthorizationRequesWidget(),
const StatusListCachingWidget(),
//const DPopSupoprtWidget(),
DrawerItem(
title: 'Wallet metadata for issuers',
onTap: () {
Expand All @@ -65,15 +67,7 @@ class Oidc4vcSettingMenuView extends StatelessWidget {
DrawerItem(
title: 'Wallet metadata for verifiers',
onTap: () {
final value = const JsonEncoder.withIndent(' ').convert(
ConstantsJson.walletMetadataForVerifiers,
);
Navigator.of(context).push<void>(
JsonViewerPage.route(
title: 'Wallet metadata for verifiers',
data: value,
),
);
Navigator.of(context).push<void>(VerifiersMetadataPage.route());
},
),
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import 'package:altme/dashboard/dashboard.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

class DPopSupoprtWidget extends StatelessWidget {
const DPopSupoprtWidget({super.key});

@override
Widget build(BuildContext context) {
return BlocBuilder<ProfileCubit, ProfileState>(
builder: (context, state) {
return OptionContainer(
title: 'Demonstrating Proof of Possession (DPoP)',
subtitle: 'Enable to protect code and access token.',
body: Switch(
onChanged: (value) async {
await context.read<ProfileCubit>().updateProfileSetting(
dpopSupport: value,
);
},
value: state.model.profileSetting.selfSovereignIdentityOptions
.customOidc4vcProfile.dpopSupport,
activeColor: Theme.of(context).colorScheme.primary,
),
);
},
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export 'client_type_widget.dart';
export 'confidential_client_widget.dart';
export 'cryptograhic_holder_binding.dart';
export 'did_key_type_widget.dart';
export 'dpop_support_widget.dart';
export 'draft_type_widget.dart';
export 'option_container.dart';
export 'proof_header_widget.dart';
Expand Down
1 change: 1 addition & 0 deletions lib/dashboard/drawer/ssi/ssi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export 'manage_did/manage_did.dart';
export 'oidc4vc_settngs/oidc4vc_settings.dart';
export 'src/src.dart';
export 'trust_framework/trust_framework.dart';
export 'verifiers_metadata/verifiers_metadata.dart';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export 'view/verifiers_metadata_page.dart';
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import 'dart:convert';

import 'package:altme/app/app.dart';
import 'package:altme/dashboard/dashboard.dart';
import 'package:dio/dio.dart';

import 'package:flutter/material.dart';
import 'package:secure_storage/secure_storage.dart';

class VerifiersMetadataPage extends StatelessWidget {
const VerifiersMetadataPage({super.key});

static Route<dynamic> route() => MaterialPageRoute<void>(
builder: (_) => const VerifiersMetadataPage(),
settings: const RouteSettings(name: '/VerifiersMetadataPage'),
);

@override
Widget build(BuildContext context) {
return const VerifiersMetadataView();
}
}

class VerifiersMetadataView extends StatelessWidget {
const VerifiersMetadataView({super.key});

Future<String> getData() async {
try {
final response = await DioClient(
secureStorageProvider: getSecureStorage,
dio: Dio(),
).get(Parameters.walletMetadataForVerifier);
final data = response is String
? jsonDecode(response) as Map<String, dynamic>
: response as Map<String, dynamic>;
final value = const JsonEncoder.withIndent(' ').convert(data);
return value;
} catch (e) {
return '';
}
}

@override
Widget build(BuildContext context) {
return BasePage(
title: 'Wallet metadata for verifiers',
titleAlignment: Alignment.topCenter,
titleLeading: const BackLeadingButton(),
padding: const EdgeInsets.only(
top: 0,
bottom: Sizes.spaceSmall,
left: Sizes.spaceSmall,
right: Sizes.spaceSmall,
),
secureScreen: true,
body: FutureBuilder<String>(
future: getData(),
builder: (context, snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.done:
return JsonViewWidget(data: snapshot.data.toString());

case ConnectionState.waiting:
case ConnectionState.none:
case ConnectionState.active:
return const Center(child: CircularProgressIndicator());
}
},
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';

Future<void> securityCheck({
required BuildContext context,
required String title,
required VoidCallback onSuccess,
required LocalAuthApi localAuthApi,
}) async {
Expand All @@ -19,6 +20,7 @@ Future<void> securityCheck({
case WalletProtectionType.FA2:
await Navigator.of(context).push<void>(
PinCodePage.route(
title: title,
isValidCallback: onSuccess.call,
restrictToBack: false,
walletProtectionType: walletProtectionType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class WalletSecurityView extends StatelessWidget {
onTap: () async {
await securityCheck(
context: context,
title: l10n.typeYourPINCodeToAuthenticate,
localAuthApi: LocalAuthApi(),
onSuccess: () {
Navigator.of(context)
Expand Down Expand Up @@ -78,6 +79,7 @@ class WalletSecurityView extends StatelessWidget {
if (confirm) {
await securityCheck(
context: context,
title: l10n.typeYourPINCodeToAuthenticate,
localAuthApi: LocalAuthApi(),
onSuccess: () {
Navigator.of(context)
Expand All @@ -102,6 +104,7 @@ class WalletSecurityView extends StatelessWidget {
onTap: () async {
await securityCheck(
context: context,
title: l10n.typeYourPINCodeToAuthenticate,
localAuthApi: LocalAuthApi(),
onSuccess: () {
Navigator.of(context).push<void>(
Expand Down
Loading
Loading