Skip to main content

io.enterpriseai.resources.ServiceIdentitiesClient

Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/resources/ServiceIdentitiesClient.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 ServiceIdentitiesClient​

Service identities (SPIFFE ids).

Constructor ServiceIdentitiesClient​

ServiceIdentitiesClient(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.

ServiceIdentitiesClient.assume​

JsonNode assume(String identityId, Object body)

Assume a service identity. Returns a signed, short lived ExecutionContext whose subject is the service identity, for the caller. It is not an API credential: downstream services verify it (POST /v1/context/verify or the JWKS) and the caller revokes it with POST /v1/context/{context_id}/revoke.

Route: /v1/service-identities/{identity_id}/assume (POST).

NameTypeDefaultRequiredDescription
identityIdStringyesIdentifier (UUID) of the service identity.
bodyObjectyesPurpose, audiences, lifetime and scopes of the requested context.

Returns: JsonNode. Decoded JSON answer of the operation "Assume a service identity".

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

ServiceIdentitiesClient.assume​

JsonNode assume(String identityId, Object body, RequestOptions options)

Assume a service identity. Returns a signed, short lived ExecutionContext whose subject is the service identity, for the caller. It is not an API credential: downstream services verify it (POST /v1/context/verify or the JWKS) and the caller revokes it with POST /v1/context/{context_id}/revoke.

Route: /v1/service-identities/{identity_id}/assume (POST).

NameTypeDefaultRequiredDescription
identityIdStringyesIdentifier (UUID) of the service identity.
bodyObjectyesPurpose, audiences, lifetime and scopes of the requested context.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Assume a service identity".

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

ServiceIdentitiesClient.create​

JsonNode create(Object body)

Create a service identity. Registers a workload identity of the tenant with its SPIFFE ID, roles, scopes and clearance. Needs tenant_admin or security_officer; the roles and scopes granted follow the same rules as API keys (only what the caller holds). A SPIFFE ID already registered answers 409 conflict. Writes the audit event service_identity.create. Assuming the identity also needs the explicit relation can_assume (see the assume route).

Route: /v1/service-identities (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesName, SPIFFE ID and rights of the identity.

Returns: JsonNode. Decoded JSON answer of the operation "Create a service identity".

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

ServiceIdentitiesClient.create​

JsonNode create(Object body, RequestOptions options)

Create a service identity. Registers a workload identity of the tenant with its SPIFFE ID, roles, scopes and clearance. Needs tenant_admin or security_officer; the roles and scopes granted follow the same rules as API keys (only what the caller holds). A SPIFFE ID already registered answers 409 conflict. Writes the audit event service_identity.create. Assuming the identity also needs the explicit relation can_assume (see the assume route).

Route: /v1/service-identities (POST).

NameTypeDefaultRequiredDescription
bodyObjectyesName, SPIFFE ID and rights of the identity.
optionsRequestOptionsyesPer call options (idempotency key, traceparent, headers, abort signal).

Returns: JsonNode. Decoded JSON answer of the operation "Create a service identity".

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

ServiceIdentitiesClient.delete​

void delete(String id)

Delete a service identity. Deletes the service identity; it can no longer be assumed nor authenticate with its SPIFFE ID. Needs tenant_admin or security_officer. Writes the audit event service_identity.delete. Answers 204, or 404 not_found.

Route: /v1/service-identities/{identity_id} (DELETE).

NameTypeDefaultRequiredDescription
idStringyesIdentifier (UUID) of the service identity.

Returns: void.

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

ServiceIdentitiesClient.list​

Page<JsonNode> list()

List the service identities. Lists the service identities of the tenant, ordered by name, with their SPIFFE ID, roles, scopes and clearance. Open to any member of the tenant. Not paginated: next_cursor is always null.

Route: /v1/service-identities (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).