Skip to content

Commit

Permalink
Swift 6 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
phisakel committed Sep 19, 2024
1 parent 373a59f commit 1cf7717
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Swift",
"image": "swift:5.9",
"image": "swift:6.0",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "false",
Expand Down
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-data-model.git",
"state" : {
"revision" : "e604f0f0b67c86c3360f848defe85c9a9939b716",
"version" : "0.3.1"
"branch" : "develop",
"revision" : "1d74365e1b7e4a12ef4268897bbf738c87c45bf6"
}
},
{
Expand All @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/niscy-eudiw/SwiftCBOR.git",
"state" : {
"revision" : "310dbc3975a5653237fed304d88a6dd59d04dd30",
"version" : "0.5.7"
"revision" : "2c8c55273d4c4aae21bb46c2afbae79ee072eff4",
"version" : "0.6.2"
}
}
],
Expand Down
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.9
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -15,7 +15,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.3"),
.package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-data-model.git", exact: "0.3.1"),
.package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-data-model.git", branch: "develop"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
Expand All @@ -28,6 +28,6 @@ let package = Package(
]),
.testTarget(
name: "WalletStorageTests",
dependencies: ["WalletStorage"], resources: [.process("Resources")]),
dependencies: ["WalletStorage"]),
]
)
2 changes: 1 addition & 1 deletion Sources/WalletStorage/Document.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Foundation
import MdocDataModel18013

/// wallet document structure
public struct Document: DocumentProtocol {
public struct Document: DocumentProtocol, Sendable {
public init(id: String = UUID().uuidString, docType: String, docDataType: DocDataType, data: Data, privateKeyType: PrivateKeyType?, privateKey: Data?, createdAt: Date?, modifiedAt: Date? = nil, displayName: String?, status: DocumentStatus) {
self.id = id
self.docType = docType
Expand Down
8 changes: 4 additions & 4 deletions Sources/WalletStorage/Enumerations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Foundation
/// type of data to save in storage
/// ``doc``: Document data
/// ``key``: Private-key
public enum SavedKeyChainDataType: String {
public enum SavedKeyChainDataType: String, Sendable {
case doc = "sdoc"
case key = "skey"
}
Expand All @@ -29,7 +29,7 @@ public enum SavedKeyChainDataType: String {
/// ``sjwt``: sd-jwt ** not yet supported **
/// ``signupResponseJson``: DeviceResponse and PrivateKey json serialized
/// ``deferred``: Deferred issuance data
public enum DocDataType: String {
public enum DocDataType: String, Sendable {
case cbor = "cbor"
case sjwt = "sjwt"
case signupResponseJson = "srjs"
Expand All @@ -40,7 +40,7 @@ public enum DocDataType: String {
/// ``pemStringDataP256`` PEM string encoded as utf8
/// ``x963EncodedP256``: ANSI x9.63 representation (default)
/// ``secureEnclaveP256``: data representation for the secure enclave
public enum PrivateKeyType: String {
public enum PrivateKeyType: String, Sendable {
case derEncodedP256 = "dep2"
case pemStringDataP256 = "pep2"
case x963EncodedP256 = "x9p2"
Expand All @@ -49,7 +49,7 @@ public enum PrivateKeyType: String {


/// document status
public enum DocumentStatus: String, CaseIterable {
public enum DocumentStatus: String, CaseIterable, Sendable {
case issued
case deferred
case pending
Expand Down
2 changes: 1 addition & 1 deletion Sources/WalletStorage/IssueRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import CryptoKit
import MdocDataModel18013

/// Issue request structure
public struct IssueRequest {
public struct IssueRequest: Sendable {
public var id: String
public var docType: String?
public var keyData: Data
Expand Down

0 comments on commit 1cf7717

Please sign in to comment.