tiny_pacs_identity.events

User management events.

The events are handled by the Users component. Passwords travel as plaintext payloads only within the process (and are prompted with getpass in the CLI, never passed as command line arguments); handlers hash them before they reach the database.

Classes

UserAdd()

Register a new user.

UserByName()

Request a user by login name.

UserList()

Request every user, ordered by username.

UserRemove()

Remove a user by login name.

UserSetActive()

Activate or deactivate a user.

UserSetPassword()

Change the password of an existing user.

class tiny_pacs_identity.events.UserByName[source]

Bases: Event[str, UserModel | None]

Request a user by login name.

The result is None for unknown usernames.

event_id: ClassVar[uuid.UUID] = UUID('64a1513d-2967-4376-a3c0-c4703a8bdc81')
name: ClassVar[str] = 'UserByName'
class tiny_pacs_identity.events.UserList[source]

Bases: Event[None, list[UserModel]]

Request every user, ordered by username.

Password hashes are never included in CLI output; event consumers receive the records as stored.

event_id: ClassVar[uuid.UUID] = UUID('e9b190c7-fe72-425c-9795-a136f8e8318a')
name: ClassVar[str] = 'UserList'
class tiny_pacs_identity.events.UserAdd[source]

Bases: Event[dict[str, Any], UserModel]

Register a new user.

Payload is a mapping with username and password; the password is hashed before storage.

event_id: ClassVar[uuid.UUID] = UUID('ff6257e3-501c-4922-9069-0c2b85cfefda')
name: ClassVar[str] = 'UserAdd'
class tiny_pacs_identity.events.UserSetPassword[source]

Bases: Event[dict[str, Any], UserModel]

Change the password of an existing user.

Payload is a mapping with username and password.

event_id: ClassVar[uuid.UUID] = UUID('2a947c98-57ce-41c7-bb04-8d9ec8cc1061')
name: ClassVar[str] = 'UserSetPassword'
class tiny_pacs_identity.events.UserRemove[source]

Bases: Event[str, bool]

Remove a user by login name.

The result is whether the user existed (and was removed).

event_id: ClassVar[uuid.UUID] = UUID('e3e371b8-fc29-42b9-a3ce-9f7d92599883')
name: ClassVar[str] = 'UserRemove'
class tiny_pacs_identity.events.UserSetActive[source]

Bases: Event[dict[str, Any], UserModel]

Activate or deactivate a user.

Payload is a mapping with username and is_active.

event_id: ClassVar[uuid.UUID] = UUID('af372ca6-5ecc-40f3-a4de-c5c1dba3fbcb')
name: ClassVar[str] = 'UserSetActive'