Skip to main content

io.enterpriseai.resources.SecretsClient

Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/resources/SecretsClient.java. Back to the Java SDK reference index.

note

This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.

Class SecretsClient​

Write only secrets (OpenBao).

Constructor SecretsClient​

SecretsClient(Transport transport)

Creates the client on the shared transport; EnterpriseAIClient builds it and exposes it through the accessor of the same name.

NameTypeDefaultRequiredDescription
transportTransportyesTransport shared by the sub-clients of one client.

SecretsClient.delete​

void delete(String path)

Delete a secret. Deletes the secret and, with OpenBao, its value in the vault. Needs tenant_admin, security_officer or developer; a developer only deletes the secrets they wrote (403 forbidden). Objects that still refer to the path stop working. Writes the audit event secret.delete. Answers 204, 404 not_found, or 502 secret_backend_error when the vault cannot be reached.

Route: /v1/secrets/{path} (DELETE).

NameTypeDefaultRequiredDescription
pathStringyesPath of the secret, slashes included, for example connectors/crm/password.

Returns: void.

Raises: the typed errors of the transport (Errors).

SecretsClient.list​

Page<JsonNode> list()

List the secrets. Lists the metadata of the tenant secrets ordered by path: id, path, backend (openbao or local), version, created_by, created_at, updated_at. Never the value. Open to any member of the tenant. next_cursor is always null.

Route: /v1/secrets (GET).

This element takes no parameter.

Returns: Page<JsonNode>. A Page: One page of a cursor paginated collection ({"items": [...], "next_cursor": "..."|null}).

Raises: the typed errors of the transport (Errors).

SecretsClient.list​

Page<JsonNode> list(Map<String, ?> query)

List the secrets. Lists the metadata of the tenant secrets ordered by path: id, path, backend (openbao or local), version, created_by, created_at, updated_at. Never the value. Open to any member of the tenant. next_cursor is always null.

Route: /v1/secrets (GET).

NameTypeDefaultRequiredDescription
queryMap<String, ?>yesQuery string parameters of the route.

Returns: Page<JsonNode>. A Page: One page of a cursor paginated collection ({"items": [...], "next_cursor": "..."|null}).

Raises: the typed errors of the transport (Errors).

SecretsClient.put​

JsonNode put(Object body)

Write a secret. Creates the secret, or replaces its value when the path exists (the version grows by one). Needs tenant_admin, security_officer or developer; a developer only overwrites the secrets they wrote (403 forbidden). A path with a .. segment answers 400 invalid_request. The answer (201) gives the metadata, never the value. Writes the audit event secret.write. 502 secret_backend_error when the vault cannot be reached.

Route: /v1/secrets (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesPath and value of the secret.

Returns: JsonNode. Decoded JSON answer of the operation "Write a secret".

Raises: the typed errors of the transport (Errors).

SecretsClient.put​

JsonNode put(Object body, RequestOptions options)

Write a secret. Creates the secret, or replaces its value when the path exists (the version grows by one). Needs tenant_admin, security_officer or developer; a developer only overwrites the secrets they wrote (403 forbidden). A path with a .. segment answers 400 invalid_request. The answer (201) gives the metadata, never the value. Writes the audit event secret.write. 502 secret_backend_error when the vault cannot be reached.

Route: /v1/secrets (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesPath and value of the secret.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Write a secret".

Raises: the typed errors of the transport (Errors).