-
Notifications
You must be signed in to change notification settings - Fork 24
Add messages for CRUDL operations #1314
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
Conversation
👋 @cedric-cordenier, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
08b7c84
to
9999e88
Compare
SecretIdentifier id = 1; | ||
string encrypted_value = 2; | ||
repeated EncryptedShares encrypted_decryption_key_shares = 3; | ||
string error = 4; |
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.
Optional: proto allows us to tag some fields as optional, to indicate they can be omitted, and easily checked in code with logic.
Example :
message SecretResponse {
.
.
optional string encrypted_value = 2;
optional string error = 4;
}
Then in go code:
secretResponse.has_error() OR
secretResponse.has_encryptedValue()
This is instead of directly checking if these are empty strings.
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.
My preference would be to split this into
message SecretResponse {
SecretIdentifier id = 1;
oneof result {
SecretData success_data = 2;
string error = 3;
}
}
message SecretData {
string encrypted_value = 1;
repeated EncryptedShares encrypted_decryption_key_shares = 2;
}
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 went with the oneof :)
5a057f9
to
bd005f9
Compare
Requires
Supports