diff --git a/authentik/core/types.py b/authentik/core/types.py index 988a9aea6..3901350a3 100644 --- a/authentik/core/types.py +++ b/authentik/core/types.py @@ -1,8 +1,8 @@ """authentik core dataclasses""" from dataclasses import dataclass -from typing import Optional +from typing import Any, Optional -from rest_framework.fields import CharField +from rest_framework.fields import CharField, DictField from authentik.core.api.utils import PassiveSerializer @@ -20,6 +20,9 @@ class UILoginButton: # Icon URL, used as-is icon_url: Optional[str] = None + # Additional data, optional + additional_data: Any = None + class UILoginButtonSerializer(PassiveSerializer): """Serializer for Login buttons of sources""" @@ -27,6 +30,7 @@ class UILoginButtonSerializer(PassiveSerializer): name = CharField() url = CharField() icon_url = CharField(required=False, allow_null=True) + additional_data = DictField(required=False, allow_null=True) class UserSettingSerializer(PassiveSerializer): diff --git a/authentik/stages/identification/tests.py b/authentik/stages/identification/tests.py index 1c8fe74ac..bb99ee947 100644 --- a/authentik/stages/identification/tests.py +++ b/authentik/stages/identification/tests.py @@ -115,6 +115,7 @@ class TestIdentificationStage(TestCase): "title": self.flow.title, "sources": [ { + "additional_data": None, "icon_url": "/static/authentik/sources/.svg", "name": "test", "url": "/source/oauth/login/test/", @@ -158,6 +159,7 @@ class TestIdentificationStage(TestCase): "title": self.flow.title, "sources": [ { + "additional_data": None, "icon_url": "/static/authentik/sources/.svg", "name": "test", "url": "/source/oauth/login/test/",