@@ -766,12 +766,41 @@ open class AuthenticationService:
766
766
}
767
767
/**
768
768
* Creates a new service to authenticate a user with.
769
+ *
770
+ * # Arguments
771
+ *
772
+ * * `session_path` - A path to the directory where the session data will
773
+ * be stored. A new directory **must** be given for each subsequent
774
+ * session as the database isn't designed to be shared.
775
+ *
776
+ * * `passphrase` - An optional passphrase to use to encrypt the session
777
+ * data.
778
+ *
779
+ * * `user_agent` - An optional user agent to use when making requests.
780
+ *
781
+ * * `additional_root_certificates` - Additional root certificates to trust
782
+ * when making requests when built with rustls.
783
+ *
784
+ * * `proxy` - An optional HTTP(S) proxy URL to use when making requests.
785
+ *
786
+ * * `oidc_configuration` - Configuration data about the app to use during
787
+ * OIDC authentication. This is required if OIDC authentication is to be
788
+ * used.
789
+ *
790
+ * * `custom_sliding_sync_proxy` - An optional sliding sync proxy URL that
791
+ * will override the proxy discovered from the homeserver's well-known.
792
+ *
793
+ * * `session_delegate` - A delegate that will handle token refresh etc.
794
+ * when the cross-process lock is configured.
795
+ *
796
+ * * `cross_process_refresh_lock_id` - A process ID to use for
797
+ * cross-process token refresh locks.
769
798
*/
770
- public convenience init(basePath : String, passphrase: String?, userAgent: String?, additionalRootCertificates: [Data], proxy: String?, oidcConfiguration: OidcConfiguration?, customSlidingSyncProxy: String?, sessionDelegate: ClientSessionDelegate?, crossProcessRefreshLockId: String?) {
799
+ public convenience init(sessionPath : String, passphrase: String?, userAgent: String?, additionalRootCertificates: [Data], proxy: String?, oidcConfiguration: OidcConfiguration?, customSlidingSyncProxy: String?, sessionDelegate: ClientSessionDelegate?, crossProcessRefreshLockId: String?) {
771
800
let pointer =
772
801
try! rustCall() {
773
802
uniffi_matrix_sdk_ffi_fn_constructor_authenticationservice_new(
774
- FfiConverterString.lower(basePath ),
803
+ FfiConverterString.lower(sessionPath ),
775
804
FfiConverterOptionString.lower(passphrase),
776
805
FfiConverterOptionString.lower(userAgent),
777
806
FfiConverterSequenceData.lower(additionalRootCertificates),
@@ -1957,8 +1986,6 @@ public protocol ClientBuilderProtocol : AnyObject {
1957
1986
*/
1958
1987
func backupDownloadStrategy(backupDownloadStrategy: BackupDownloadStrategy) -> ClientBuilder
1959
1988
1960
- func basePath(path: String) -> ClientBuilder
1961
-
1962
1989
func build() async throws -> Client
1963
1990
1964
1991
/**
@@ -1995,6 +2022,15 @@ public protocol ClientBuilderProtocol : AnyObject {
1995
2022
1996
2023
func serverVersions(versions: [String]) -> ClientBuilder
1997
2024
2025
+ /**
2026
+ * Sets the path that the client will use to store its data once logged in.
2027
+ * This path **must** be unique per session as the data stores aren't
2028
+ * capable of handling multiple users.
2029
+ *
2030
+ * Leaving this unset tells the client to use an in-memory data store.
2031
+ */
2032
+ func sessionPath(path: String) -> ClientBuilder
2033
+
1998
2034
func setSessionDelegate(sessionDelegate: ClientSessionDelegate) -> ClientBuilder
1999
2035
2000
2036
func slidingSyncProxy(slidingSyncProxy: String?) -> ClientBuilder
@@ -2094,14 +2130,6 @@ open func backupDownloadStrategy(backupDownloadStrategy: BackupDownloadStrategy)
2094
2130
})
2095
2131
}
2096
2132
2097
- open func basePath(path: String) -> ClientBuilder {
2098
- return try! FfiConverterTypeClientBuilder.lift(try! rustCall() {
2099
- uniffi_matrix_sdk_ffi_fn_method_clientbuilder_base_path(self.uniffiClonePointer(),
2100
- FfiConverterString.lower(path),$0
2101
- )
2102
- })
2103
- }
2104
-
2105
2133
open func build()async throws -> Client {
2106
2134
return
2107
2135
try await uniffiRustCallAsync(
@@ -2219,6 +2247,21 @@ open func serverVersions(versions: [String]) -> ClientBuilder {
2219
2247
FfiConverterSequenceString.lower(versions),$0
2220
2248
)
2221
2249
})
2250
+ }
2251
+
2252
+ /**
2253
+ * Sets the path that the client will use to store its data once logged in.
2254
+ * This path **must** be unique per session as the data stores aren't
2255
+ * capable of handling multiple users.
2256
+ *
2257
+ * Leaving this unset tells the client to use an in-memory data store.
2258
+ */
2259
+ open func sessionPath(path: String) -> ClientBuilder {
2260
+ return try! FfiConverterTypeClientBuilder.lift(try! rustCall() {
2261
+ uniffi_matrix_sdk_ffi_fn_method_clientbuilder_session_path(self.uniffiClonePointer(),
2262
+ FfiConverterString.lower(path),$0
2263
+ )
2264
+ })
2222
2265
}
2223
2266
2224
2267
open func setSessionDelegate(sessionDelegate: ClientSessionDelegate) -> ClientBuilder {
@@ -11202,6 +11245,12 @@ public struct OidcConfiguration {
11202
11245
* dynamic client registration.
11203
11246
*/
11204
11247
public var staticRegistrations: [String: String]
11248
+ /**
11249
+ * A file path where any dynamic registrations should be stored.
11250
+ *
11251
+ * Suggested value: `{base_path}/oidc/registrations.json`
11252
+ */
11253
+ public var dynamicRegistrationsFile: String
11205
11254
11206
11255
// Default memberwise initializers are never public by default, so we
11207
11256
// declare one manually.
@@ -11231,7 +11280,12 @@ public struct OidcConfiguration {
11231
11280
/**
11232
11281
* Pre-configured registrations for use with issuers that don't support
11233
11282
* dynamic client registration.
11234
- */staticRegistrations: [String: String]) {
11283
+ */staticRegistrations: [String: String],
11284
+ /**
11285
+ * A file path where any dynamic registrations should be stored.
11286
+ *
11287
+ * Suggested value: `{base_path}/oidc/registrations.json`
11288
+ */dynamicRegistrationsFile: String) {
11235
11289
self.clientName = clientName
11236
11290
self.redirectUri = redirectUri
11237
11291
self.clientUri = clientUri
@@ -11240,6 +11294,7 @@ public struct OidcConfiguration {
11240
11294
self.policyUri = policyUri
11241
11295
self.contacts = contacts
11242
11296
self.staticRegistrations = staticRegistrations
11297
+ self.dynamicRegistrationsFile = dynamicRegistrationsFile
11243
11298
}
11244
11299
}
11245
11300
@@ -11271,6 +11326,9 @@ extension OidcConfiguration: Equatable, Hashable {
11271
11326
if lhs.staticRegistrations != rhs.staticRegistrations {
11272
11327
return false
11273
11328
}
11329
+ if lhs.dynamicRegistrationsFile != rhs.dynamicRegistrationsFile {
11330
+ return false
11331
+ }
11274
11332
return true
11275
11333
}
11276
11334
@@ -11283,6 +11341,7 @@ extension OidcConfiguration: Equatable, Hashable {
11283
11341
hasher.combine(policyUri)
11284
11342
hasher.combine(contacts)
11285
11343
hasher.combine(staticRegistrations)
11344
+ hasher.combine(dynamicRegistrationsFile)
11286
11345
}
11287
11346
}
11288
11347
@@ -11298,7 +11357,8 @@ public struct FfiConverterTypeOidcConfiguration: FfiConverterRustBuffer {
11298
11357
tosUri: FfiConverterOptionString.read(from: &buf),
11299
11358
policyUri: FfiConverterOptionString.read(from: &buf),
11300
11359
contacts: FfiConverterOptionSequenceString.read(from: &buf),
11301
- staticRegistrations: FfiConverterDictionaryStringString.read(from: &buf)
11360
+ staticRegistrations: FfiConverterDictionaryStringString.read(from: &buf),
11361
+ dynamicRegistrationsFile: FfiConverterString.read(from: &buf)
11302
11362
)
11303
11363
}
11304
11364
@@ -11311,6 +11371,7 @@ public struct FfiConverterTypeOidcConfiguration: FfiConverterRustBuffer {
11311
11371
FfiConverterOptionString.write(value.policyUri, into: &buf)
11312
11372
FfiConverterOptionSequenceString.write(value.contacts, into: &buf)
11313
11373
FfiConverterDictionaryStringString.write(value.staticRegistrations, into: &buf)
11374
+ FfiConverterString.write(value.dynamicRegistrationsFile, into: &buf)
11314
11375
}
11315
11376
}
11316
11377
@@ -14746,14 +14807,14 @@ public enum AuthenticationError {
14746
14807
14747
14808
case SessionMissing(message: String)
14748
14809
14749
- case InvalidBasePath(message: String)
14750
-
14751
14810
case OidcNotSupported(message: String)
14752
14811
14753
14812
case OidcMetadataMissing(message: String)
14754
14813
14755
14814
case OidcMetadataInvalid(message: String)
14756
14815
14816
+ case OidcRegistrationsPathInvalid(message: String)
14817
+
14757
14818
case OidcCallbackUrlInvalid(message: String)
14758
14819
14759
14820
case OidcCancelled(message: String)
@@ -14803,19 +14864,19 @@ public struct FfiConverterTypeAuthenticationError: FfiConverterRustBuffer {
14803
14864
message: try FfiConverterString.read(from: &buf)
14804
14865
)
14805
14866
14806
- case 8: return .InvalidBasePath (
14867
+ case 8: return .OidcNotSupported (
14807
14868
message: try FfiConverterString.read(from: &buf)
14808
14869
)
14809
14870
14810
- case 9: return .OidcNotSupported (
14871
+ case 9: return .OidcMetadataMissing (
14811
14872
message: try FfiConverterString.read(from: &buf)
14812
14873
)
14813
14874
14814
- case 10: return .OidcMetadataMissing (
14875
+ case 10: return .OidcMetadataInvalid (
14815
14876
message: try FfiConverterString.read(from: &buf)
14816
14877
)
14817
14878
14818
- case 11: return .OidcMetadataInvalid (
14879
+ case 11: return .OidcRegistrationsPathInvalid (
14819
14880
message: try FfiConverterString.read(from: &buf)
14820
14881
)
14821
14882
@@ -14860,13 +14921,13 @@ public struct FfiConverterTypeAuthenticationError: FfiConverterRustBuffer {
14860
14921
writeInt(&buf, Int32(6))
14861
14922
case .SessionMissing(_ /* message is ignored*/):
14862
14923
writeInt(&buf, Int32(7))
14863
- case .InvalidBasePath(_ /* message is ignored*/):
14864
- writeInt(&buf, Int32(8))
14865
14924
case .OidcNotSupported(_ /* message is ignored*/):
14866
- writeInt(&buf, Int32(9 ))
14925
+ writeInt(&buf, Int32(8 ))
14867
14926
case .OidcMetadataMissing(_ /* message is ignored*/):
14868
- writeInt(&buf, Int32(10 ))
14927
+ writeInt(&buf, Int32(9 ))
14869
14928
case .OidcMetadataInvalid(_ /* message is ignored*/):
14929
+ writeInt(&buf, Int32(10))
14930
+ case .OidcRegistrationsPathInvalid(_ /* message is ignored*/):
14870
14931
writeInt(&buf, Int32(11))
14871
14932
case .OidcCallbackUrlInvalid(_ /* message is ignored*/):
14872
14933
writeInt(&buf, Int32(12))
@@ -25057,9 +25118,6 @@ private var initializationResult: InitializationResult {
25057
25118
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_backup_download_strategy() != 11959) {
25058
25119
return InitializationResult.apiChecksumMismatch
25059
25120
}
25060
- if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_base_path() != 5092) {
25061
- return InitializationResult.apiChecksumMismatch
25062
- }
25063
25121
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_build() != 56018) {
25064
25122
return InitializationResult.apiChecksumMismatch
25065
25123
}
@@ -25093,6 +25151,9 @@ private var initializationResult: InitializationResult {
25093
25151
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_server_versions() != 15644) {
25094
25152
return InitializationResult.apiChecksumMismatch
25095
25153
}
25154
+ if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_session_path() != 49266) {
25155
+ return InitializationResult.apiChecksumMismatch
25156
+ }
25096
25157
if (uniffi_matrix_sdk_ffi_checksum_method_clientbuilder_set_session_delegate() != 8576) {
25097
25158
return InitializationResult.apiChecksumMismatch
25098
25159
}
@@ -25825,7 +25886,7 @@ private var initializationResult: InitializationResult {
25825
25886
if (uniffi_matrix_sdk_ffi_checksum_constructor_mediasource_from_json() != 29216) {
25826
25887
return InitializationResult.apiChecksumMismatch
25827
25888
}
25828
- if (uniffi_matrix_sdk_ffi_checksum_constructor_authenticationservice_new() != 54979 ) {
25889
+ if (uniffi_matrix_sdk_ffi_checksum_constructor_authenticationservice_new() != 23411 ) {
25829
25890
return InitializationResult.apiChecksumMismatch
25830
25891
}
25831
25892
if (uniffi_matrix_sdk_ffi_checksum_constructor_clientbuilder_new() != 27991) {
0 commit comments