Secrets

Overview

Secrets are text strings stored encrypted in the vault that can be retrieved by authorized users. The maximum allowed length of a stored secret is 4096 bytes

List Secrets

To list the secrets stored in a vault, you need to provide the vaultid of the vault.

curl -i \
-H 'Authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhwIjoxNTk0Mzk2Nzk4LCJpYXQiOjE1OTQzMTAzOTgsImlzcyI6Imh0dHBzOi8vaWRlbnQucHJvdmlkZS5zZXJ2aWNlcyIsImp0aSI6IjIzN2JjZjdjLTFkMGUtNDIxOS05OWEyLWVlMGQ2MWQ1MTAxMyIsIm5hdHMiOnsicGVybWlzc2lvbnMiOnsic3Vic2NyaWJlIjp7ImFsbG93IjpbInVzZXIuMjg0ZDJiMWEtMTc3OS00MjRiLWI2YzUtMzAyYTc5YzE1NGExIiwibmV0d29yay4qLmNvbm5lY3Rvci4qIiwibmV0d29yay4qLnN0YXR1cyIsInBsYXRmb3JtLlx1MDAzZSJdfX19LCJwcnZkIjp7InBlcm1pc3Npb25zIjo3NTUzLCJ1c2VyX2lkIjoiMjg0ZDJiMWEtMTc3OS00MjRiLWI2YzUtMzAyYTc5YzE1NGExIn0sInN1YiI6InVzZXI6Mjg0ZDJiMWEtMTc3OS00MjRiLWI2YzUtMzAyYTc5YzE1NGExIn0.q-3XLO1ikupPv0sp2CtiQv3kYFVgVnsh0BQGyqKc9-6GyQIC-pKgTOJWK2ZqOk5-ovGDYXV3i5i_oNDzZo3IahdRoGev06-tuH55TX2Qla5z5GHNSWd7TrqzWEVnE3OsVAwkpYi4MDDcTbODi_z6yOEwIO2BARkXI3Nh5inDwlKpUvnFDq3858r8E0yRVv7MMjFoYxtpMZ-Wdy63j7ICehLSTmya7WYCxu_9dnmZEZd1UJuDjfAh54uRINNJS4BH3qPDD-pgF1k-k3emC82G-livcjhCx7ApsJngjb858qKCGB0N-HCnpLO3TnPcCUJRTJq8jUjpI2KndEfEP_i1xTAep4pT4qdWpDIFZr45GROlGrQe5N9Sr_TpqJoOWJJ0_eZeTnKhr99VRxt740iNAW1jxJcPVYitc8hL3WL27jHFPK060DLXnRoLLCdc6mPiRKKi33yoa1mEWIObA7PfccbC-fYi4uO4XCis4nkApzD4WqvgkBIe7FnT7LyHzhANgbL32jU9QYa1JeBPpbwyan2rSDEHEHRtAPYlUtpc4t42uYGYGEMokSG2fAuFlvyVzGeQEWBY-Wl-0pgRERlzjFJv65rbF1MidWPNeKuVWMdQ8a1TIhgZ235uRCahW9b6jMqAyUxmLfJg88fI6jLSSobzyxkdeYo95cfTEY1hY_I' \
https://ident.provide.services/api/v1/vaults/e2efa148-b71f-4f2e-9a56-b90cfa804955/secrets
HTTP/2 200

Response JSON:

[
{
"id": "b31830db-81ee-4831-b6ee-a3d9898c2aa7",
"created_at": "2020-07-09T16:17:28.670485Z",
"vault_id": "e2efa148-b71f-4f2e-9a56-b90cfa804955",
"type": "sample secret",
"name": "secret #1",
"description": "this secret is being stored for demonstration purposes"
},
{
"id": "e84776dd-6f22-4cd8-98ab-22da8642298d",
"created_at": "2020-07-09T16:31:51.618166Z",
"vault_id": "e2efa148-b71f-4f2e-9a56-b90cfa804955",
"type": "sample secret",
"name": "secret #2",
"description": "this secret is being stored for demonstration purposes"
},
{
"id": "be9a1afe-7251-4556-b37a-b1f51fa3e547",
"created_at": "2020-07-09T16:32:05.088404Z",
"vault_id": "e2efa148-b71f-4f2e-9a56-b90cfa804955",
"type": "sample secret",
"name": "secret #3",
"description": "this secret is being stored for demonstration purposes"
}
]

Store Secret

As can be seen below, to store a secret, a number of request parameters must be provided. These are:

Request Parameters

Parameter

Description

secret

the secret to be stored. This is mandatory and cannot be empty (4096-byte maximum)

name

the name of the secret (free text field). This is mandatory and cannot be empty

type

the type of secret (free text field). This is mandatory and cannot be empty

description

the description of the secret (free text field). This is not mandatory

curl -i -XPOST \
-H 'Authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhwIjoxNTk0Mzk2Nzk4LCJpYXQiOjE1OTQzMTAzOTgsImlzcyI6Imh0dHBzOi8vaWRlbnQucHJvdmlkZS5zZXJ2aWNlcyIsImp0aSI6IjIzN2JjZjdjLTFkMGUtNDIxOS05OWEyLWVlMGQ2MWQ1MTAxMyIsIm5hdHMiOnsicGVybWlzc2lvbnMiOnsic3Vic2NyaWJlIjp7ImFsbG93IjpbInVzZXIuMjg0ZDJiMWEtMTc3OS00MjRiLWI2YzUtMzAyYTc5YzE1NGExIiwibmV0d29yay4qLmNvbm5lY3Rvci4qIiwibmV0d29yay4qLnN0YXR1cyIsInBsYXRmb3JtLlx1MDAzZSJdfX19LCJwcnZkIjp7InBlcm1pc3Npb25zIjo3NTUzLCJ1c2VyX2lkIjoiMjg0ZDJiMWEtMTc3OS00MjRiLWI2YzUtMzAyYTc5YzE1NGExIn0sInN1YiI6InVzZXI6Mjg0ZDJiMWEtMTc3OS00MjRiLWI2YzUtMzAyYTc5YzE1NGExIn0.q-3XLO1ikupPv0sp2CtiQv3kYFVgVnsh0BQGyqKc9-6GyQIC-pKgTOJWK2ZqOk5-ovGDYXV3i5i_oNDzZo3IahdRoGev06-tuH55TX2Qla5z5GHNSWd7TrqzWEVnE3OsVAwkpYi4MDDcTbODi_z6yOEwIO2BARkXI3Nh5inDwlKpUvnFDq3858r8E0yRVv7MMjFoYxtpMZ-Wdy63j7ICehLSTmya7WYCxu_9dnmZEZd1UJuDjfAh54uRINNJS4BH3qPDD-pgF1k-k3emC82G-livcjhCx7ApsJngjb858qKCGB0N-HCnpLO3TnPcCUJRTJq8jUjpI2KndEfEP_i1xTAep4pT4qdWpDIFZr45GROlGrQe5N9Sr_TpqJoOWJJ0_eZeTnKhr99VRxt740iNAW1jxJcPVYitc8hL3WL27jHFPK060DLXnRoLLCdc6mPiRKKi33yoa1mEWIObA7PfccbC-fYi4uO4XCis4nkApzD4WqvgkBIe7FnT7LyHzhANgbL32jU9QYa1JeBPpbwyan2rSDEHEHRtAPYlUtpc4t42uYGYGEMokSG2fAuFlvyVzGeQEWBY-Wl-0pgRERlzjFJv65rbF1MidWPNeKuVWMdQ8a1TIhgZ235uRCahW9b6jMqAyUxmLfJg88fI6jLSSobzyxkdeYo95cfTEY1hY_I' \
https://ident.provide.services/api/v1/vaults/e2efa148-b71f-4f2e-9a56-b90cfa804955/secrets \
-d '{
"secret": "secret to be stored",
"name": "secret #1",
"type": "sample secret",
"description": "this secret is being stored for demonstration purposes"
}'
HTTP/2 201

Response JSON

{
"id": "b31830db-81ee-4831-b6ee-a3d9898c2aa7",
"created_at": "2020-07-09T16:17:28.67048471Z",
"vault_id": "e2efa148-b71f-4f2e-9a56-b90cfa804955",
"type": "sample secret",
"name": "secret #1",
"description": "this secret is being stored for demonstration purposes"
}

Retrieve Secret

To retrieve a secret, you need to provide the vaultid of the vault containing the secret and the secretid of the secret.

curl -i \
-H 'Authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhwIjoxNTk0Mzk2Nzk4LCJpYXQiOjE1OTQzMTAzOTgsImlzcyI6Imh0dHBzOi8vaWRlbnQucHJvdmlkZS5zZXJ2aWNlcyIsImp0aSI6IjIzN2JjZjdjLTFkMGUtNDIxOS05OWEyLWVlMGQ2MWQ1MTAxMyIsIm5hdHMiOnsicGVybWlzc2lvbnM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ets/b31830db-81ee-4831-b6ee-a3d9898c2aa7
HTTP/2 200

Response JSON

{
"id": "b31830db-81ee-4831-b6ee-a3d9898c2aa7",
"created_at": "2020-07-09T16:17:28.670485Z",
"vault_id": "e2efa148-b71f-4f2e-9a56-b90cfa804955",
"type": "sample secret",
"name": "secret #1",
"description": "this secret is being stored for demonstration purposes",
"rawsecret": "secret to be stored"
}

Delete Secret

To delete a secret, you need to provide the vaultid of the vault containing the secret and the secretid of the secret.

curl -X "DELETE" \
-H 'Authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwOjJlOmQ5OmUxOmI4OmEyOjM0OjM3Ojk5OjNhOjI0OmZjOmFhOmQxOmM4OjU5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJodHRwczovL3Byb3ZpZGUuc2VydmljZXMvYXBpL3YxIiwiZXhwIjoxNTk0Mzk2Nzk4LCJpYXQiOjE1OTQzMTAzOTgsImlzcyI6Imh0dHBzOi8vaWRlbnQucHJvdmlkZS5zZXJ2aWNlcyIsImp0aSI6IjIzN2JjZjdjLTFkMGUtNDIxOS05OWEyLWVlMGQ2MWQ1MTAxMyIsIm5hdHMiOnsicGVybWlzc2lvbnMiOnsic3Vic2NyaWJlIjp7ImFsbG93IjpbInVzZXIuMjg0ZDJiMWEtMTc3OS00MjRiLWI2YzUtMzAyYTc5YzE1NGExIiwibmV0d29yay4qLmNvbm5lY3Rvci4qIiwibmV0d29yay4qLnN0YXR1cyIsInBsYXRmb3JtLlx1MDAzZSJdfX19LCJwcnZkIjp7InBlcm1pc3Npb25zIjo3NTUzLCJ1c2VyX2lkIjoiMjg0ZDJiMWEtMTc3OS00MjRiLWI2YzUtMzAyYTc5YzE1NGExIn0sInN1YiI6InVzZXI6Mjg0ZDJiMWEtMTc3OS00MjRiLWI2YzUtMzAyYTc5YzE1NGExIn0.q-3XLO1ikupPv0sp2CtiQv3kYFVgVnsh0BQGyqKc9-6GyQIC-pKgTOJWK2ZqOk5-ovGDYXV3i5i_oNDzZo3IahdRoGev06-tuH55TX2Qla5z5GHNSWd7TrqzWEVnE3OsVAwkpYi4MDDcTbODi_z6yOEwIO2BARkXI3Nh5inDwlKpUvnFDq3858r8E0yRVv7MMjFoYxtpMZ-Wdy63j7ICehLSTmya7WYCxu_9dnmZEZd1UJuDjfAh54uRINNJS4BH3qPDD-pgF1k-k3emC82G-livcjhCx7ApsJngjb858qKCGB0N-HCnpLO3TnPcCUJRTJq8jUjpI2KndEfEP_i1xTAep4pT4qdWpDIFZr45GROlGrQe5N9Sr_TpqJoOWJJ0_eZeTnKhr99VRxt740iNAW1jxJcPVYitc8hL3WL27jHFPK060DLXnRoLLCdc6mPiRKKi33yoa1mEWIObA7PfccbC-fYi4uO4XCis4nkApzD4WqvgkBIe7FnT7LyHzhANgbL32jU9QYa1JeBPpbwyan2rSDEHEHRtAPYlUtpc4t42uYGYGEMokSG2fAuFlvyVzGeQEWBY-Wl-0pgRERlzjFJv65rbF1MidWPNeKuVWMdQ8a1TIhgZ235uRCahW9b6jMqAyUxmLfJg88fI6jLSSobzyxkdeYo95cfTEY1hY_I' \
https://ident.provide.services/api/v1/vaults/e2efa148-b71f-4f2e-9a56-b90cfa804955/secrets/fae299c3-e7d5-4574-a832-7cda137b2517
HTTP/2 204