-
-
Notifications
You must be signed in to change notification settings - Fork 256
feat(seedless-onboarding): add dataType support for secret data items #7284
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
Draft
huggingbot
wants to merge
8
commits into
main
Choose a base branch
from
feat/data-type
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
611556b
feat(seedless-onboarding): add dataType support for secret data items
huggingbot 85275f5
refactor: Removed default dataType parameter from createToprfKeyAndBa…
huggingbot fc73107
refactor: update documentation for secret data item methods
huggingbot 3afa879
refactor: enhance primary secret data validation in SeedlessOnboardin…
huggingbot 90d642b
fix: Update sorting mechanism to prioritize PrimarySrp dataType over …
huggingbot ac52a76
feat(seedless-onboarding-controller): add createdAt field and sort by…
huggingbot 11c09f8
feat(seedless-onboarding-controller): add storage metadata to SecretM…
huggingbot 2885314
fix(seedless-onboarding-controller): use timestamp extraction for TIM…
huggingbot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refactor: update documentation for secret data item methods
- Loading branch information
commit fc73107ccdf8d53ebdd56b5ba0bee5c87592136b
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -538,14 +538,17 @@ export class SeedlessOnboardingController< | |
| } | ||
|
|
||
| /** | ||
| * Update fields for an existing secret data item by itemId. | ||
| * Update the dataType for an existing secret data item. | ||
| * | ||
| * This method updates metadata fields for an existing secret data item | ||
| * without modifying the encrypted data itself. | ||
| * This is used for migrating legacy data that was stored before the dataType | ||
| * field was introduced. When users created wallets with older SDK versions, | ||
| * their secrets were stored without dataType classification. This method allows | ||
| * clients to retroactively assign the correct dataType (e.g., PrimarySrp, | ||
| * ImportedSrp) when the wallet is unlocked. | ||
| * | ||
| * @param params - The parameters for updating the secret data item. | ||
| * @param params.itemId - The item ID of the secret data to update. | ||
| * @param params.dataType - The data type to set for the item. | ||
| * @param params.itemId - The server-assigned item ID from fetchAllSecretData. | ||
| * @param params.dataType - The data type classification to assign. | ||
| * @returns A promise that resolves when the update is complete. | ||
| */ | ||
| async updateSecretDataItem(params: { | ||
|
|
@@ -588,13 +591,14 @@ export class SeedlessOnboardingController< | |
| } | ||
|
|
||
| /** | ||
| * Batch update fields for multiple existing secret data items by their itemIds. | ||
| * Batch update the dataType for multiple existing secret data items. | ||
| * | ||
| * This method updates metadata fields for multiple existing secret data items | ||
| * without modifying the encrypted data itself. | ||
| * This is the batch version of updateSecretDataItem, used for migrating | ||
| * multiple legacy secrets in a single operation. Useful when a user with | ||
| * multiple SRPs/private keys upgrades from an older SDK version. | ||
| * | ||
| * @param params - The parameters for batch updating secret data items. | ||
| * @param params.updates - Array of objects containing itemId and fields to update. | ||
| * @param params.updates - Array of objects containing itemId and dataType to assign. | ||
| * @returns A promise that resolves when all updates are complete. | ||
| */ | ||
| async batchUpdateSecretDataItems(params: { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added more notes here |
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can we specify why and when we need to call this? since in the clients,
update*is not something we usually do with SRPsUh oh!
There was an error while loading. Please reload this page.
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.
it's used to migrate existing users to update the
data_typecolumn in the metadata service. Currently the server doesn't know the type of secret (it's encrypted). It needs to know for the deletion API to work: to prevent clients from deleting the default SRPThere 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.
added more notes here