hook.identitylocal

class immp.hook.identitylocal.IdentityGroup(**kwargs: typing.Any) → None

Bases: tortoise.models.Model

Representation of a single identity.

instance

intIdentityHook instance code.

name

str – Unique display name.

pwd

str – Hashed password, used by the user to authenticate when linking identities.

.IdentityLink iterable – All links contained by this group.

Bases: tortoise.models.Model

Single link between an identity and a user.

group

.IdentityGroup – Containing group instance.

network

str – Network identifier that the user belongs to.

user

str – User identifier as given by the plug.

class immp.hook.identitylocal.IdentityRole(**kwargs: typing.Any) → None

Bases: tortoise.models.Model

Assignment of a role to an identity.

group

.IdentityGroup – Containing group instance.

role

str – Plain role identifier.

class immp.hook.identitylocal.LocalIdentityHook(name, config, host, virtual=False)

Bases: immp.core.hook.Hook, immp.hook.access.AccessPredicate, immp.hook.identity.IdentityProvider

Hook for managing physical users with multiple logical links across different plugs. This effectively provides self-service identities, as opposed to being provided externally.

get(name)

Retrieve the identity group using the given name.

Parameters
name (str) – Existing name to query.
Returns
Linked identity, or None if not linked.
Return type
IdentityGroup
find(user)

Retrieve the identity that contains the given user, if one exists.

Parameters
user (User) – Existing user to query.
Returns
Linked identity, or None if not linked.
Return type
IdentityGroup