-
Notifications
You must be signed in to change notification settings - Fork 23
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
Database migration for HMAC Key Records #1377
Conversation
|
||
impl DbConnection { | ||
/// Returns all hmac_key_records for the given group_id | ||
pub fn get_hmac_key_records( |
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.
sugesstion: does impl_fetch_list_with_key!
the same job?
} | ||
|
||
/// Insert hmac_key_records without replacing existing ones | ||
pub fn insert_hmac_key_records( |
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.
suggestion: can we use impl_fetch_list_with_key!
Sorry, mistakenly updated the PR! |
@@ -0,0 +1,11 @@ | |||
CREATE TABLE "hmac_key_records"( | |||
-- Group ID that the Hmac keys are associated with | |||
"group_id" BLOB NOT NULL, |
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.
I did this based off of the hmac keys work in V2 but @codabrink mentioned we might be doing this based on inboxId now. So maybe this is irrelevant in V3?
Some high-level thoughts, based on our previous discussion about deriving the hmac key from a user secret rather than a group secret in v3. It might be worth looping @codabrink into this PR too:
|
Closing out for now infavor of a more general database long term for these kinds of preferences similar to our consent records DB. |
Part of #422
Adds the database table for hmac key records
Matches the structure currently used for hmac keys in V2 https://github.com/xmtp/proto/blob/main/proto/keystore_api/v1/keystore.proto#L306-L317