angee.iam.models
Source models for Angee identity.
Pure identity: the swappable User and its manager. The OAuth connection substrate (OAuthClient/ExternalAccount/Credential) is owned by integrate; OIDC login fields are contributed onto that OAuth client by iam_integrate_oidc. IAM's member-facing people directory is an actor-scoped user queryset: REBAC read arms authorize rows, while the user collection owns active-human filtering, search, ordering, and limits.
VISIBLE_PEOPLE_DEFAULT_LIMIT
Default page size for member-facing people surfaces.
VISIBLE_PEOPLE_MAX_LIMIT
Upper bound a people-surface caller's limit is clamped to.
UserKind
class UserKind(models.TextChoices)Species of IAM principal stored in the swappable user table.
UserQuerySet
class UserQuerySet(AngeeQuerySet[Any])Queryset vocabulary for user-row surfaces.
people
def people() -> AnyReturn login-capable human users, excluding service-account rows.
active_people
def active_people() -> SelfReturn active human user rows.
UserManager
class UserManager(AngeeManager.from_queryset(UserQuerySet), BaseUserManager)Manager for Angee's composed user model.
get_by_natural_key
def get_by_natural_key(username: str) -> AnyReturn a user for credential checks without row-scope filtering.
get_for_session
def get_for_session(user_id: Any) -> AnyReturn the session user through the named Django-auth reload seam.
aget_by_natural_key
async def aget_by_natural_key(username: str) -> AnyAsync sibling of get_by_natural_key.
create_user
def create_user(username: str,
email: str | None = None,
password: str | None = None,
**extra_fields: Any) -> AnyCreate and save a regular user.
create_superuser
def create_superuser(username: str,
email: str | None = None,
password: str | None = None,
**extra_fields: Any) -> AnyCreate and save a superuser.
visible_people
def visible_people(actor: Any,
*,
search: str = "",
limit: int = VISIBLE_PEOPLE_DEFAULT_LIMIT) -> list[Any]Return actor-readable active people after search, ordering, and cap.
visible_person_from_public_id
def visible_person_from_public_id(actor: Any, public_id: str) -> Any | NoneResolve one public user id against the same actor-scoped rows as the picker.
User
class User(SqidMixin, AbstractBaseUser, RebacPermissionsMixin, AngeeModel)Abstract swappable user model composed into Angee runtimes.
kind=service rows are non-login principals for agents and automation: they exist so audit and revision FKs can point at every actor species without widening password/OIDC login surfaces.
Meta
class Meta()Django model options for the IAM user source.
clean
def clean() -> NoneNormalize username and email before validation.
save
def save(*args: Any, **kwargs: Any) -> NonePersist the user and mirror superuser status to the admin role.
update_preferences
def update_preferences(preferences: Mapping[str, Any]) -> NoneReplace this user's private UI preference object.
get_full_name
def get_full_name() -> strReturn first and last name joined with a space.
get_short_name
def get_short_name() -> strReturn the user's short display name.