1

Let's say, I have two users online and batch who do CRUD operations on resources of a custom server. These two users have different access levels for different resources. I want to create one object such that, the server recognizes the credential pairs and only one particular pair is used by an application as required.

In particular, the server requires the credential pair in the format as shown below.

online:password1
batch:password2

Suppose, I build an object such as kv/server/server-acl with the following.

key1=online
val1=password1
key2=batch
val2=password2

How do I transform the above to username:password format for the server to consume?

Note that, the above object is helpful when providing credentials to applications. For example, I can use the vault.hashicorp.com/agent-inject-secret-server : "kv/server/server-acl" annotation and for an online application, render with {{ .Data.data.key1 }} and {{ .Data.data.val1 }} for user name and password respectively.

1
  • It seems, creation of multiple key-value pairs is the norm as opposed to having multiple key-pairs in a single object (as mentioned in my example above). See here: discuss.hashicorp.com/t/… May 20, 2020 at 13:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.