-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Talwinder Kaur <[email protected]>
- Loading branch information
1 parent
936b08f
commit 3151bfd
Showing
5 changed files
with
198 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,37 +61,49 @@ void main() async { | |
} | ||
}''',); | ||
|
||
final credentials = (await walletSDKPlugin.requestCredential('', attestationVC: attestationVC)).map((e) => e.content).toList(); | ||
|
||
expect(credentials, hasLength(greaterThan(0))); | ||
|
||
String verificationURL = verificationURLsList[i]; | ||
print('verificationURL : $verificationURL'); | ||
|
||
await walletSDKPlugin.processAuthorizationRequest(authorizationRequest: verificationURL); | ||
|
||
final requirements = await walletSDKPlugin.getSubmissionRequirements(storedCredentials: credentials); | ||
|
||
print('getSubmissionRequirements finished'); | ||
|
||
expect(requirements, hasLength(equals(1))); | ||
expect(requirements[0].inputDescriptors, hasLength(equals(1))); | ||
expect(requirements[0].inputDescriptors[0].matchedVCsID, hasLength(equals(1))); | ||
var customScopesList = { | ||
'registration': jsonEncode({'email': '[email protected]'}), | ||
}; | ||
|
||
await walletSDKPlugin.presentCredential( | ||
selectedCredentials: credentials, customScopeList: customScopesList, attestationVC: attestationVC); | ||
List<String> credentials; | ||
await tester.runAsync(() async { | ||
credentials = (await walletSDKPlugin.requestCredential('', attestationVC: attestationVC)) | ||
.map((e) => e.content) | ||
.toList(); | ||
print('credentials'); | ||
expect(credentials, hasLength(greaterThan(0))); | ||
|
||
String verificationURL = verificationURLsList[i]; | ||
print('verificationURL : $verificationURL'); | ||
|
||
final l = await walletSDKPlugin.processAuthorizationRequest(authorizationRequest: verificationURL); | ||
print('processAuthorizationRequest --> : $l'); | ||
|
||
// Add another delay if needed | ||
await Future.delayed(Duration(seconds: 2)); | ||
|
||
final requirements = await walletSDKPlugin.getSubmissionRequirements(storedCredentials: credentials); | ||
print('getSubmissionRequirements finished'); | ||
|
||
expect(requirements, hasLength(equals(1))); | ||
expect(requirements[0].inputDescriptors, hasLength(equals(1))); | ||
expect(requirements[0].inputDescriptors[0].matchedVCsID, hasLength(equals(1))); | ||
|
||
var customScopesList = { | ||
'registration': jsonEncode({'email': '[email protected]'}), | ||
}; | ||
await walletSDKPlugin.presentCredential( | ||
selectedCredentials: credentials, customScopeList: customScopesList, attestationVC: attestationVC); | ||
print('credential presented'); | ||
}); | ||
} | ||
}); | ||
}, | ||
timeout: Timeout.none ); | ||
|
||
testWidgets('Testing openid4vc with multiple credentials', (tester) async { | ||
const didMethodTypes = String.fromEnvironment('WALLET_DID_METHODS'); | ||
var didMethodTypesList = didMethodTypes.split(' '); | ||
String didMethodType = didMethodTypesList[0]; | ||
print('wallet DID type : $didMethodType'); | ||
print('wallet DID Key type : $didKeyType'); | ||
|
||
await Future.delayed(Duration(seconds: 2)); | ||
var didDocData = await walletSDKPlugin.createDID(didMethodTypesList[0], didKeyType); | ||
var didContent = didDocData.did; | ||
print('wallet DID : $didContent'); | ||
|
@@ -118,7 +130,7 @@ void main() async { | |
|
||
credentials.addAll(requestdCreds.map((e) => e.content).toList()); | ||
} | ||
print('issued credentials: $credentials'); | ||
print('issued credentials'); | ||
|
||
const verificationURLs = String.fromEnvironment('INITIATE_VERIFICATION_URLS_MULTIPLE_CREDS'); | ||
var verificationURLsList = verificationURLs.split(' '); | ||
|
@@ -140,8 +152,10 @@ void main() async { | |
'testscope': jsonEncode({'data': 'testdata'}), | ||
}; | ||
|
||
// Add a delay before presenting credentials | ||
await Future.delayed(Duration(seconds: 2)); | ||
await walletSDKPlugin.presentCredential(selectedCredentials: matchedCreds, customScopeList: customScopesList); | ||
}); | ||
}, timeout: Timeout.none ); | ||
|
||
testWidgets('Testing openid4vc with the auth code flow', (tester) async { | ||
const didMethodTypes = String.fromEnvironment('WALLET_DID_METHODS'); | ||
|
@@ -204,5 +218,5 @@ void main() async { | |
} | ||
|
||
expect(credential, hasLength(greaterThan(0))); | ||
}); | ||
}, timeout: Timeout.none ); | ||
} |
Oops, something went wrong.