Skip to content
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

crypto: Use the server name in the QR code login data #3537

Merged
merged 2 commits into from
Jun 13, 2024

Conversation

poljar
Copy link
Contributor

@poljar poljar commented Jun 12, 2024

Using the resolved homeserver URL causes problems if we need to inspect the well-known configuration of the homeserver, for example, if the server name is matrix.org, but the homeserver URL is server.matrix.org, the well-known might be only available for the former.

This is why we also need to receive the former, i.e. the server name in the QR code data.

  • Public API changes documented in changelogs (optional)

Using the resolved homeserver URL causes problems if we need to inspect
the well-known configuration of the homeserver, for example, if the
server name is matrix.org, but the homeserver URL is server.matrix.org,
the well-known might be only available for the former.

This is why we also need to receive the former, i.e. the server name in
the QR code data.
@poljar poljar requested a review from a team as a code owner June 12, 2024 11:26
@poljar poljar requested review from bnjbvr and removed request for a team June 12, 2024 11:26
Copy link

codecov bot commented Jun 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.79%. Comparing base (abda959) to head (cd51c40).
Report is 26 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3537   +/-   ##
=======================================
  Coverage   83.79%   83.79%           
=======================================
  Files         254      254           
  Lines       25734    25734           
=======================================
  Hits        21563    21563           
  Misses       4171     4171           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly nits, so approving. The code makes sense, I'm not too sure about the why of the change, but trust you here. (Alternatively, one could ask review from somebody who's more knowledgeable about the QR code login process.)

crates/matrix-sdk-crypto/src/types/qr_login.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-crypto/src/types/qr_login.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-crypto/src/types/qr_login.rs Outdated Show resolved Hide resolved
examples/qr-login/src/main.rs Outdated Show resolved Hide resolved
@poljar
Copy link
Contributor Author

poljar commented Jun 12, 2024

Mostly nits, so approving. The code makes sense, I'm not too sure about the why of the change, but trust you here. (Alternatively, one could ask review from somebody who's more knowledgeable about the QR code login process.)

The MSC got changed: matrix-org/matrix-spec-proposals@87f8317. The commit attempts to clarify why as well, you need to be able to do the well-known discovery, which is guaranteed to only work if you get the server name.

@poljar poljar merged commit 9b05d0d into main Jun 13, 2024
38 checks passed
@poljar poljar deleted the poljar/qr-login-homeserver-weak-type branch June 13, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants