You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i managed to fix this by changing the struct to this
// KvV2WriteRequest struct for KvV2WriteRequesttypeKvV2WriteRequeststruct {
// The contents of the data map will be stored and returned on read.Datamap[string]interface{} `json:"data"`// Options for writing a KV entry. Set the \"cas\" value to use a Check-And-Set operation. If not set the write will be allowed. If set to 0 a write will only be allowed if the key doesn’t exist. If the index is non-zero the write will only be allowed if the key’s current version matches the version specified in the cas parameter.Optionsmap[string]interface{} `json:"options,omitempty"`// If provided during a read, the value at the version number will be returnedVersionint32`json:"version,omitempty"`
}
by removing the omitempty, the data is correctly sent in the json as an empty object and the vault backend understands the request
The text was updated successfully, but these errors were encountered:
Expected Behavior
Using KvV2Write with empty data should clear the secrets of keys
https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2#create-update-secret
Current Behavior
Using KvV2Write with empty data yields a 400 with a message stating "no data provided"
Failure Information
vault-client-go v0.4.3
vault 1.13.3
Steps to Reproduce
Additional Information
i managed to fix this by changing the struct to this
by removing the omitempty, the data is correctly sent in the json as an empty object and the vault backend understands the request
The text was updated successfully, but these errors were encountered: