Skip to content

cmem_client.models.user¤

Keycloak user and group models.

Corporate Memory keeps its accounts in Keycloak. The user accounts of the configured realm are the items of client.user_accounts, keyed by their username, and the groups a user belongs to decide which access conditions apply to them.

Classes:

  • Group – A Keycloak group in the Corporate Memory realm.
  • User – A Keycloak user account in the Corporate Memory realm.

Group¤

Bases: Model

A Keycloak group in the Corporate Memory realm.

Attributes:

  • id (str) – Internal Keycloak identifier of the group, a UUID.
  • name (str) – Name of the group.
  • path (str) – Full path of the group, which spells out its parents for a nested group, e.g. /department/team.

id¤

id: str

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

name¤

name: str

path¤

path: str = ''

User¤

Bases: Model, ReadRepositoryItem

A Keycloak user account in the Corporate Memory realm.

Attributes:

  • id (str) – Internal Keycloak identifier of the account, a UUID. Empty on an account which was built locally and not yet created.
  • username (str) – Login name of the account. This is the key of the repository.
  • email (str) – Mail address of the account.
  • first_name (str) – Given name of the account holder.
  • last_name (str) – Family name of the account holder.
  • enabled (bool) – Whether the account may log in. A disabled account is kept but refused.
  • email_verified (bool) – Whether the mail address was confirmed by the account holder.

Functions:

  • get_id – Get the username as the unique identifier.

email¤

email: str = ''

email_verified¤

email_verified: bool = Field(alias='emailVerified', default=False)

enabled¤

enabled: bool = True

first_name¤

first_name: str = Field(alias='firstName', default='')

get_id¤

get_id()

Get the username as the unique identifier.

id¤

id: str = ''

last_name¤

last_name: str = Field(alias='lastName', default='')

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

username¤

username: str

Comments