-
Notifications
You must be signed in to change notification settings - Fork 989
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update docs for blind indices and secrets v3 endpoints
- Loading branch information
1 parent
ad5852f
commit 9f94413
Showing
18 changed files
with
1,465 additions
and
225 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
--- | ||
title: "Create" | ||
openapi: "POST /api/v2/secrets/" | ||
openapi: "POST /api/v3/secrets/{secretName}" | ||
--- | ||
|
||
<Tip> | ||
Using this route requires understanding Infisical's system and cryptography. | ||
It may be helpful to read through the | ||
[introduction](/api-reference/overview/introduction) and [guide for creating | ||
secrets](/api-reference/overview/examples/create-secrets). | ||
secrets](/api-reference/overview/examples/create-secret). | ||
</Tip> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
--- | ||
title: "Delete" | ||
openapi: "DELETE /api/v2/secrets/" | ||
openapi: "DELETE /api/v3/secrets/{secretName}" | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: "Retrieve" | ||
openapi: "GET /api/v3/secrets/{secretName}" | ||
--- | ||
|
||
<Tip> | ||
Using this route requires understanding Infisical's system and cryptography. | ||
It may be helpful to read through the | ||
[introduction](/api-reference/overview/introduction) and [guide for retrieving | ||
secrets](/api-reference/overview/examples/retrieve-secret). | ||
</Tip> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
--- | ||
title: "Retrieve" | ||
openapi: "GET /api/v2/secrets/" | ||
title: "Retrieve All" | ||
openapi: "GET /api/v3/secrets/" | ||
--- | ||
|
||
<Tip> | ||
Using this route requires understanding Infisical's system and cryptography. | ||
It may be helpful to read through the | ||
[introduction](/api-reference/overview/introduction) and [guide for retrieving | ||
secrets](/api-reference/overview/examples/retrieve-secrets). | ||
secrets](/api-reference/overview/examples/retrieve-secret). | ||
</Tip> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
--- | ||
title: "Update" | ||
openapi: "PATCH /api/v2/secrets/" | ||
openapi: "PATCH /api/v3/secrets/{secretName}" | ||
--- | ||
|
||
<Tip> | ||
Using this route requires understanding Infisical's system and cryptography. | ||
It may be helpful to read through the | ||
[introduction](/api-reference/overview/introduction) and [guide for updating | ||
secrets](/api-reference/overview/examples/update-secrets). | ||
secrets](/api-reference/overview/examples/update-secret). | ||
</Tip> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: "Blind Indices" | ||
--- | ||
|
||
In April 2023, we added the capability for users to query for secrets by name to improve the user experience of Infisical. Previously, it was only possible to query by id of the secret or fetch all secrets belonging to a project and environment. | ||
|
||
Blind indexing must be enabled for projects created prior to April 2023 to take effect. If your project can be blind indexed, then you'll see a section in your project settings appear as shown below: | ||
|
||
![project enable blind indices](../../images/project-settings-blind-indices.png) | ||
|
||
|
||
It works using virtually irreversible blind indices generated by applying `argon2id` to the name of each secret and a random 128-bit salt assigned to each project on the server. We continue to keep the values of secrets E2EE by default. | ||
|
||
You can read more about it [here](/security/mechanics). | ||
|
||
<Note> | ||
As previously mentioned, all projects made after April 2023 are automatically blind indexed. If you created a project before this date, you have to enable it manually in your project settings. | ||
</Note> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
--- | ||
title: "Delete secret" | ||
description: "How to delete a secret using an Infisical Token scoped to a project and environment" | ||
--- | ||
|
||
Prerequisites: | ||
|
||
- Set up and add envars to [Infisical Cloud](https://app.infisical.com). | ||
- Create either an [API Key](/api-reference/overview/authentication) or [Infisical Token](../../../getting-started/dashboard/token) for your project and environment with write access enabled. | ||
- Grasp a basic understanding of the system and its underlying cryptography [here](/api-reference/overview/introduction). | ||
- [Ensure that your project is blind-indexed](../blind-indices). | ||
|
||
## Example | ||
|
||
<Tabs> | ||
<Tab title="Javascript"> | ||
```js | ||
const axios = require('axios'); | ||
const BASE_URL = 'https://app.infisical.com'; | ||
|
||
const deleteSecrets = async () => { | ||
const serviceToken = 'your_service_token'; | ||
const secretType = 'shared' // 'shared' or 'personal' | ||
const secretKey = 'some_key' | ||
|
||
// 1. Get your Infisical Token data | ||
const { data: serviceTokenData } = await axios.get( | ||
`${BASE_URL}/api/v2/service-token`, | ||
{ | ||
headers: { | ||
Authorization: `Bearer ${serviceToken}` | ||
} | ||
} | ||
); | ||
|
||
// 2. Delete secret from Infisical | ||
await axios.delete( | ||
`${BASE_URL}/api/v3/secrets/${secretKey}`, | ||
{ | ||
workspaceId: serviceTokenData.workspace, | ||
environment: serviceTokenData.environment, | ||
type: secretType | ||
}, | ||
{ | ||
headers: { | ||
Authorization: `Bearer ${serviceToken}` | ||
}, | ||
} | ||
); | ||
}; | ||
|
||
deleteSecrets(); | ||
``` | ||
</Tab> | ||
|
||
<Tab title="Python"> | ||
```Python | ||
import requests | ||
|
||
BASE_URL = "https://app.infisical.com" | ||
|
||
|
||
def delete_secrets(): | ||
service_token = "<your_service_token>" | ||
secret_type = "shared" # "shared" or "personal" | ||
secret_key = "some_key" | ||
|
||
# 1. Get your Infisical Token data | ||
service_token_data = requests.get( | ||
f"{BASE_URL}/api/v2/service-token", | ||
headers={"Authorization": f"Bearer {service_token}"}, | ||
).json() | ||
|
||
# 2. Delete secret from Infisical | ||
requests.delete( | ||
f"{BASE_URL}/api/v2/secrets/{secret_key}", | ||
json={ | ||
"workspaceId": service_token_data["workspace"], | ||
"environment": service_token_data["environment"], | ||
"type": secret_type | ||
}, | ||
headers={"Authorization": f"Bearer {service_token}"}, | ||
) | ||
|
||
|
||
delete_secrets() | ||
|
||
``` | ||
</Tab> | ||
</Tabs> | ||
<Info> | ||
If using an `API_KEY` to authenticate with the Infisical API, then you should include it in the `X_API_KEY` header. | ||
</Info> | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.