ExStorageService.IAM.User (ex_storage_service v0.6.2)

Copy Markdown View Source

IAM User management backed by Concord key-value store.

Users are stored with the key pattern: "user:{user_id}"

Summary

Functions

Activates a suspended user.

Creates a new IAM user with the given name. Generates a unique user ID in the format "usr_xxxx".

Deletes a user by their user ID.

Retrieves a user by their user ID.

Lists all IAM users.

Suspends a user, preventing them from authenticating.

Types

status()

@type status() :: :active | :suspended

t()

@type t() :: %{
  id: String.t(),
  name: String.t(),
  status: status(),
  created_at: String.t(),
  updated_at: String.t()
}

Functions

activate_user(user_id)

@spec activate_user(String.t()) :: {:ok, t()} | {:error, :not_found | term()}

Activates a suspended user.

create_user(name)

@spec create_user(String.t()) :: {:ok, t()} | {:error, term()}

Creates a new IAM user with the given name. Generates a unique user ID in the format "usr_xxxx".

delete_user(user_id)

@spec delete_user(String.t()) :: :ok | {:error, :not_found | term()}

Deletes a user by their user ID.

get_user(user_id)

@spec get_user(String.t()) :: {:ok, t()} | {:error, :not_found | term()}

Retrieves a user by their user ID.

list_users()

@spec list_users() :: {:ok, [t()]} | {:error, term()}

Lists all IAM users.

suspend_user(user_id)

@spec suspend_user(String.t()) :: {:ok, t()} | {:error, :not_found | term()}

Suspends a user, preventing them from authenticating.