-
Notifications
You must be signed in to change notification settings - Fork 3
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
#37 Add ability to create users with needs rotation and rotate their key #39
Conversation
src/Constants.ts
Outdated
@@ -39,6 +39,9 @@ export const ErrorCodes = { | |||
USER_DEVICE_KEY_GENERATION_FAILURE: 207, | |||
USER_DEVICE_LIST_REQUEST_FAILURE: 208, | |||
USER_DEVICE_DELETE_REQUEST_FAILURE: 209, | |||
USER_UPDATE_KEY_REQUEST_FAILURE: 210, | |||
USER_PRIVATE_KEY_ROTATION_FAILURE: 211, | |||
USER_CURRENT_GET_REQUEST_FAILURE: 212, |
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.
USER_CURRENT_GET_REQUEST_FAILURE: 212, | |
USER_GET_CURRENT_REQUEST_FAILURE: 212, |
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.
Actually just removed this for now as we don't need it.
/** | ||
* Augments the provided user private key and return both the augmented private key and the augmentation factor. | ||
*/ | ||
const rotateUsersPrivateKey = (userPrivateKey: Buffer): Future<Error, {newPrivateKey: Buffer; augmentationFactor: Buffer}> => { |
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.
Should we export this too so they could use it without retry if desired?
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 can't imagine a situation where you would never want to retry.
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.
Ya, this method isn't exposed out to callers, it's all wrapped behind the key rotation call. Given the low likelihood of it actually failing I don't think it matters.
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.
Looks good to me.
/** | ||
* Augments the provided user private key and return both the augmented private key and the augmentation factor. | ||
*/ | ||
const rotateUsersPrivateKey = (userPrivateKey: Buffer): Future<Error, {newPrivateKey: Buffer; augmentationFactor: Buffer}> => { |
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 can't imagine a situation where you would never want to retry.
* #37 Add ability to create users with needs rotation and rotate th… (#39) * #37 Add ability to create users with needs rotation and rotate their key * Remove unused error code * #37 Add key rotation for groups and change init response to retur… (#40) * #37 Add key rotation for groups and change init response to return info about current user for rotation purposes * Expand details in comment * Add missing test, bump up test coverage leniency for Recrypt tests
No description provided.