-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
allow null types in batch encryption [VAULT-849] #10386
Conversation
@@ -154,39 +155,49 @@ func decodeBatchRequestItems(src interface{}, dst *[]BatchRequestItem) error { | |||
} | |||
|
|||
if v, has := item["context"]; has { | |||
if casted, ok := v.(string); ok { | |||
val := reflect.ValueOf(v) |
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.
Nit: We may not need val
. How about if !reflect.ValueOf(v).IsValid()
?
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.
Sounds good! Thank you for the review!
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.
One small comment. Otherwise this is looking good.
I updated the PR to not allow plaintext to be "null". Everything else can have a "null" string as a value, as they are optional parameters in different situations. I let the ciphertext field be "null" as well, even though it shouldn't be necessary, because this value is not set by a vault user. |
This PR is to allow null values in the encryption payload, so as to be backward compatible with 1.4 functionality.