cri_auth.models module

class cri_auth.models.AuthGroup(id, groups_clients_mapping, group, clients_can_see_private_subgroups, group_managers_can_manage_clients, group_is_allowed, _roles)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

clients_can_see_private_subgroups

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

group

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

group_id
group_is_allowed

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

group_managers_can_manage_clients

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

groups_clients_mapping

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

groups_clients_mapping_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
property roles
class cri_auth.models.AuthGroupsClientsMapping(id, name, is_restricted)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

authgroup_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_managers()[source]
classmethod get_mappings_managed_by_user(user)[source]
get_user_groups(user)[source]
get_user_roles(user)[source]
get_users()[source]
get_users_by_roles()[source]
groups

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_restricted

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_user_allowed(user)[source]
managers

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
oidcclientextension_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class cri_auth.models.AuthMethodMixin(*args, **kwargs)[source]

Bases: cri_models.sync.modelengine.SyncedModelMixin, django.db.models.base.Model

class Meta[source]

Bases: object

abstract = False
class SyncMeta[source]

Bases: object

sync_adapters = (<class 'cri_auth.models.CRIServiceLDAPSyncAdapter'>,)
get_managers()[source]
get_user_groups(user)[source]
get_user_roles(user)[source]
get_users()[source]
get_users_by_roles()[source]
groups_clients_mapping

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

groups_clients_mapping_id
is_user_allowed(user)[source]
slug

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class cri_auth.models.CRIServiceLDAPSyncAdapter(*args, **kwargs)[source]

Bases: cri_models.sync.ldapmodelengine.SyncedLDAPModelAdapter

get_sync_local_data_multi()[source]
get_sync_local_obj_id_multi()[source]
static get_sync_remote_data(remote_obj)[source]
get_sync_remote_obj_id_multi(_remote_objects)[source]
ldap_dn_from_obj(role=None)[source]
sync_remote_model

alias of cri_models.ldap.group.LDAPGroup_ou_services_dummy

class cri_auth.models.ConnectionLogEntry(id, user, username, created_at, kind, client, ip, status)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

KIND_CHOICES = (('password', 'Sign-in with password'), ('kerberos_spnego', 'Sign-in with Kerberos (SPNEGO)'), ('ldap_password', 'Sign-in with LDAP (password)'), ('office365_oauth2', 'Sign-in with Office365 SSO'), ('oidc_client', 'OIDC authentication'))
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

STATUS_CHOICES = (('success', 'Authentication succeeded'), ('failure', 'Authentication failed'))
client

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

client_id
created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_kind_display(*, field=<django.db.models.fields.CharField: kind>)
get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
get_status_display(*, field=<django.db.models.fields.CharField: status>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

ip

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

kind

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

user_id
username

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class cri_auth.models.OIDCClientExtension(id, groups_clients_mapping, slug, client, is_legacy)[source]

Bases: cri_auth.models.AuthMethodMixin

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

client

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

client_id
classmethod from_client(client)[source]
classmethod get_clients_managed_by_user(user)[source]
groups_clients_mapping

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_legacy

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
cri_auth.models.add_connection_log_entry_on_failure(credentials, request, **_kwargs)[source]
cri_auth.models.add_connection_log_entry_on_success(user, request, **_kwargs)[source]