Skip to main content

Methods

List secrets associated with a user filtered with optional parameters passed in the body.

Parameters

limit
typing.Optional[int]
Number of items per page
offset
typing.Optional[int]
Number of items to skip
secret_fqns
typing.Optional[typing.Sequence[str]]
Array of FQNs
secret_group_id
typing.Optional[str]
Secret Group Id of the secret gourp.
with_value
typing.Optional[bool]
Whether to include the secret values in the response. Defaults to false.

Returns

SyncPager[Secret]
SyncPager[Secret]
🔗 SecretReturns the secrets associated with a user filtered with optional parameters passed in the body.

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.secrets.list(
    limit=10,
    offset=10,
    secret_fqns="value",
    secret_group_id="value",
    with_value="value",
)

# Iterate through results
for item in response:
    print(item.name)

# Or paginate page by page
for page in response.iter_pages():
    for item in page:
        print(item.name)
Get Secret associated with provided id. The secret value is not returned if the control plane has DISABLE_SECRET_VALUE_VIEW set

Parameters

id
str
required
Secret Id of the secret.

Returns

GetSecretResponse
GetSecretResponse
🔗 GetSecretResponseReturns the Secret associated with provided id

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.secrets.get(
    id="id_value",
)
Deletes a secret and its versions along with its values.

Parameters

id
str
required
Secret Id of the secret.

Returns

float
float
Deletes a secret and its versions along with its values and returns the count of the deleted secrets.

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.secrets.delete(
    id="id_value",
)
I