Skip to content

Commit

Permalink
Merge pull request #98 from niscy-eudiw/refactor
Browse files Browse the repository at this point in the history
Update dependencies, fix func toModel(doc: WalletStorage.Document)
  • Loading branch information
phisakel committed Sep 5, 2024
2 parents 454373a + bc83131 commit 5e952df
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 26 deletions.
40 changes: 20 additions & 20 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,26 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-data-model.git",
"state" : {
"revision" : "907e5dbdb58fcaf4916507a8fcfff7a79cbd0efd",
"version" : "0.3.0"
"revision" : "e604f0f0b67c86c3360f848defe85c9a9939b716",
"version" : "0.3.1"
}
},
{
"identity" : "eudi-lib-ios-iso18013-data-transfer",
"kind" : "remoteSourceControl",
"location" : "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-data-transfer.git",
"state" : {
"revision" : "380ebcf5e054adf651580faf7cd627052ef3de12",
"version" : "0.3.0"
"revision" : "0b2741f2ce2b9232e1cf10dce070fcfa3d714dcd",
"version" : "0.3.1"
}
},
{
"identity" : "eudi-lib-ios-iso18013-security",
"kind" : "remoteSourceControl",
"location" : "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-security.git",
"state" : {
"revision" : "8b77e16221f169b5a5de7e81342411c15e46cf37",
"version" : "0.2.3"
"revision" : "9d4cc4f403ded786b89401bfbc455ab8f83635db",
"version" : "0.2.4"
}
},
{
Expand Down Expand Up @@ -77,17 +77,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-wallet-storage.git",
"state" : {
"revision" : "28acebc69454b6c2377f344af73d778daf805e34",
"version" : "0.2.6"
"revision" : "373a59f765c80b5319d4064d25c56f75a486af86",
"version" : "0.2.8"
}
},
{
"identity" : "hitch",
"kind" : "remoteSourceControl",
"location" : "https://github.com/KittyMac/Hitch.git",
"state" : {
"revision" : "328211598c24f356fccbcb5451cc48e21071a963",
"version" : "0.4.139"
"revision" : "77b592f4c21c454a24da2fad80901e6b19751780",
"version" : "0.4.147"
}
},
{
Expand Down Expand Up @@ -131,8 +131,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/KittyMac/Spanker.git",
"state" : {
"revision" : "96e58f68274a2e6f370fff153ceb5674a06936c4",
"version" : "0.2.47"
"revision" : "d4b439bf76a40fb45d86a24d13b9c26e7d630eee",
"version" : "0.2.49"
}
},
{
Expand All @@ -149,35 +149,35 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-asn1.git",
"state" : {
"revision" : "c7e239b5c1492ffc3ebd7fbcc7a92548ce4e78f0",
"version" : "1.1.0"
"revision" : "df5d2fcd22e3f480e3ef85bf23e277a4a0ef524d",
"version" : "1.2.0"
}
},
{
"identity" : "swift-certificates",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-certificates.git",
"state" : {
"revision" : "4688f242811d21a9c7a8ad669b3bc5b336759929",
"version" : "1.4.0"
"revision" : "2f797305c1b5b982acaa6005d8a9f970cc4e97ff",
"version" : "1.5.0"
}
},
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"revision" : "3d2dc41a01f9e49d84f0a3925fb858bed64f702d",
"version" : "1.1.2"
"revision" : "9bf03ff58ce34478e66aaee630e491823326fd06",
"version" : "1.1.3"
}
},
{
"identity" : "swift-crypto",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-crypto.git",
"state" : {
"revision" : "46072478ca365fe48370993833cb22de9b41567f",
"version" : "3.5.2"
"revision" : "9f95b4d033a4edd3814b48608db3f2ca90c7218b",
"version" : "3.7.0"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.3"),
.package(url: "https://github.com/crspybits/swift-log-file", from: "0.1.0"),
.package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-data-transfer.git", exact: "0.3.0"),
.package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-wallet-storage.git", exact: "0.2.6"),
.package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-data-transfer.git", exact: "0.3.1"),
.package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-wallet-storage.git", exact: "0.2.8"),
.package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-siop-openid4vp-swift.git", exact: "0.3.4"),
.package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-openid4vci-swift.git", exact: "0.4.4"),
],
Expand Down
8 changes: 4 additions & 4 deletions Sources/EudiWalletKit/Services/StorageManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ public class StorageManager: ObservableObject {

func toModel(doc: WalletStorage.Document) -> (any MdocDecodable)? {
guard let (iss, dpk) = doc.getCborData() else { return nil }
var retModel: (any MdocDecodable)? = self.modelFactory?.makeMdocDecodable(id: iss.0, createdAt: doc.createdAt, issuerSigned: iss.1, devicePrivateKey: dpk.1, docType: doc.docType, displayName: doc.displayName)
var retModel: (any MdocDecodable)? = self.modelFactory?.makeMdocDecodable(id: iss.0, createdAt: doc.createdAt, issuerSigned: iss.1, devicePrivateKey: dpk.1, docType: doc.docType, displayName: doc.displayName, statusDescription: doc.statusDescription)
if retModel == nil {
let defModel: (any MdocDecodable)? = switch doc.docType {
case EuPidModel.euPidDocType: EuPidModel(id: iss.0, createdAt: doc.createdAt, issuerSigned: iss.1, devicePrivateKey: dpk.1, displayName: doc.displayName)
case IsoMdlModel.isoDocType: IsoMdlModel(id: iss.0, createdAt: doc.createdAt, issuerSigned: iss.1, devicePrivateKey: dpk.1, displayName: doc.displayName)
case EuPidModel.euPidDocType: EuPidModel(id: iss.0, createdAt: doc.createdAt, issuerSigned: iss.1, devicePrivateKey: dpk.1, displayName: doc.displayName, statusDescription: doc.statusDescription)
case IsoMdlModel.isoDocType: IsoMdlModel(id: iss.0, createdAt: doc.createdAt, issuerSigned: iss.1, devicePrivateKey: dpk.1, displayName: doc.displayName, statusDescription: doc.statusDescription)
default: nil
}
retModel = defModel ?? GenericMdocModel(id: iss.0, createdAt: doc.createdAt, issuerSigned: iss.1, devicePrivateKey: dpk.1, docType: doc.docType, displayName: doc.displayName)
retModel = defModel ?? GenericMdocModel(id: iss.0, createdAt: doc.createdAt, issuerSigned: iss.1, devicePrivateKey: dpk.1, docType: doc.docType, displayName: doc.displayName, statusDescription: doc.statusDescription)
}
return retModel
}
Expand Down
10 changes: 10 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## v0.6.6
### Refactoring :
- `WalletStorage.Document` implements `DocumentProtocol` protocol
- `MdocDataModel18013.MdocDecodable` inherits `DocumentProtocol` protocol

## v0.6.5
### Fixes for dynamic issuance:
- Support dynamic issuance in scoped mode
- Remove pending document after finalizing `resumePendingIssuance`

## v0.6.4
- New wallet methods:

Expand Down

0 comments on commit 5e952df

Please sign in to comment.