Compare commits

...

1 Commits

Author SHA1 Message Date
Jens Langhammer
fc82091e01 endpoints/agents: add brand to agent config
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
2026-02-03 01:02:15 +01:00
2 changed files with 13 additions and 0 deletions

View File

@@ -7,6 +7,8 @@ from rest_framework.fields import (
)
from authentik.api.v3.config import ConfigSerializer, ConfigView
from authentik.brands.api import CurrentBrandSerializer
from authentik.brands.models import Brand
from authentik.core.api.utils import PassiveSerializer
from authentik.crypto.apps import MANAGED_KEY
from authentik.crypto.models import CertificateKeyPair
@@ -37,6 +39,7 @@ class AgentConfigSerializer(PassiveSerializer):
system_config = SerializerMethodField()
license_status = SerializerMethodField(required=False, allow_null=True)
brand = SerializerMethodField(required=False, allow_null=True)
def get_device_id(self, instance: AgentConnector) -> str:
device: Device = self.context["device"]
@@ -70,6 +73,10 @@ class AgentConfigSerializer(PassiveSerializer):
except ModuleNotFoundError:
return None
def get_brand(self, instance: AgentConnector) -> CurrentBrandSerializer:
brand: Brand = self.context["request"]._request.brand
return CurrentBrandSerializer(brand, context=self.context).data
class EnrollSerializer(PassiveSerializer):

View File

@@ -33466,9 +33466,15 @@ components:
- $ref: '#/components/schemas/LicenseStatusEnum'
readOnly: true
nullable: true
brand:
allOf:
- $ref: '#/components/schemas/CurrentBrand'
readOnly: true
nullable: true
required:
- auth_terminate_session_on_expiry
- authorization_flow
- brand
- device_id
- jwks_auth
- jwks_challenge