-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic support for login detection to the FFI. #774
Conversation
crates/matrix-sdk-ffi/src/api.udl
Outdated
Client new_client(string homeserver); | ||
|
||
[Throws=ClientError] | ||
Client discover_client(string domain); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally there would just be a single function here, that attempted to discover the server and if that failed, checked the domain to see if it is in fact the server. so the user could enter example.com
/ matrix.example.com
/ http://matrix.example.com:8008
and the SDK would do the right thing. (I've handled this in EXI for now though as I wasn't sure how to achieve that).
@@ -313,14 +314,20 @@ impl ClientBuilder { | |||
err => ClientBuildError::Http(err), | |||
})?; | |||
|
|||
if let Some(base_url) = well_known.identity_server.map(|server| server.base_url) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the identity_server
for now as a placeholder for testing.
Codecov Report
@@ Coverage Diff @@
## main #774 +/- ##
==========================================
- Coverage 77.76% 77.75% -0.02%
==========================================
Files 92 92
Lines 13675 13682 +7
==========================================
+ Hits 10635 10639 +4
- Misses 3040 3043 +3
Continue to review full report at Codecov.
|
Uses the identity server whilst waiting on ruma/ruma#1193
785c24d
to
9ce9a80
Compare
Replaced by #820. |
Draft for now as it will need the next version of Ruma with ruma/ruma#1193 included. The PR does the following:
discover_client
SDK function that creates a new client for a domain string.new_client
SDK function that creates a new client for a homeserver URL (as a string through the FFI).authentication_server()
andsupports_password_login()
client methods to discover login options available to the client.For now the authentication server method is using the identity server until Ruma is updated.