Skip to content

Commit

Permalink
remove the requirement on encryption key (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer authored May 15, 2024
1 parent 95638b4 commit c5baafd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
5 changes: 1 addition & 4 deletions Sources/XMTPiOS/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
10 changes: 3 additions & 7 deletions Tests/XMTPTests/ClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,24 +156,21 @@ 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
)
)

let alixClient = try await Client.create(
account: alix,
options: .init(
api: .init(env: .local, isSecure: false),
mlsAlpha: true,
mlsEncryptionKey: key
mlsAlpha: true
)
)

Expand All @@ -189,8 +186,7 @@ class ClientTests: XCTestCase {
account: bo,
options: .init(
api: .init(env: .local, isSecure: false),
mlsAlpha: true,
mlsEncryptionKey: key
mlsAlpha: true
)
)

Expand Down
2 changes: 1 addition & 1 deletion XMTP.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c5baafd

Please sign in to comment.