feat: remove identities module#1756
Conversation
248d04c to
0f07043
Compare
0f07043 to
7475791
Compare
|
WDYT of excluding the public key from the credential ref--it might be large--and instead just storing the |
7475791 to
2d4b6fe
Compare
Sounds good! Would you mind if we did that as a separate item? |
That's fine, I was just thinking of it here because it was on my mental queue of things to do once we got rid of the "get most recent commit" functionality, which this PR implements. |
b7a775a to
4a4d932
Compare
afa8e34 to
d62693e
Compare
coriolinus
left a comment
There was a problem hiding this comment.
This is great! A few nits, but I think this is a real improvement.
Now that the identities module is gone, I'm pretty sure that the door is now open to delete all the 1s delays per added credential, because we don't need them to have unique created_at values anymore. I'm agnostic about whether you want to do that in this PR or in a follow-up though.
| /// If no credentials are present in the keystore, then one _must_ be created and added to the | ||
| /// session before it can be used. |
There was a problem hiding this comment.
This comment seems relevant still.
There was a problem hiding this comment.
Really? Now that mls_init() doesn't do anything with credentials anymore it seems a little off to mention them here.
d54dcaa to
353d7d5
Compare
Removing this function is the first step to unlock removal of the `identities` module which would allow querying for most recently added credentials. `e2ei_rotate()` would just take the most recent x509 credential from the DB and set it for the given conversation. This removes that implicit behavior. To allow that, we're now returning a credential ref from `save_x509_credential()`. Note: we're taking a shortcut here on the FFI layer - we're not anymore returning the `NewCrlDistributionPoints` from `save_x509_credential()`. However, CRL handling is going to be rewored in WPB-19580, so it's not worth bothering too much.
This is, much like the parent commit, just to produce an intermediate state after this PR that enables passing tests without _recent credential_ logic. This method is going to disappear by the latest in WPB-19579.
No more implicit _most recent_ credential logic
This is the only real use case for the `identities` module
`find_credentials()` does a superset of what this function used to do - except relying on the implicit _most recent_ logic.
In the parent commit, we just replaced all instances of `find_most_recent_credential()` with `Conversation.find_current_credential()` to cause the code to compile. This is good enough in some cases, but in others we have to be smarter than that: When updating credentials, we need to ensure that we're signing with the signature key of the leaf node we're inserting, but `find_current_credential()` gives us the old one. This commit takes care of that.
Also, refactor a test that would fail after this removal due to clumsy setup.
The `Identities` struct was blocking us from removing ciphersuite/signature scheme parameters from session initialization.
Also, stop loading credentials during `mls_init()` - this is not needed anymore since we're not using the identities cache anymore.
Also, this adds `setConversationCredential()`, which was previously missing in the wrapper.
353d7d5 to
d4ddda1
Compare
What's new in this PR
PR Submission Checklist for internal contributors
SQPIT-764feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.