Skip to main content

Secret

This class represents a secret, which can store sensitive information like strings or binary data. It provides methods to create, retrieve, list, and delete secrets, interacting with a backend service to manage these credentials. The class supports different secret types, including regular secrets and image pull secrets, and exposes metadata such as creation time and status across clusters.

Attributes

  • pb2: definition_pb2.Secret
    • definition_pb2.Secret

Methods

def create(name: string, value: Union[str, bytes], type: SecretTypes = "regular") - > None
  • Creates a new secret. Supports both string and binary values. The type can be 'regular' or 'image_pull'.

  • Parameters

    • name: string
      • The name of the secret.
    • value: Union[str, bytes]
      • The value of the secret, can be a string or bytes.
    • type: SecretTypes
      • The type of the secret, either 'regular' or 'image_pull'.
  • Return Value: None

    • None
def get(name: string) - > [Secret](src_flyte_remote__secret_secret)
  • Retrieves a secret by its name.

  • Parameters

    • name: string
      • The name of the secret to retrieve.
  • Return Value: Secret

    • The retrieved Secret object.
def listall(limit: int = 100) - > AsyncIterator[[Secret](src_flyte_remote__secret_secret)]
  • Lists all secrets in the current project and domain, with an optional limit.

  • Parameters

    • limit: int
      • The maximum number of secrets to return.
  • Return Value: AsyncIterator[Secret]

    • An asynchronous iterator yielding Secret objects.
def delete(name: string) - > None
  • Deletes a secret by its name.

  • Parameters

    • name: string
      • The name of the secret to delete.
  • Return Value: None

    • None
def name()
  • Gets the name of the secret.

  • Return Value: string

    • The name of the secret.
def type()
  • Gets the type of the secret ('regular' or 'image_pull').

  • Return Value: string

    • The type of the secret.