authentik.core.types

authentik core dataclasses

 1"""authentik core dataclasses"""
 2
 3from dataclasses import dataclass
 4
 5from rest_framework.fields import CharField
 6
 7from authentik.core.api.utils import PassiveSerializer
 8from authentik.flows.challenge import Challenge
 9
10
11@dataclass(slots=True)
12class UILoginButton:
13    """Dataclass for Source's ui_login_button"""
14
15    # Name, ran through i18n
16    name: str
17
18    # Challenge which is presented to the user when they click the button
19    challenge: Challenge
20
21    # Icon URL, used as-is
22    icon_url: str | None = None
23
24    # Whether this source should be displayed as a prominent button
25    promoted: bool = False
26
27
28class UserSettingSerializer(PassiveSerializer):
29    """Serializer for User settings for stages and sources"""
30
31    object_uid = CharField()
32    component = CharField()
33    title = CharField(required=True)
34    configure_url = CharField(required=False)
35    icon_url = CharField(required=False)
@dataclass(slots=True)
class UILoginButton:
12@dataclass(slots=True)
13class UILoginButton:
14    """Dataclass for Source's ui_login_button"""
15
16    # Name, ran through i18n
17    name: str
18
19    # Challenge which is presented to the user when they click the button
20    challenge: Challenge
21
22    # Icon URL, used as-is
23    icon_url: str | None = None
24
25    # Whether this source should be displayed as a prominent button
26    promoted: bool = False

Dataclass for Source's ui_login_button

UILoginButton( name: str, challenge: authentik.flows.challenge.Challenge, icon_url: str | None = None, promoted: bool = False)
name: str
icon_url: str | None
promoted: bool
class UserSettingSerializer(authentik.core.api.utils.PassiveSerializer):
29class UserSettingSerializer(PassiveSerializer):
30    """Serializer for User settings for stages and sources"""
31
32    object_uid = CharField()
33    component = CharField()
34    title = CharField(required=True)
35    configure_url = CharField(required=False)
36    icon_url = CharField(required=False)

Serializer for User settings for stages and sources

object_uid
component
title
configure_url
icon_url