Skip to content

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.

UserManager

python
class UserManager(RebacManager, BaseUserManager)

Manager for Angee's composed user model.

get_by_natural_key

python
def get_by_natural_key(username: str) -> Any

Return a user for credential checks without row-scope filtering.

get

python
def get(*args: Any, **kwargs: Any) -> Any

Return a user, bypassing REBAC only for session primary keys.

aget_by_natural_key

python
async def aget_by_natural_key(username: str) -> Any

Async sibling of get_by_natural_key.

create_user

python
def create_user(username: str,
                email: str | None = None,
                password: str | None = None,
                **extra_fields: Any) -> Any

Create and save a regular user.

create_superuser

python
def create_superuser(username: str,
                     email: str | None = None,
                     password: str | None = None,
                     **extra_fields: Any) -> Any

Create and save a superuser.

User

python
class User(SqidMixin, AbstractBaseUser, RebacPermissionsMixin, AngeeModel)

Abstract swappable user model composed into Angee runtimes.

Meta

python
class Meta()

Django model options for the IAM user source.

clean

python
def clean() -> None

Normalize username and email before validation.

save

python
def save(*args: Any, **kwargs: Any) -> None

Persist the user and mirror superuser status to the admin role.

get_full_name

python
def get_full_name() -> str

Return first and last name joined with a space.

get_short_name

python
def get_short_name() -> str

Return the user's short display name.

Released under the AGPL-3.0 License.