authentik.lib.sync.incoming.models

 1from django.db import models
 2from django.utils.translation import gettext_lazy as _
 3
 4from authentik.core.models import Source
 5from authentik.tasks.schedules.models import ScheduledModel
 6
 7
 8class SyncOutgoingTriggerMode(models.TextChoices):
 9    # Do not trigger outgoing syncs
10    NONE = "none"
11    # Trigger immediately after object changed
12    IMMEDIATE = "immediate"
13    # Trigger at the end of full sync
14    DEFERRED_END = "deferred_end"
15
16
17class IncomingSyncSource(ScheduledModel, Source):
18    sync_outgoing_trigger_mode = models.TextField(
19        choices=SyncOutgoingTriggerMode.choices,
20        default=SyncOutgoingTriggerMode.DEFERRED_END,
21        help_text=_("When to trigger sync for outgoing providers"),
22    )
23
24    class Meta:
25        abstract = True
class SyncOutgoingTriggerMode(django.db.models.enums.TextChoices):
 9class SyncOutgoingTriggerMode(models.TextChoices):
10    # Do not trigger outgoing syncs
11    NONE = "none"
12    # Trigger immediately after object changed
13    IMMEDIATE = "immediate"
14    # Trigger at the end of full sync
15    DEFERRED_END = "deferred_end"

Class for creating enumerated string choices.

18class IncomingSyncSource(ScheduledModel, Source):
19    sync_outgoing_trigger_mode = models.TextField(
20        choices=SyncOutgoingTriggerMode.choices,
21        default=SyncOutgoingTriggerMode.DEFERRED_END,
22        help_text=_("When to trigger sync for outgoing providers"),
23    )
24
25    class Meta:
26        abstract = True

Base Authentication source, i.e. an OAuth Provider, SAML Remote or LDAP Server

def sync_outgoing_trigger_mode(unknown):

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

schedules

Accessor to the related objects manager on the one-to-many relation created by GenericRelation.

In the example::

class Post(Model):
    comments = GenericRelation(Comment)

post.comments is a ReverseGenericManyToOneDescriptor instance.

tasks

Accessor to the related objects manager on the one-to-many relation created by GenericRelation.

In the example::

class Post(Model):
    comments = GenericRelation(Comment)

post.comments is a ReverseGenericManyToOneDescriptor instance.

def get_sync_outgoing_trigger_mode_display(unknown):

Method descriptor with partial application of the given arguments and keywords.

Supports wrapping existing descriptors and handles non-descriptor callables as instance methods.

source_ptr_id
source_ptr

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.

class IncomingSyncSource.Meta:
25    class Meta:
26        abstract = True
abstract = False