Skip to content

Commit

Permalink
Use a Client in AuthenticationService now that the Rust one has been …
Browse files Browse the repository at this point in the history
…removed. (#2954)

* Replace Rust's Authentication service by building a Client.

* Drop the Proxy from AuthenticationServiceProxy[Protocol].

* Make sure to call abortOIDCLogin.

* Centralise common ClientBuilder code.

* Update the SDK.
  • Loading branch information
pixlwave authored Jun 24, 2024
1 parent fc0573a commit 3465ea4
Show file tree
Hide file tree
Showing 23 changed files with 465 additions and 540 deletions.
70 changes: 42 additions & 28 deletions ElementX.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/element-hq/matrix-rust-components-swift",
"state" : {
"revision" : "f000a92169e856fba82c1bc0dd305b71e76b4bc9",
"version" : "1.0.17"
"revision" : "2b20dbcf1d5bf23f8801f4376207c84b404f2016",
"version" : "1.0.18"
}
},
{
Expand Down
18 changes: 9 additions & 9 deletions ElementX/Sources/Application/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,12 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg

private func startAuthentication() {
let encryptionKeyProvider = EncryptionKeyProvider()
let authenticationService = AuthenticationServiceProxy(userSessionStore: userSessionStore,
encryptionKeyProvider: encryptionKeyProvider,
appSettings: appSettings)
let qrCodeLoginService = QRCodeLoginService(oidcConfiguration: appSettings.oidcConfiguration.rustValue,
encryptionKeyProvider: encryptionKeyProvider,
userSessionStore: userSessionStore)
let authenticationService = AuthenticationService(userSessionStore: userSessionStore,
encryptionKeyProvider: encryptionKeyProvider,
appSettings: appSettings)
let qrCodeLoginService = QRCodeLoginService(encryptionKeyProvider: encryptionKeyProvider,
userSessionStore: userSessionStore,
appSettings: appSettings)

authenticationFlowCoordinator = AuthenticationFlowCoordinator(authenticationService: authenticationService,
qrCodeLoginService: qrCodeLoginService,
Expand All @@ -480,9 +480,9 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
userDisplayName: userSession.clientProxy.userDisplayNamePublisher.value ?? "",
deviceID: userSession.clientProxy.deviceID)

let authenticationService = AuthenticationServiceProxy(userSessionStore: userSessionStore,
encryptionKeyProvider: EncryptionKeyProvider(),
appSettings: appSettings)
let authenticationService = AuthenticationService(userSessionStore: userSessionStore,
encryptionKeyProvider: EncryptionKeyProvider(),
appSettings: appSettings)
_ = await authenticationService.configure(for: userSession.clientProxy.homeserver)

let parameters = SoftLogoutScreenCoordinatorParameters(authenticationService: authenticationService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protocol AuthenticationFlowCoordinatorDelegate: AnyObject {
}

class AuthenticationFlowCoordinator: FlowCoordinatorProtocol {
private let authenticationService: AuthenticationServiceProxyProtocol
private let authenticationService: AuthenticationServiceProtocol
private let bugReportService: BugReportServiceProtocol
private let navigationRootCoordinator: NavigationRootCoordinator
private let navigationStackCoordinator: NavigationStackCoordinator
Expand All @@ -42,7 +42,7 @@ class AuthenticationFlowCoordinator: FlowCoordinatorProtocol {

weak var delegate: AuthenticationFlowCoordinatorDelegate?

init(authenticationService: AuthenticationServiceProxyProtocol,
init(authenticationService: AuthenticationServiceProtocol,
qrCodeLoginService: QRCodeLoginServiceProtocol,
bugReportService: BugReportServiceProtocol,
navigationRootCoordinator: NavigationRootCoordinator,
Expand Down
Loading

0 comments on commit 3465ea4

Please sign in to comment.