Skip to content

Commit

Permalink
fixup! feat: iOS interop client
Browse files Browse the repository at this point in the history
  • Loading branch information
typfel committed Jan 17, 2025
1 parent 927346d commit 887cc81
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ extension InteropAction {
} else {
return nil
}

case "get-key-package":
let components = URLComponents(url: url, resolvingAgainstBaseURL: false)
let ciphersuite = components?.queryItems?.first(where: {
Expand All @@ -70,6 +71,7 @@ extension InteropAction {
} else {
return nil
}

case "add-client":
let components = URLComponents(url: url, resolvingAgainstBaseURL: false)
let converationId = components?.queryItems?.first(where: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ struct InteropClientApp: App {
try await self.coreCrypto?.provideTransport(callbacks: TransportProvider())

return "Initialised MLS with ciphersuite: \(ciphersuite)"

case .getKeyPackage(ciphersuite: let ciphersuite):
guard let coreCrypto else { throw InteropError.notInitialised }

Expand All @@ -113,6 +114,7 @@ struct InteropClientApp: App {
} else {
throw InteropError.encodingError
}

case .addClient(conversationId: let conversationId, let ciphersuite, keyPackage: let keyPackage):
guard let coreCrypto else { throw InteropError.notInitialised }

Expand All @@ -136,6 +138,7 @@ struct InteropClientApp: App {
)

return "added client to conversation"

case .removeClient(conversationId: let conversationId, clientId: let clientId):
guard let coreCrypto else { throw InteropError.notInitialised }

Expand All @@ -145,6 +148,7 @@ struct InteropClientApp: App {
)

return "removed client from conversation"

case .processWelcome(welcomePath: let welcomePath):
guard let coreCrypto else { throw InteropError.notInitialised }

Expand All @@ -156,6 +160,7 @@ struct InteropClientApp: App {
)

return bundle.id.base64EncodedString()

case .encryptMessage(conversationId: let conversationId, message: let message):
guard let coreCrypto else { throw InteropError.notInitialised }

Expand All @@ -165,6 +170,7 @@ struct InteropClientApp: App {
)

return encryptedMessage.base64EncodedString()

case .decryptMessage(conversationId: let conversationId, message: let message):
guard let coreCrypto else { throw InteropError.notInitialised }

Expand Down

0 comments on commit 887cc81

Please sign in to comment.