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

Symorton/presentation sample flow #21

Merged
merged 385 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
385 commits
Select commit Hold shift + click to select a range
8e18c6c
Merge branch 'symorton/attestationdescriptormapping' into symorton/ad…
symorton Feb 15, 2023
56bf18b
Update WalletLibraryDemo.entitlements
symorton Feb 16, 2023
aa3d740
Create extension of Issuance Response Container.
symorton Feb 16, 2023
228a48c
create ContractResponder
symorton Feb 16, 2023
93a8a11
Update AccessTokenRequirement.swift
symorton Feb 16, 2023
007c800
Add comment to Group Requirement.
symorton Feb 16, 2023
3e31ffb
Add validation to IdTokenRequirement.
symorton Feb 16, 2023
d10853a
Update PinRequirement.swift
symorton Feb 16, 2023
a7c9638
Update SelfAttestedClaimRequirement.swift
symorton Feb 16, 2023
1b2b1b7
Update IssuanceResponseContainer+RequestContent.swift
symorton Feb 16, 2023
0a92bf9
Make VerifiedIdIssuanceRequest public.
symorton Feb 16, 2023
622fa65
Update name to manifestService
symorton Feb 16, 2023
d386804
Begin complete implementation on ContractIssuanceRequest
symorton Feb 16, 2023
b65cd29
Update ContractResponder.swift
symorton Feb 16, 2023
3b836dd
Update IssuanceService+Contract.swift
symorton Feb 16, 2023
050eca3
Update project.pbxproj
symorton Feb 16, 2023
5492865
Rename Classes.
symorton Feb 16, 2023
106f272
Replace contract noun with manifest.
symorton Feb 16, 2023
8a592e7
add manifestService
symorton Feb 16, 2023
604746c
ContractResponder --> VerifiedIdRequester.
symorton Feb 16, 2023
2a28230
Fix naming in tests.
symorton Feb 16, 2023
e502402
Add errors to IssuanceResponseContainer extension.
symorton Feb 16, 2023
20953fd
RawContract --> RawManifest
symorton Feb 16, 2023
385f3e5
Update IssuanceService+Contract.swift
symorton Feb 16, 2023
2a8f865
Update project.pbxproj
symorton Feb 16, 2023
cab10d8
Split Issuance Service extensions.
symorton Feb 16, 2023
99061e5
Update ManifestResolver.swift
symorton Feb 16, 2023
640a41f
Update folder structure for manifest.
symorton Feb 16, 2023
f4ad149
Make IssuanceResponseContainer and param in ContractIssuanceRequest i…
symorton Feb 16, 2023
c927e42
Create VerifiableCredential.swift
symorton Feb 16, 2023
5495972
Update MockContractResolver.swift
symorton Feb 16, 2023
da6cd08
Update OpenIdRequestHandler.swift
symorton Feb 16, 2023
88b5f2e
Update name of IssuanceResponseContainer extension.
symorton Feb 16, 2023
08bef64
Merge branch 'dev' into symorton/addValidationToRequirements
symorton Feb 16, 2023
216989a
Fix error strings in IssuanceResponseContainer.
symorton Feb 16, 2023
b0320ea
Update IssuanceService+ManifestResolver.swift
symorton Feb 16, 2023
67105af
Add error to Issuance Service extension.
symorton Feb 16, 2023
a188dde
Update vc requester comments.
symorton Feb 16, 2023
4b70143
Separate manifest resolver and vc requester in open id handler.
symorton Feb 16, 2023
f8373c3
Update ContractIssuanceRequest.swift
symorton Feb 16, 2023
8aa0954
Update VerifiedIdClientBuilder.swift
symorton Feb 16, 2023
5af185c
Update tests with new data models.
symorton Feb 16, 2023
04e9275
Complete test cases for pin requirement.
symorton Feb 16, 2023
ac37a8b
Complete test cases for id token requirement.
symorton Feb 16, 2023
d063a7a
Complete test cases for access token requirement.
symorton Feb 16, 2023
738021f
Complete test cases for SelfAttestedClaimRequirement.
symorton Feb 16, 2023
64560ef
Complete test cases for Group Requirement.
symorton Feb 16, 2023
95e5752
Complete test cases for Issuance Response Container Extension.
symorton Feb 17, 2023
4295261
Fix nits before PR.
symorton Feb 17, 2023
99e299a
Add comments to requirements.
symorton Feb 17, 2023
4409d66
Update MockVerifiableCredentialRequester.swift
symorton Feb 17, 2023
ed64163
Update VerifiableCredential-SDK-iOS
symorton Feb 17, 2023
c938793
Update PresentationRequest+MappableTests.swift
symorton Feb 17, 2023
5148668
Add app icon to test app.
symorton Feb 22, 2023
5e98860
Add functionality to test app.
symorton Feb 22, 2023
ebcf067
Support id token hint flow in issuance response container extension.
symorton Feb 22, 2023
c627c00
Remove scope as required value in id token descriptor mapping.
symorton Feb 22, 2023
44756e9
Support id token hint flow in presentation request mapping.
symorton Feb 22, 2023
5ebc105
Update VerifiedIdRequest.swift
symorton Feb 22, 2023
1e0dcf1
Support id token hint flow in OpenIdRequestHandler.
symorton Feb 22, 2023
9dcf2b1
Implement isSatisfied in ContractIssuanceRequest.
symorton Feb 22, 2023
350d5da
Update IdTokenRequirement.swift
symorton Feb 22, 2023
e78765c
Support id token hint flow in VerifiedIdRequestContent.
symorton Feb 22, 2023
55bf5b4
Add VC mapping.
symorton Feb 22, 2023
adac1e1
Create InjectedIdToken.
symorton Feb 22, 2023
744773c
Create file for RequestView.
symorton Feb 22, 2023
2ee900c
Create RequirementView.swift
symorton Feb 22, 2023
a039d37
Update ContentView.swift
symorton Feb 22, 2023
9cedd3f
Update RequirementState.swift
symorton Feb 22, 2023
2d86172
Update comments in SampleViewModel.
symorton Feb 22, 2023
dc41457
Add Verified Id Type.
symorton Feb 23, 2023
30cf908
Update VerifiedId.swift
symorton Feb 23, 2023
c49fb18
Implement mapping for VerifiableCredential.
symorton Feb 23, 2023
3561f0b
Update VerifiedIdClaim.swift
symorton Feb 23, 2023
41caadc
Add showing Verified Id on Request View.
symorton Feb 23, 2023
ca5aa4e
Update RequirementState.swift
symorton Feb 23, 2023
7a3ca69
Update ContentView.swift
symorton Feb 23, 2023
a4ca47b
Update SampleViewModel.swift
symorton Feb 23, 2023
83b29de
Update how we import VC SDK.
symorton Feb 24, 2023
5b2af96
Make VerifiedId a protocol.
symorton Feb 24, 2023
275aec8
VerifiableCredential conforms to Verified Id
symorton Feb 24, 2023
f1cb00c
Update IdTokenDescriptor+MappableTests.swift
symorton Feb 24, 2023
8c2d0c2
Update classes who depend on VC.
symorton Feb 24, 2023
748d75b
Add Error View to test app.
symorton Feb 24, 2023
8447c01
Update request view.
symorton Feb 24, 2023
1d56075
Update requirements view.
symorton Feb 24, 2023
22993a9
Create RequirementListCellView.swift
symorton Feb 24, 2023
d30ef37
Make RequirementState an ObservableObject.
symorton Feb 24, 2023
171d7c0
Create SuccessView.swift
symorton Feb 24, 2023
d057f81
make getClaims a functions instead of property.
symorton Feb 24, 2023
5532d85
Update VerifiableCredential-SDK-iOS
symorton Feb 24, 2023
fb7d948
Add PinDescriptor mapping.
symorton Feb 24, 2023
26afa38
Update IssuanceResponseContainer+WalletLibrary.swift
symorton Feb 24, 2023
6ac88fd
Add PinDescriptor mapping to presentation request mapping.
symorton Feb 24, 2023
9d3fb3c
Update IssuanceResponseContainerExtensionTests.swift
symorton Feb 24, 2023
436157c
Create PinDescriptor+MappableTests.swift
symorton Feb 24, 2023
3aa173a
Update PresentationRequest+MappableTests.swift
symorton Feb 24, 2023
edb6908
Complete test cases for ContractIssuanceRequest.
symorton Feb 24, 2023
e148be1
Add protocol for IssuanceResponseContaining.
symorton Feb 25, 2023
1fdddfd
Update IssuanceResponseContainer+WalletLibrary.swift
symorton Feb 25, 2023
1f1ed09
Update naming.
symorton Feb 25, 2023
59c7244
Update naming.
symorton Feb 25, 2023
8a02caf
Add mocks.
symorton Feb 25, 2023
73adf67
Update naming.
symorton Feb 25, 2023
0fbdd8e
Update VerifiedIdRequestContent.swift
symorton Feb 25, 2023
63f74ba
Update VerifiableCredential.swift
symorton Feb 25, 2023
cf6ebd0
Update VerifiedId.swift
symorton Feb 25, 2023
b28594b
Update VerifiedIdClaim.swift
symorton Feb 25, 2023
c588da2
Create VerifiableCredentialTests.swift
symorton Feb 25, 2023
7da70d7
Update VerifiableCredential-SDK-iOS
symorton Feb 25, 2023
2bcdc0d
Update VerifiableCredentialTests.swift
symorton Feb 28, 2023
a899499
Merge branch 'dev' into symorton/testAppPart1
symorton Feb 28, 2023
0bd2bc8
Update InjectedIdToken.swift
symorton Feb 28, 2023
b445df6
Add IdTokenHint logic to IssuanceResponseContainer extension.
symorton Feb 28, 2023
79ce634
Update IdTokenDescriptor+Mappable.swift
symorton Feb 28, 2023
7448c6e
Create PinDescriptor+Mappable.swift
symorton Feb 28, 2023
12cfd54
Add IdTokenHint logic to presentation request extension.
symorton Feb 28, 2023
ff856e3
Update IssuanceService+VerifiableCredentialRequester.swift
symorton Feb 28, 2023
1529611
Create IssuanceResponseContaining.swift
symorton Feb 28, 2023
3cdcdc7
Update ManifestResolver.swift
symorton Feb 28, 2023
46f80c5
Create VerifiedIdRequester protocol.
symorton Feb 28, 2023
3db52cc
Add IdTokenHint logic to OpenIdRequestHandler.
symorton Feb 28, 2023
bedaa18
Add isSatisfied logic to ContractIssuanceRequest.
symorton Feb 28, 2023
46a4e1e
Update VerifiableCredential-SDK-iOS
symorton Feb 28, 2023
ad29d99
Create InjectedIdToken.swift
symorton Feb 28, 2023
f7681ab
Update GroupRequirement.swift
symorton Feb 28, 2023
bbafc7c
Update IdTokenRequirement.swift
symorton Feb 28, 2023
a7196c7
Update VerifiedIdRequestContent.swift
symorton Feb 28, 2023
5426f72
Update mocks.
symorton Feb 28, 2023
b32e061
Add IdTokenHint logic to IssuanceResponseContainer extension tests.
symorton Feb 28, 2023
edea293
Update IdTokenDescriptor+MappableTests.swift
symorton Feb 28, 2023
d6080e3
Create PinDescriptor+MappableTests.swift
symorton Feb 28, 2023
4224523
Add IdTokenHint logic to presentation request extension tests.
symorton Feb 28, 2023
ef28ff0
Make VerifiedId a protocol.
symorton Feb 28, 2023
b9415c9
Update OpenIdRequestHandlerTests.swift
symorton Feb 28, 2023
e618d0e
Update Resolver tests.
symorton Feb 28, 2023
d5f0b44
Create VerifiableCredentialTests.swift
symorton Feb 28, 2023
ebed072
Fix comment in IssuanceResponseContaining.
symorton Feb 28, 2023
ce8a7cb
Fix naming in ContractIssuanceRequest.
symorton Feb 28, 2023
a07e0aa
Fix error name in VerifiableCredentialError.
symorton Feb 28, 2023
a5dd7e4
Update VerifiedIdRequester.swift
symorton Feb 28, 2023
9618851
Remove VerifiedIdType.
symorton Feb 28, 2023
82127c3
Merge branch 'symorton/idTokenHint' into symorton/testAppPart1
symorton Feb 28, 2023
4073ce8
Update SampleViewModel naming.
symorton Feb 28, 2023
f54a3da
Merge branch 'dev' into symorton/testAppPart1
symorton Mar 7, 2023
3356d5a
update vc sdk git commit.
symorton Mar 7, 2023
7d15b57
Remove Verified Id Type.
symorton Mar 7, 2023
109a4a5
Create extension for PresentationResponseContainer.
symorton Mar 8, 2023
3207ca6
Update PresentationRequest+OpenIdRawRequest.swift
symorton Mar 8, 2023
ee78dc7
Update IssuanceRequest+Mappable.swift
symorton Mar 8, 2023
0acf33c
Update PresentationDescriptor+Mappable.swift
symorton Mar 8, 2023
7455a09
Add id to VerifiedIdRequirement
symorton Mar 8, 2023
13a3fa1
Update PresentationRequest+Mappable.swift
symorton Mar 8, 2023
75071a5
Update PresentationService+OpenIdForVC.swift
symorton Mar 8, 2023
9230730
Update OpenIdForVCResponder.swift
symorton Mar 8, 2023
ee29efc
Make OpenIdRawRequest conform to RawRequest.
symorton Mar 8, 2023
7c0e700
Make RawManifest conform to RawRequest.
symorton Mar 8, 2023
caf5d81
Update OpenIdRequestHandler.swift
symorton Mar 8, 2023
e8e8a59
Update ContractIssuanceRequest.swift
symorton Mar 8, 2023
a320735
Implement complete method for openIdPresentationRequest.
symorton Mar 8, 2023
743e61c
Update VerifiedIdRequestContent.swift
symorton Mar 8, 2023
913a19b
Update VerifiedIdClientBuilder.swift
symorton Mar 8, 2023
0e23abe
Update tests to include id.
symorton Mar 8, 2023
0137bd1
Update MockRawManifest.swift
symorton Mar 8, 2023
3874a36
Create MockPresentationResponder.swift
symorton Mar 8, 2023
dabbe29
Update MockRawRequest.swift
symorton Mar 8, 2023
063c046
Update MockOpenIdRawRequest.swift
symorton Mar 8, 2023
a8a744b
Update MockResolver.swift
symorton Mar 8, 2023
6a13c55
Update tests.
symorton Mar 8, 2023
4cced2f
Remove raw value idea from content.
symorton Mar 8, 2023
0d9533a
Update PresentationService+OpenIdForVC.swift
symorton Mar 8, 2023
eaa579a
Rename to OpenIdResponder.
symorton Mar 8, 2023
e9b3601
Update OpenIdRequestHandler.swift
symorton Mar 8, 2023
d30f24f
Inject raw value into OpenIdPresentationRequest.
symorton Mar 8, 2023
95d1c94
Remove raw value in content idea.
symorton Mar 8, 2023
3c53dc1
fix tests.
symorton Mar 8, 2023
9bbc810
Update project.pbxproj
symorton Mar 8, 2023
04027c6
Move some folders around.
symorton Mar 8, 2023
3171245
Update name of an error on PresentationResponseContainer.
symorton Mar 8, 2023
0f2b258
Create PresentationResponse.swift
symorton Mar 8, 2023
7b6956c
Remove RawRequest from RawManifest.
symorton Mar 8, 2023
d38bb1e
Remove RawRequest idea from OpenIdRawRequest.
symorton Mar 8, 2023
d2c6432
Fix comment in openIdResponder.
symorton Mar 8, 2023
34033de
Fix naming in OpenIdRequestHandler.
symorton Mar 8, 2023
1d362d5
Update AttestationsDescriptor+MappableTests.swift
symorton Mar 8, 2023
9312fbb
Update PresentationDefinition+MappableTests.swift
symorton Mar 8, 2023
f2b6255
Move factories to different folder.
symorton Mar 8, 2023
c7a1993
Split up Issuance and Presentation Request Content.
symorton Mar 8, 2023
d5f123e
Fix mock resolver.
symorton Mar 8, 2023
d468dec
Update name of param in OpenIdRequestHandler.
symorton Mar 8, 2023
0a38249
Move some files changes to new PR.
symorton Mar 8, 2023
471d31e
Create PresentationResponseContainer extension.
symorton Mar 8, 2023
02fac99
Remove code to be added in next pr.
symorton Mar 8, 2023
0cedd82
Fix tests.
symorton Mar 8, 2023
9f574d5
Add placeholder files for extension and content tests.
symorton Mar 9, 2023
88fa301
Update PresentationResponseContainer+WalletLibrary.swift
symorton Mar 9, 2023
9ec9826
Update IssuanceRequestContent.swift
symorton Mar 9, 2023
463f6d3
Complete test cases for issuance request content.
symorton Mar 9, 2023
db429d3
fix nits before PR.
symorton Mar 9, 2023
558e1a0
Implement methods in VerifiedIdRequirement.
symorton Mar 9, 2023
4552f02
Update IssuanceRequestContent.swift
symorton Mar 9, 2023
814137c
Add id and constraints to VerifiedIdRequirement instances.
symorton Mar 9, 2023
3b0b2b7
Add type constraint to PresentationDescriptor.
symorton Mar 10, 2023
6bee9a7
Add type constraint to PresentationInputDescriptor.
symorton Mar 10, 2023
ac7068e
Create type constraint.
symorton Mar 10, 2023
5cb11b3
Add type property to VerifiableCredential.
symorton Mar 10, 2023
559cdc5
Add VerifiedIdConstraint protocol.
symorton Mar 13, 2023
1d26ad3
Create VCTypeConstraint.swift
symorton Mar 13, 2023
40a95c8
Create VerifiedIdGroupConstraint.swift
symorton Mar 13, 2023
f9d5544
Implement isSatisfied and complete on openid presentation request.
symorton Mar 13, 2023
2241e0a
Update VerifiedIdRequirement.swift
symorton Mar 13, 2023
cf17d1f
Add unit tests for constraints mapping for issuance and presentation.
symorton Mar 13, 2023
18e8898
Add MockConstraint.
symorton Mar 13, 2023
23b7e74
Complete test cases for VCTypeConstraint.
symorton Mar 13, 2023
396bb0e
Complete test cases for group constraint.
symorton Mar 13, 2023
c68a260
Update constraint protocol.
symorton Mar 13, 2023
54bdf81
Implement doesMatch for group constraint.
symorton Mar 13, 2023
648b29c
Create Helper for VC Creation.
symorton Mar 13, 2023
3e433a7
Implement add Verified id to Presentation Response.
symorton Mar 13, 2023
2fe01e1
Update VCTypeConstraintTests.swift
symorton Mar 13, 2023
6ad07f8
Move Contract tests to different folder.
symorton Mar 13, 2023
bbfcb86
Complete test cases for open id presentation request.
symorton Mar 13, 2023
20653d9
Complete test cases for VerifiedIdRequirement methods.
symorton Mar 14, 2023
0f8e1f1
Update presentation response container tests.
symorton Mar 14, 2023
e59da1e
Update error in PresentatioResponseContainer extension.
symorton Mar 14, 2023
aa169b9
Rename VerifiedIdGroupConstraint to GroupConstraint
symorton Mar 14, 2023
a6d7fac
Fix test formats.
symorton Mar 14, 2023
d37b91e
Add comments to VerifiedIdRequirement.
symorton Mar 14, 2023
362aa4c
Add comments to constraints.
symorton Mar 14, 2023
7cf3e37
Merge branch 'dev' into symorton/VerifiedIdConstraints
symorton Mar 14, 2023
6085cdc
Create VerifiedIdRepository.
symorton Mar 17, 2023
7a262c2
Create a VerifiedIdDecoder that is public.
symorton Mar 17, 2023
f9aee15
Update project files.
symorton Mar 17, 2023
c2a7b05
Create new files for VerifiedId.
symorton Mar 17, 2023
43283de
Add fulfill for Verifid id to requirement state.
symorton Mar 17, 2023
7f2b9d4
Add ViewState.
symorton Mar 17, 2023
eaa1bef
Add VerifiedId list to ContentView.
symorton Mar 17, 2023
ebbed77
Add ViewState to RequestView.
symorton Mar 17, 2023
112749f
Add verified id requirement support to RequirementView.
symorton Mar 17, 2023
849bd48
Create VerifiedIdView.
symorton Mar 17, 2023
de03973
Change name of in progress to update.
symorton Mar 20, 2023
d4c471e
Merge branch 'dev' into symorton/presentationSampleFlow
symorton Mar 20, 2023
72d24f2
Removed VerifiedId Decoder for next PR.
symorton Mar 20, 2023
edfe2f7
Split View up into separate views.
symorton Mar 20, 2023
e60f498
Only show issued verified id list if there is one.
symorton Mar 20, 2023
5d72c07
Update SampleViewModel.swift
symorton Mar 20, 2023
2d57fd3
Create VerifiedIdRequirementPicker
symorton Mar 20, 2023
8935a29
Add comments to SampleViewModel.
symorton Mar 20, 2023
84f6b2b
Update RequirementView.
symorton Mar 20, 2023
bcd0edc
Remove EncodedVerifiedId for next PR.
symorton Mar 20, 2023
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
24 changes: 20 additions & 4 deletions Demo/WalletLibraryDemo/WalletLibraryDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
objects = {

/* Begin PBXBuildFile section */
552A75BB29C50DBA005BFF3D /* VerifiedIdRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = 552A75BA29C50DB9005BFF3D /* VerifiedIdRepository.swift */; };
552A760629C8E32C005BFF3D /* RequirementListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 552A760529C8E32C005BFF3D /* RequirementListView.swift */; };
552A760829C8E3B5005BFF3D /* UserInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 552A760729C8E3B5005BFF3D /* UserInputView.swift */; };
552A760C29C8F70E005BFF3D /* VerifiedIdPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 552A760B29C8F70E005BFF3D /* VerifiedIdPickerView.swift */; };
553CC08929A94686005A5FD6 /* ErrorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 553CC08829A94686005A5FD6 /* ErrorView.swift */; };
553CC08B29A9469B005A5FD6 /* SuccessView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 553CC08A29A9469B005A5FD6 /* SuccessView.swift */; };
553CC08B29A9469B005A5FD6 /* VerifiedIdView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 553CC08A29A9469B005A5FD6 /* VerifiedIdView.swift */; };
553CC08D29A94A13005A5FD6 /* RequirementListCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 553CC08C29A94A13005A5FD6 /* RequirementListCellView.swift */; };
5585BDE129A047370059710B /* SampleViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5585BDE029A047370059710B /* SampleViewModel.swift */; };
5585BDE529A692E10059710B /* RequirementState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5585BDE429A692E10059710B /* RequirementState.swift */; };
Expand Down Expand Up @@ -39,8 +43,12 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
552A75BA29C50DB9005BFF3D /* VerifiedIdRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VerifiedIdRepository.swift; sourceTree = "<group>"; };
552A760529C8E32C005BFF3D /* RequirementListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequirementListView.swift; sourceTree = "<group>"; };
552A760729C8E3B5005BFF3D /* UserInputView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserInputView.swift; sourceTree = "<group>"; };
552A760B29C8F70E005BFF3D /* VerifiedIdPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VerifiedIdPickerView.swift; sourceTree = "<group>"; };
553CC08829A94686005A5FD6 /* ErrorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorView.swift; sourceTree = "<group>"; };
553CC08A29A9469B005A5FD6 /* SuccessView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuccessView.swift; sourceTree = "<group>"; };
553CC08A29A9469B005A5FD6 /* VerifiedIdView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VerifiedIdView.swift; sourceTree = "<group>"; };
553CC08C29A94A13005A5FD6 /* RequirementListCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequirementListCellView.swift; sourceTree = "<group>"; };
5585BDE029A047370059710B /* SampleViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleViewModel.swift; sourceTree = "<group>"; };
5585BDE429A692E10059710B /* RequirementState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequirementState.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -75,8 +83,11 @@
553CC08829A94686005A5FD6 /* ErrorView.swift */,
5585BDFD29A6C4CA0059710B /* RequestView.swift */,
553CC08C29A94A13005A5FD6 /* RequirementListCellView.swift */,
552A760529C8E32C005BFF3D /* RequirementListView.swift */,
5585BDFF29A6C5070059710B /* RequirementView.swift */,
553CC08A29A9469B005A5FD6 /* SuccessView.swift */,
553CC08A29A9469B005A5FD6 /* VerifiedIdView.swift */,
552A760729C8E3B5005BFF3D /* UserInputView.swift */,
552A760B29C8F70E005BFF3D /* VerifiedIdPickerView.swift */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -106,6 +117,7 @@
55E33699293E8F7500CD2ED7 /* Persistence.swift */,
5585BDE429A692E10059710B /* RequirementState.swift */,
5585BDE029A047370059710B /* SampleViewModel.swift */,
552A75BA29C50DB9005BFF3D /* VerifiedIdRepository.swift */,
55E33697293E8F7500CD2ED7 /* WalletLibraryDemoApp.swift */,
55E336A0293E8F7700CD2ED7 /* Assets.xcassets */,
55E336A2293E8F7700CD2ED7 /* WalletLibraryDemo.entitlements */,
Expand Down Expand Up @@ -204,12 +216,16 @@
files = (
5585BDFE29A6C4CA0059710B /* RequestView.swift in Sources */,
55E3369D293E8F7500CD2ED7 /* WalletLibraryDemo.xcdatamodeld in Sources */,
553CC08B29A9469B005A5FD6 /* SuccessView.swift in Sources */,
553CC08B29A9469B005A5FD6 /* VerifiedIdView.swift in Sources */,
55E33698293E8F7500CD2ED7 /* WalletLibraryDemoApp.swift in Sources */,
552A75BB29C50DBA005BFF3D /* VerifiedIdRepository.swift in Sources */,
552A760629C8E32C005BFF3D /* RequirementListView.swift in Sources */,
55E3369F293E8F7500CD2ED7 /* ContentView.swift in Sources */,
5585BE0029A6C5070059710B /* RequirementView.swift in Sources */,
5585BDE529A692E10059710B /* RequirementState.swift in Sources */,
552A760C29C8F70E005BFF3D /* VerifiedIdPickerView.swift in Sources */,
55E3369A293E8F7500CD2ED7 /* Persistence.swift in Sources */,
552A760829C8E3B5005BFF3D /* UserInputView.swift in Sources */,
553CC08929A94686005A5FD6 /* ErrorView.swift in Sources */,
553CC08D29A94A13005A5FD6 /* RequirementListCellView.swift in Sources */,
5585BDE129A047370059710B /* SampleViewModel.swift in Sources */,
Expand Down
23 changes: 21 additions & 2 deletions Demo/WalletLibraryDemo/WalletLibraryDemo/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ struct ContentView: View {

@StateObject private var viewModel = SampleViewModel()

@State private var input: String = ""

var body: some View {
NavigationView {
VStack {
Text("Sample Request URL:")
TextField(
"OpenId Request URL",
text: $viewModel.input,
text: $input,
axis: .vertical
)
.padding(EdgeInsets(top: 5, leading: 5, bottom: 5, trailing: 5))
Expand All @@ -29,8 +31,25 @@ struct ContentView: View {
NavigationLink(destination: RequestView()) {
Text("Create Request")
}.navigationTitle("Verified Id Sample App")
Spacer()
if !viewModel.issuedVerifiedIds.isEmpty {
Text("Issued Verified Ids")
.bold()
List {
ForEach(viewModel.issuedVerifiedIds, id: \.id) { verifiedId in
NavigationLink {
VerifiedIdView(verifiedId: verifiedId)
} label: {
Text(verifiedId.id)
}
}.onDelete { indexSet in
viewModel.deleteVerifiedId(indexSet: indexSet)
}
}
.listStyle(.inset)
}
}.onDisappear {
viewModel.createRequest()
viewModel.createRequest(fromInput: input)
}
}
.environmentObject(viewModel)
Expand Down
18 changes: 0 additions & 18 deletions Demo/WalletLibraryDemo/WalletLibraryDemo/Persistence.swift
symorton marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,6 @@ import CoreData
struct PersistenceController {
static let shared = PersistenceController()

static var preview: PersistenceController = {
let result = PersistenceController(inMemory: true)
let viewContext = result.container.viewContext
for _ in 0..<10 {
let newItem = Item(context: viewContext)
newItem.timestamp = Date()
}
do {
try viewContext.save()
} catch {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
let nsError = error as NSError
fatalError("Unresolved error \(nsError), \(nsError.userInfo)")
}
return result
}()

let container: NSPersistentContainer

init(inMemory: Bool = false) {
Expand Down
13 changes: 13 additions & 0 deletions Demo/WalletLibraryDemo/WalletLibraryDemo/RequirementState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import WalletLibrary
enum RequirementStateError: String, Error {
case unsupportedRequirementType = "Unsupported Requirement Type"
case invalidInputToFulfillRequirement = "Invalid Input to Fulfill Requirement"
case requirementIsNotOfTypeVerifiedIdRequirement = "Requirement cannot be fulfilled by Verified Id"
}

/// Requirement Status based on whether requirement is valid or missing.
Expand Down Expand Up @@ -46,6 +47,8 @@ class RequirementState: Identifiable, ObservableObject {
case let idTokenRequirement as IdTokenRequirement:
self.label = "Id Token for: \(idTokenRequirement.configuration)"
try? addNewLabelIfValid(newLabel: "Valid Id Token Present")
case let verifiedIdRequirement as VerifiedIdRequirement:
self.label = "Verified Id Requirement for types: \(verifiedIdRequirement.types)"
default:
throw RequirementStateError.unsupportedRequirementType
}
Expand All @@ -64,6 +67,16 @@ class RequirementState: Identifiable, ObservableObject {
}
}

func fulfill(with value: VerifiedId) throws {

guard let verifiedIdRequirement = requirement as? VerifiedIdRequirement else {
throw RequirementStateError.requirementIsNotOfTypeVerifiedIdRequirement
}

try verifiedIdRequirement.fulfill(with: value)
try addNewLabelIfValid(newLabel: "Verified Id Requirement Fulfilled.")
}

private func addNewLabelIfValid(newLabel: String) throws {
do {
try requirement.validate()
Expand Down
Loading