export VAULT_ADDR=http://127.0.0.2:8200
export VAULT_TOKEN=$(cat root_token-vault_2)
vault secrets enable -path="secret" kv
vault secrets list
vault policy write writer policies/write-app-policy.hcl
vault policy list
vault token create -ttl=1h -use-limit=4 -explicit-max-ttl=120h -policy=writer -format=json | jq -r ".auth.client_token" | awk '{print "token="$1}' > src/main/resources/writer.properties
java -cp gs-accessing-vault-0.1.0.jar -Dloader.main=hello.WriterApp org.springframework.boot.loader.PropertiesLauncher <config_path> <host> <port> <key> <value>
vault policy write reader policies/read-app-policy.hcl
vault policy list
vault token create -ttl=1h -use-limit=2 -explicit-max-ttl=120h -policy=reader -format=json | jq -r ".auth.client_token" | awk '{print "token="$1}' > src/main/resources/reader.properties
java -cp gs-accessing-vault-0.1.0.jar -Dloader.main=hello.ReaderApp org.springframework.boot.loader.PropertiesLauncher <config_path> <host> <port>
vault secrets enable transit
vault secrets list
vault write -f transit/keys/secret
vault policy write encryption policies/encrypt-app-policy.hcl
vault token create -ttl=1h -use-limit=99 -explicit-max-ttl=120h -policy=encryption -format=json | jq -r ".auth.client_token" | awk '{print "token="$1}' > src/main/resources/encryption.properties
java -cp gs-accessing-vault-0.1.0.jar -Dloader.main=hello.EncryptionApp org.springframework.boot.loader.PropertiesLauncher <config_path> <host> <port>