Skip to content

feat(crypto-ffi): externalize parsing of E2eiClientId [WPB-25836]#2184

Merged
SimonThormeyer merged 7 commits into
mainfrom
simon/refactor/externalize-client-id-parsing-WPB-25836
May 29, 2026
Merged

feat(crypto-ffi): externalize parsing of E2eiClientId [WPB-25836]#2184
SimonThormeyer merged 7 commits into
mainfrom
simon/refactor/externalize-client-id-parsing-WPB-25836

Conversation

@SimonThormeyer
Copy link
Copy Markdown
Member

@SimonThormeyer SimonThormeyer commented May 29, 2026

What's new in this PR

This is going to be followed by at least another PR, which is going to aim to drop all the different kinds of client ids in favor of the new ClientIdTriple and ClientId in the crypto crate.

The e2ei crate will remain untouched, except that the legacy::id module is going to be removed.


PR Submission Checklist for internal contributors
  • The PR Title
    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@SimonThormeyer SimonThormeyer force-pushed the simon/refactor/externalize-client-id-parsing-WPB-25836 branch 4 times, most recently from d124365 to 1040cac Compare May 29, 2026 11:32
@SimonThormeyer SimonThormeyer marked this pull request as ready for review May 29, 2026 11:33
@SimonThormeyer SimonThormeyer requested a review from a team May 29, 2026 11:33
@istankovic
Copy link
Copy Markdown
Member

Can we come up with a better name for "ClientIdTriple"?

The first commit's message has a typo: antoher

@SimonThormeyer SimonThormeyer force-pushed the simon/refactor/externalize-client-id-parsing-WPB-25836 branch from af4939c to ed9fe5d Compare May 29, 2026 13:19
This type wraps `ClientId` and verifies upon instantiation that it
conforms to the `<userid>-<device-id>@<domain>` format.

`E2eiClientId` would have been another natural canditate to wrap, since
it holds the triple data internally. However, this type is intended to
be used as a `ClientId` more often than it is to be used as
`E2eiClientId`, so it should deref to the former.
@SimonThormeyer SimonThormeyer force-pushed the simon/refactor/externalize-client-id-parsing-WPB-25836 branch 3 times, most recently from 9963ece to d7c4444 Compare May 29, 2026 13:30
We have to have this data structure to be able to return an
`Arc<ClientId>` via uniffi, which is useful in client code and tests.

This forces us to make the `try_parse()` function in the `crypto` crate
public to avoid doing more cloning than necessary.
@SimonThormeyer SimonThormeyer force-pushed the simon/refactor/externalize-client-id-parsing-WPB-25836 branch from d7c4444 to 624e259 Compare May 29, 2026 13:33
Copy link
Copy Markdown
Contributor

@coriolinus coriolinus left a comment

Choose a reason for hiding this comment

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

Nice. The only question I have is why you changed the names in the tests from clientId to clientIdTriple, but ultimately, the variable names in tests don't really matter.

@SimonThormeyer
Copy link
Copy Markdown
Member Author

Nice. The only question I have is why you changed the names in the tests from clientId to clientIdTriple, but ultimately, the variable names in tests don't really matter.

Good catch, that should be qualifiedClientId now.

@SimonThormeyer SimonThormeyer force-pushed the simon/refactor/externalize-client-id-parsing-WPB-25836 branch from 624e259 to 8ff57db Compare May 29, 2026 14:23
@SimonThormeyer SimonThormeyer merged commit 8ff57db into main May 29, 2026
104 of 106 checks passed
@SimonThormeyer SimonThormeyer deleted the simon/refactor/externalize-client-id-parsing-WPB-25836 branch May 29, 2026 15:09
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.

3 participants