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, ThemedUrlsSerializer
 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    # Icon URLs per theme, preferred over icon_url when set
25    icon_themed_urls: dict[str, str] | None = None
26
27    # Whether this source should be displayed as a prominent button
28    promoted: bool = False
29
30
31class UserSettingSerializer(PassiveSerializer):
32    """Serializer for User settings for stages and sources"""
33
34    object_uid = CharField()
35    component = CharField()
36    title = CharField(required=True)
37    configure_url = CharField(required=False)
38    icon_url = CharField(required=False)
39    icon_themed_urls = ThemedUrlsSerializer(required=False, allow_null=True)
@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    # Icon URLs per theme, preferred over icon_url when set
26    icon_themed_urls: dict[str, str] | None = None
27
28    # Whether this source should be displayed as a prominent button
29    promoted: bool = False

Dataclass for Source's ui_login_button

UILoginButton( name: str, challenge: authentik.flows.challenge.Challenge, icon_url: str | None = None, icon_themed_urls: dict[str, str] | None = None, promoted: bool = False)
name: str
icon_url: str | None
icon_themed_urls: dict[str, str] | None
promoted: bool
class UserSettingSerializer(authentik.core.api.utils.PassiveSerializer):
32class UserSettingSerializer(PassiveSerializer):
33    """Serializer for User settings for stages and sources"""
34
35    object_uid = CharField()
36    component = CharField()
37    title = CharField(required=True)
38    configure_url = CharField(required=False)
39    icon_url = CharField(required=False)
40    icon_themed_urls = ThemedUrlsSerializer(required=False, allow_null=True)

Serializer for User settings for stages and sources

object_uid
component
title
configure_url
icon_url
icon_themed_urls