From c5baafd3ba60a85a17c283ce6d46999b2d7f2a22 Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Wed, 15 May 2024 15:06:49 -0700 Subject: [PATCH] remove the requirement on encryption key (#337) --- Sources/XMTPiOS/Client.swift | 5 +---- Tests/XMTPTests/ClientTests.swift | 10 +++------- XMTP.podspec | 2 +- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/Sources/XMTPiOS/Client.swift b/Sources/XMTPiOS/Client.swift index c4042e25..22eb5d82 100644 --- a/Sources/XMTPiOS/Client.swift +++ b/Sources/XMTPiOS/Client.swift @@ -138,10 +138,7 @@ public final class Client { if options?.mlsAlpha == true, options?.api.env.supportsMLS == true { let dbURL = options?.mlsDbPath ?? URL.documentsDirectory.appendingPathComponent("xmtp-\(options?.api.env.rawValue ?? "")-\(address).db3").path - var encryptionKey = options?.mlsEncryptionKey - if (encryptionKey == nil) { - throw ClientError.creationError("No encryption key passed for the database. Please store and provide a secure encryption key.") - } + let encryptionKey = options?.mlsEncryptionKey let v3Client = try await LibXMTP.createClient( logger: XMTPLogger(), diff --git a/Tests/XMTPTests/ClientTests.swift b/Tests/XMTPTests/ClientTests.swift index 72d4f933..23d58056 100644 --- a/Tests/XMTPTests/ClientTests.swift +++ b/Tests/XMTPTests/ClientTests.swift @@ -156,15 +156,13 @@ class ClientTests: XCTestCase { } func testCanDeleteDatabase() async throws { - let key = try Crypto.secureRandomBytes(count: 32) let bo = try PrivateKey.generate() let alix = try PrivateKey.generate() var boClient = try await Client.create( account: bo, options: .init( api: .init(env: .local, isSecure: false), - mlsAlpha: true, - mlsEncryptionKey: key + mlsAlpha: true ) ) @@ -172,8 +170,7 @@ class ClientTests: XCTestCase { account: alix, options: .init( api: .init(env: .local, isSecure: false), - mlsAlpha: true, - mlsEncryptionKey: key + mlsAlpha: true ) ) @@ -189,8 +186,7 @@ class ClientTests: XCTestCase { account: bo, options: .init( api: .init(env: .local, isSecure: false), - mlsAlpha: true, - mlsEncryptionKey: key + mlsAlpha: true ) ) diff --git a/XMTP.podspec b/XMTP.podspec index 2a7826ad..e5e95fb3 100644 --- a/XMTP.podspec +++ b/XMTP.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |spec| # spec.name = "XMTP" - spec.version = "0.10.10" + spec.version = "0.10.11" spec.summary = "XMTP SDK Cocoapod" # This description is used to generate tags and improve search results.