Secret
This class provides a management interface for creating, retrieving, listing, and deleting secrets within a specific project and domain. It supports both generic secrets and image pull secrets, handling both string and binary values. The class integrates with a backend secrets service and provides metadata such as creation time and cluster-specific status.
Attributes
| Attribute | Type | Description |
|---|---|---|
| pb2 | definition_pb2.Secret | The underlying Protocol Buffer message containing the secret's metadata and identification details. |
Methods
create()
@classmethod
def create(
name: str,
value: Union[str, bytes],
type: SecretTypes = "regular"
) - > null
Create a new secret.
Parameters
| Name | Type | Description |
|---|---|---|
| name | str | The unique identifier for the secret within the project and domain |
| value | Union[str, bytes] | The sensitive data to be stored, provided as either a string or raw bytes |
| type | SecretTypes = "regular" | The classification of the secret, determining if it is a standard secret or an image pull secret |
Returns
| Type | Description |
|---|---|
null | Nothing is returned upon successful creation |
get()
@classmethod
def get(
name: str
) - > [Secret](secret.md?sid=flyte_remote__secret_secret)
Retrieve a secret by name.
Parameters
| Name | Type | Description |
|---|---|---|
| name | str | The name of the secret to retrieve from the current project and domain |
Returns
| Type | Description |
|---|---|
[Secret](secret.md?sid=flyte_remote__secret_secret) | A Secret object containing the metadata and identifier for the requested secret |
listall()
@classmethod
def listall(
limit: int = 10
) - > AsyncIterator[[Secret](secret.md?sid=flyte_remote__secret_secret)]
List all secrets in the current project and domain.
Parameters
| Name | Type | Description |
|---|---|---|
| limit | int = 10 | The maximum number of secret records to fetch per underlying API request page |
Returns
| Type | Description |
|---|---|
AsyncIterator[[Secret](secret.md?sid=flyte_remote__secret_secret)] | An asynchronous iterator yielding Secret objects found in the current scope |
delete()
@classmethod
def delete(
name: str
) - > null
Delete a secret by name.
Parameters
| Name | Type | Description |
|---|---|---|
| name | str | The name of the secret to be permanently removed from the system |
Returns
| Type | Description |
|---|---|
null | Nothing is returned upon successful deletion |
name()
@classmethod
def name() - > str
Get the name of the secret.
Returns
| Type | Description |
|---|---|
str | The string identifier of the secret instance |
type()
@classmethod
def type() - > str
Get the type of the secret as a string ("regular" or "image_pull").
Returns
| Type | Description |
|---|---|
str | The category of the secret, either "regular" for generic data or "image_pull" for registry credentials |