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

Release 4.0.1 #77

Merged
merged 4 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion CI/publish-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ git clone -b gh-pages "${REPO_PATH}" --single-branch ${DOCS_DIR}
INFOPLIST_FILE_PATH="${GITHUB_WORKSPACE}/VirgilE3Kit/Info.plist"

# Define SDK versions
VIRGIL_SDK_VERSION="v4.0.0"
VIRGIL_SDK_VERSION="v4.0.1"
CURRENT_VERSION_DIR="${DOCS_DIR}/${VIRGIL_SDK_VERSION}"

# Generate the HTML documentation.
Expand Down
25 changes: 17 additions & 8 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,44 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/VirgilSecurity/virgil-crypto-c.git",
"state" : {
"revision" : "591c32a4c54378e750c80052d7588df8056525b0",
"version" : "0.17.0"
"revision" : "40ae5231264c8f2d79354922fac15d96021aa8b5",
"version" : "0.17.1"
}
},
{
"identity" : "virgil-crypto-x",
"kind" : "remoteSourceControl",
"location" : "https://github.com/VirgilSecurity/virgil-crypto-x.git",
"state" : {
"revision" : "96fef3abb3c96eec0c14cdf3f406658776071dbd",
"version" : "7.0.0"
"revision" : "6334a21c49dafb305666aafc34819314960412de",
"version" : "7.0.1"
}
},
{
"identity" : "virgil-pythia-x",
"kind" : "remoteSourceControl",
"location" : "https://github.com/VirgilSecurity/virgil-pythia-x.git",
"state" : {
"revision" : "6b85da7b8c3bf523df498e66c5bdb63c117be351",
"version" : "0.12.1"
}
},
{
"identity" : "virgil-ratchet-x",
"kind" : "remoteSourceControl",
"location" : "https://github.com/VirgilSecurity/virgil-ratchet-x.git",
"state" : {
"revision" : "19e28149a973aba2f70ba1c0cf176fa15e84e278",
"version" : "0.10.0"
"revision" : "f5be34003eb9a78743e24479fc85b407a665d9c0",
"version" : "0.10.1"
}
},
{
"identity" : "virgil-sdk-x",
"kind" : "remoteSourceControl",
"location" : "https://github.com/VirgilSecurity/virgil-sdk-x.git",
"state" : {
"revision" : "7165aafa08be93a874097033ec903bac447e4b9b",
"version" : "9.0.0"
"revision" : "53e32c076211a7623f113df49e6f48c8974c9024",
"version" : "9.0.1"
}
}
],
Expand Down
8 changes: 5 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PackageDescription
let package = Package(
name: "VirgilE3Kit",
platforms: [
.macOS(.v10_12), .iOS(.v11), .tvOS(.v11), .watchOS(.v4),
.macOS(.v10_13), .iOS(.v11), .tvOS(.v11), .watchOS(.v4),
],
products: [
.library(
Expand All @@ -16,14 +16,16 @@ let package = Package(
],

dependencies: [
.package(url: "https://github.com/VirgilSecurity/virgil-ratchet-x.git", exact: .init(0, 10, 0))
.package(url: "https://github.com/VirgilSecurity/virgil-pythia-x.git", exact: .init(0, 12, 1)),
.package(url: "https://github.com/VirgilSecurity/virgil-ratchet-x.git", exact: .init(0, 10, 1)),
],

targets: [
.target(
name: "VirgilE3Kit",
dependencies: [
.product(name: "VirgilSDKRatchet", package: "virgil-ratchet-x")
.product(name: "VirgilSDKRatchet", package: "virgil-ratchet-x"),
.product(name: "VirgilSDKPythia", package: "virgil-pythia-x"),
],
path: "Source"
),
Expand Down
3 changes: 2 additions & 1 deletion Source/EThree.swift
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ import VirgilSDKRatchet
identity: params.identity,
crypto: crypto,
accessTokenProvider: accessTokenProvider,
keyknoxServiceUrl: params.serviceUrls.keyknoxServiceUrl
keyknoxServiceUrl: params.serviceUrls.keyknoxServiceUrl,
pythiaServiceUrl: params.serviceUrls.pythiaServiceUrl
)

let sqliteCardStorage = try SQLiteCardStorage(
Expand Down
8 changes: 8 additions & 0 deletions Source/Models/EThreeParams.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import Foundation
import VirgilCrypto
import VirgilSDK
import VirgilSDKPythia
import VirgilSDKRatchet

/// Contains parameters for initializing EThree
Expand Down Expand Up @@ -72,6 +73,9 @@ import VirgilSDKRatchet
/// Card service URL
@objc public var cardServiceUrl: URL

/// Pythia service URL
@objc public var pythiaServiceUrl: URL

/// Keyknox service URL
@objc public var keyknoxServiceUrl: URL

Expand All @@ -81,14 +85,17 @@ import VirgilSDKRatchet
/// Init
/// - Parameters:
/// - cardServiceUrl: Card service URL
/// - pythiaServiceUrl: Pythia service URL
/// - keyknoxServiceUrl: Keyknox service URL
/// - ratchetServiceUrl: Ratchet service URL
@objc public init(
cardServiceUrl: URL,
pythiaServiceUrl: URL,
keyknoxServiceUrl: URL,
ratchetServiceUrl: URL
) {
self.cardServiceUrl = cardServiceUrl
self.pythiaServiceUrl = pythiaServiceUrl
self.keyknoxServiceUrl = keyknoxServiceUrl
self.ratchetServiceUrl = ratchetServiceUrl
}
Expand Down Expand Up @@ -215,6 +222,7 @@ import VirgilSDKRatchet
self.tokenCallback = tokenCallback
self.serviceUrls = ServiceUrls(
cardServiceUrl: CardClient.defaultURL,
pythiaServiceUrl: PythiaClient.defaultURL,
keyknoxServiceUrl: KeyknoxClient.defaultURL,
ratchetServiceUrl: RatchetClient.defaultURL
)
Expand Down
73 changes: 0 additions & 73 deletions Source/Models/Mixtec/BrainKey.swift

This file was deleted.

15 changes: 13 additions & 2 deletions Source/Storages/Cloud/CloudKeyManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import Foundation
import VirgilCrypto
import VirgilSDK
import VirgilSDKPythia

internal class CloudKeyManager {
private let identity: String
Expand All @@ -53,7 +54,8 @@ internal class CloudKeyManager {
identity: String,
crypto: VirgilCrypto,
accessTokenProvider: AccessTokenProvider,
keyknoxServiceUrl: URL
keyknoxServiceUrl: URL,
pythiaServiceUrl: URL
) throws {
self.identity = identity
self.crypto = crypto
Expand All @@ -70,7 +72,16 @@ internal class CloudKeyManager {

self.keyknoxManager = try KeyknoxManager(keyknoxClient: keyknoxClient)

self.brainKey = BrainKey(crypto: self.crypto)
let pythiaClient = PythiaClient(
accessTokenProvider: self.accessTokenProvider,
serviceUrl: pythiaServiceUrl,
connection: connection,
retryConfig: ExpBackoffRetry.Config()
)

let brainKeyContext = try BrainKeyContext(client: pythiaClient)

self.brainKey = BrainKey(context: brainKeyContext)
}

internal func setUpCloudKeyStorage(password: String) throws -> CloudKeyStorage {
Expand Down
2 changes: 1 addition & 1 deletion Source/Utils/ProductInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ import Foundation

internal enum ProductInfo {
internal static let name: String = "e3kit"
internal static let version: String = "4.0.0"
internal static let version: String = "4.0.1"
}
3 changes: 3 additions & 0 deletions Tests/Swift/Utils/TestConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,19 @@ import VirgilE3Kit

@objc public class ServiceUrls: NSObject, Decodable {
public let Card: String
public let Pythia: String
public let Keyknox: String
public let Ratchet: String

@objc public func get() -> EThreeParams.ServiceUrls {
let cardServiceUrl = URL(string: self.Card)!
let pythiaServiceUrl = URL(string: self.Pythia)!
let keyknoxServiceUrl = URL(string: self.Keyknox)!
let ratchetServiceUrl = URL(string: self.Ratchet)!

return EThreeParams.ServiceUrls(
cardServiceUrl: cardServiceUrl,
pythiaServiceUrl: pythiaServiceUrl,
keyknoxServiceUrl: keyknoxServiceUrl,
ratchetServiceUrl: ratchetServiceUrl
)
Expand Down
49 changes: 29 additions & 20 deletions Tests/Swift/Utils/TestUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import Foundation
import VirgilCrypto
import VirgilE3Kit
import VirgilSDK
import VirgilSDKPythia

@objc(VTETestUtils) public class TestUtils: NSObject {
@objc public let crypto: VirgilCrypto
Expand Down Expand Up @@ -248,31 +249,39 @@ import VirgilSDK
let serviceUrls = self.config.ServiceUrls.get()
let connection = HttpConnection()
let retryConfig = ExpBackoffRetry.Config()
let brainKey = BrainKey(crypto: self.crypto)
let keyPair = try! brainKey.generateKeyPair(password: password, brainKeyId: nil).startSync().get()

let keyknoxClient = KeyknoxClient(
let pythiaClient = PythiaClient(
accessTokenProvider: provider,
serviceUrl: serviceUrls.keyknoxServiceUrl,
serviceUrl: serviceUrls.pythiaServiceUrl,
connection: connection,
retryConfig: retryConfig
)

let keyknoxManager = try! KeyknoxManager(keyknoxClient: keyknoxClient)

let cloudKeyStorage = CloudKeyStorage(
keyknoxManager: keyknoxManager,
publicKeys: [keyPair.publicKey],
privateKey: keyPair.privateKey
)

let syncKeyStorage = SyncKeyStorage(
identity: identity,
keychainStorage: keychainStorage,
cloudKeyStorage: cloudKeyStorage
)

syncKeyStorage.sync { completion(syncKeyStorage, $0) }
let brainKeyContext = try! BrainKeyContext(client: pythiaClient)
let brainKey = BrainKey(context: brainKeyContext)

brainKey.generateKeyPair(password: password, brainKeyId: nil) { keyPair, error in
let keyknoxClient = KeyknoxClient(
accessTokenProvider: provider,
serviceUrl: serviceUrls.keyknoxServiceUrl,
connection: connection,
retryConfig: retryConfig
)

let keyknoxManager = try! KeyknoxManager(keyknoxClient: keyknoxClient)

let cloudKeyStorage = CloudKeyStorage(
keyknoxManager: keyknoxManager,
publicKeys: [keyPair!.publicKey],
privateKey: keyPair!.privateKey
)
let syncKeyStorage = SyncKeyStorage(
identity: identity,
keychainStorage: keychainStorage,
cloudKeyStorage: cloudKeyStorage
)

syncKeyStorage.sync { completion(syncKeyStorage, $0) }
}
}
}

Expand Down
5 changes: 3 additions & 2 deletions VirgilE3Kit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "VirgilE3Kit"
s.version = "4.0.0"
s.version = "4.0.1"
s.swift_version = "5.0"
s.license = { :type => "BSD", :file => "LICENSE" }
s.summary = "Vigil E3Kit for Apple devices and languages"
Expand All @@ -12,5 +12,6 @@ Pod::Spec.new do |s|
s.watchos.deployment_target = "4.0"
s.source = { :git => "https://github.com/VirgilSecurity/virgil-e3kit-x.git", :tag => s.version }
s.source_files = 'Source/**/*.{swift}'
s.dependency "VirgilSDKRatchet", '= 0.10.0'
s.dependency "VirgilSDKPythia", '= 0.12.1'
s.dependency "VirgilSDKRatchet", '= 0.10.1'
end
Loading
Loading