adk_credential_store_ets (erlang_adk v0.7.0)
View SourceOwner-private ETS credential store.
The ETS table identifier is held by this gen_server and the table is private, so raw credentials cannot be read by other processes. Public operations always require the original principal and provider scope.
Summary
Functions
Atomically replace a credential while keeping the same opaque reference. The gen_server owns the private ETS table, so the comparison and replacement are serialized with fetch/delete/put operations.
Types
-type server() :: gen_server:server_ref().
Functions
-spec child_spec(map()) -> supervisor:child_spec().
-spec compare_and_swap(server(), adk_credential_store:principal(), adk_credential_store:provider_id(), adk_credential_store:credential_ref(), adk_credential_store:credential(), adk_credential_store:credential()) -> ok | {error, adk_credential_store:error_reason()}.
Atomically replace a credential while keeping the same opaque reference. The gen_server owns the private ETS table, so the comparison and replacement are serialized with fetch/delete/put operations.
-spec delete(server(), adk_credential_store:principal(), adk_credential_store:provider_id(), adk_credential_store:credential_ref()) -> ok | {error, adk_credential_store:error_reason()}.
-spec fetch(server(), adk_credential_store:principal(), adk_credential_store:provider_id(), adk_credential_store:credential_ref()) -> {ok, adk_credential_store:credential()} | {error, adk_credential_store:error_reason()}.
-spec put(server(), adk_credential_store:principal(), adk_credential_store:provider_id(), adk_credential_store:credential()) -> {ok, adk_credential_store:credential_ref()} | {error, adk_credential_store:error_reason()}.
-spec start_link() -> gen_server:start_ret().
-spec start_link(map()) -> gen_server:start_ret().