diff --git a/vendor/github.com/hashicorp/vault-plugin-secrets-kv/options.json b/vendor/github.com/hashicorp/vault-plugin-secrets-kv/options.json deleted file mode 100644 index 150e5a024..000000000 --- a/vendor/github.com/hashicorp/vault-plugin-secrets-kv/options.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "options": { - }, - "data": { - "bar": "baz" - } -} diff --git a/vendor/github.com/hashicorp/vault-plugin-secrets-kv/path_data.go b/vendor/github.com/hashicorp/vault-plugin-secrets-kv/path_data.go index 7e73459ab..9a777e8c4 100644 --- a/vendor/github.com/hashicorp/vault-plugin-secrets-kv/path_data.go +++ b/vendor/github.com/hashicorp/vault-plugin-secrets-kv/path_data.go @@ -49,11 +49,26 @@ version matches the version specified in the cas parameter.`, logical.DeleteOperation: b.upgradeCheck(b.pathDataDelete()), }, + ExistenceCheck: b.dataExistenceCheck(), + HelpSynopsis: dataHelpSyn, HelpDescription: dataHelpDesc, } } +func (b *versionedKVBackend) dataExistenceCheck() framework.ExistenceFunc { + return func(ctx context.Context, req *logical.Request, data *framework.FieldData) (bool, error) { + key := strings.TrimPrefix(req.Path, "data/") + + meta, err := b.getKeyMetadata(ctx, req.Storage, key) + if err != nil { + return false, err + } + + return meta != nil, nil + } +} + // pathDataRead handles read commands to a kv entry func (b *versionedKVBackend) pathDataRead() framework.OperationFunc { return func(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) { diff --git a/vendor/vendor.json b/vendor/vendor.json index 72a286c19..39e312239 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -1303,10 +1303,10 @@ "revisionTime": "2018-03-20T18:05:36Z" }, { - "checksumSHA1": "j3fIbBNDLAjg8pH3FnmbcqGcCVo=", + "checksumSHA1": "ZYuIUFGjAZ2rgy/zwdjfANFZc/U=", "path": "github.com/hashicorp/vault-plugin-secrets-kv", - "revision": "d56826f0e6c085b99e83d984e7bb69b2f6655a45", - "revisionTime": "2018-03-22T01:57:02Z" + "revision": "76db4647de517c512e7f87b78c1afc84acf97918", + "revisionTime": "2018-03-22T02:53:20Z" }, { "checksumSHA1": "vTfeYxi0Z1y176bjQaYh1/FpQ9s=",