Vault Transit Api - Checking if a key is present

242 views
Skip to first unread message

aar....@gmail.com

unread,
Apr 14, 2016, 3:57:10 PM4/14/16
to Vault
I would like to check if a particular key is present on the transit backend.

I thought I could use the /transit/keys/<name> api to check. But I only get a 404 Response.

Is this reliable as a method? Can something else be done?

Jeff Mitchell

unread,
Apr 14, 2016, 5:10:16 PM4/14/16
to vault...@googlegroups.com
You should be able to issue a GET on /transit/keys/<name>.

If you provide the actual command and response I might be able to
better say what's going wrong.

Best,
Jeff
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/hashicorp/vault/issues
> IRC: #vault-tool on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vault" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vault-tool+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vault-tool/fd993165-523d-45c3-873f-b83128175c21%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

aar....@gmail.com

unread,
Apr 15, 2016, 3:19:50 PM4/15/16
to Vault
I am issuing the GET for http://localhost:8200/v1/transit/keys/testKeyName     where testKeyName does not exist
but instantly get a 404 not found

I do not believe a 404 is the most reliable means to tell that the call was successful but the key is not there.

Jeff Mitchell

unread,
Apr 15, 2016, 4:53:32 PM4/15/16
to vault...@googlegroups.com
Hi there,

Vault's API is mostly CRUD-conformant and resources within Vault are
addressed almost exclusively via URL. As a result, if no key exists
with that name, it is correct to indicate that the resource was not
found.

Best,
Jeff
> https://groups.google.com/d/msgid/vault-tool/c7f02273-f95e-4e57-babe-8b9e181684a7%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages