-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvault-backend-secrets.sh
44 lines (34 loc) · 1.21 KB
/
vault-backend-secrets.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
function writeSecretAndReadAsText()
{
printf "***** Writing secrets and reading as text\n"
_vaultClientDefaultToken write secret/hello1 value=world
_vaultClientDefaultToken read secret/hello1
}
function writeSecretAndReadAsJson()
{
printf "***** Writing secrets and reading as JSON\n"
_vaultClientDefaultToken write secret/hello2 value=world excited=yes
printf "$(_vaultClientDefaultToken read -format=json secret/hello2)" | jq
}
function deleteSecret()
{
printf "***** Writing secrets, deleting them and writing them again\n"
_vaultClientDefaultToken delete secret/hello3
_vaultClientDefaultToken write secret/hello3 value=world3
_vaultClientDefaultToken delete secret/hello3
_vaultClientDefaultToken write secret/hello3 value=world3
}
function showMountPointsForSecretBackends()
{
printf "***** Showing mount points for secret backends\n"
_vaultClientDefaultToken mounts
}
function showMountPointsIsolation()
{
printf "***** Showing mount points isolation\n"
_vaultClientDefaultToken mount generic
_vaultClientDefaultToken write generic/hallo value=foobar
_vaultClientDefaultToken read secret/hallo
_vaultClientDefaultToken unmount generic
}