mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
python create_secrets, update_secrets and delete_secrets docs
This commit is contained in:
@@ -13,9 +13,7 @@ Prerequisites:
|
||||
## Example
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Javascript">
|
||||
</Tab>
|
||||
</Tabs>
|
||||
<Tab title="Javascript">
|
||||
```js
|
||||
const axios = require('axios');
|
||||
const BASE_URL = 'https://app.infisical.com';
|
||||
@@ -40,7 +38,32 @@ const deleteSecrets = async () => {
|
||||
|
||||
deleteSecrets();
|
||||
```
|
||||
</Tab>
|
||||
|
||||
<Tab title="Python">
|
||||
```Python
|
||||
import requests
|
||||
|
||||
BASE_URL = "https://app.infisical.com"
|
||||
|
||||
|
||||
def delete_secrets():
|
||||
service_token = "<your_service_token>"
|
||||
secret_id = "id_of_secret_to_delete"
|
||||
|
||||
# Send ID(s) of secret(s) to delete to the Infisical API
|
||||
requests.delete(
|
||||
f"{BASE_URL}/api/v2/secrets",
|
||||
json={"secretIds": [secret_id]},
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user