SecretService
Section titled “SecretService”Service for managing organization-scoped Daytona Secrets.
Secrets can be created, listed, retrieved, updated, and deleted, and referenced when creating a
Sandbox via the secrets field on the create-sandbox parameters. The plaintext value
is write-only and is never returned by the API; the Sandbox only ever sees the Secret’s opaque
placeholder, and the real value is substituted at the network egress layer for the Secret’s allowed
hosts.
Methods
Section titled “Methods”create()
Section titled “create()”public Secret create(CreateSecretParams params)Creates a new Secret.
Parameters:
paramsCreateSecretParams - creation parameters;namemust match^[a-zA-Z_][a-zA-Z0-9_-]*$and be unique within the organization
Returns:
Secret- createdSecret(without the plaintextvalue)
Throws:
io.daytona.sdk.exception.DaytonaConflictException- if a Secret with the same name already existsio.daytona.sdk.exception.DaytonaException- if creation fails
list()
Section titled “list()”public List<Secret> list()Lists all Secrets in the organization.
Returns:
List\<Secret\>- list of Secrets
Throws:
io.daytona.sdk.exception.DaytonaException- if the API request fails
public Secret get(String secretId)Retrieves a Secret by ID.
Parameters:
secretIdString - Secret identifier
Returns:
Secret- matchingSecret
Throws:
io.daytona.sdk.exception.DaytonaNotFoundException- if no Secret with the given ID existsio.daytona.sdk.exception.DaytonaException- if the request fails
update()
Section titled “update()”public Secret update(String secretId, UpdateSecretParams params)Updates an existing Secret. Omitted (null) fields are left unchanged.
Parameters:
secretIdString - Secret identifierparamsUpdateSecretParams - fields to update
Returns:
Secret- updatedSecret
Throws:
io.daytona.sdk.exception.DaytonaNotFoundException- if no Secret with the given ID existsio.daytona.sdk.exception.DaytonaException- if the request fails
delete()
Section titled “delete()”public void delete(String secretId)Deletes a Secret by ID.
Parameters:
secretIdString - Secret identifier
Throws:
io.daytona.sdk.exception.DaytonaNotFoundException- if no Secret with the given ID existsio.daytona.sdk.exception.DaytonaException- if deletion fails