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

Fix hashed ID server lookups with no Olm #4333

Merged
merged 13 commits into from
Aug 1, 2024
Merged

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Jul 30, 2024

It used the hash function from Olm (presumably to work cross-platform) but subtle crypto is available on node nowadays so we can just use that.

Refactor existing code that did this out to a common function, add tests.

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • Sign-off given on the changes (see CONTRIBUTING.md).

It used the hash function from Olm (presumably to work cross-platform)
but subtle crypto is available on node nowadays so we can just use
that.

Refactor existing code that did this out to a common function, add
tests.
spec/unit/matrix-client.spec.ts Dismissed Show dismissed Hide dismissed
@dbkr dbkr marked this pull request as ready for review July 30, 2024 17:05
@dbkr dbkr requested review from a team as code owners July 30, 2024 17:05
@dbkr dbkr requested review from andybalaam, uhoreg and robintown July 30, 2024 17:05
src/crypto/digest.ts Outdated Show resolved Hide resolved
src/crypto/digest.ts Outdated Show resolved Hide resolved
src/crypto/digest.ts Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

move this out of crypto too, please.

src/digest.ts Outdated Show resolved Hide resolved
src/digest.ts Outdated Show resolved Hide resolved
@dbkr
Copy link
Member Author

dbkr commented Jul 31, 2024

I don't know why the sonarcloud results aren't coming through now :/

@dbkr dbkr requested a review from richvdh July 31, 2024 14:32
*/

/**
* @param plaintext The string to hash
Copy link
Member

Choose a reason for hiding this comment

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

what does it do, though?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd sort of assumed this was described completely by the @return param, but I can add a body too

@dbkr dbkr added this pull request to the merge queue Aug 1, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 1, 2024
@dbkr dbkr added this pull request to the merge queue Aug 1, 2024
Merged via the queue into develop with commit 89a9a7f Aug 1, 2024
26 checks passed
@dbkr dbkr deleted the dbkr/fix_id_server_lookup branch August 1, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants