authentik.enterprise.endpoints.connectors.fleet.models
1from typing import TYPE_CHECKING 2 3from django.db import models 4from django.templatetags.static import static 5from django.utils.translation import gettext_lazy as _ 6from rest_framework.serializers import Serializer 7 8from authentik.endpoints.models import Connector 9 10if TYPE_CHECKING: 11 from authentik.enterprise.endpoints.connectors.fleet.controller import FleetController 12 13 14class FleetConnector(Connector): 15 """Ingest device data and policy compliance from a Fleet instance.""" 16 17 url = models.URLField() 18 token = models.TextField() 19 headers_mapping = models.ForeignKey( 20 "authentik_events.NotificationWebhookMapping", 21 on_delete=models.SET_DEFAULT, 22 null=True, 23 default=None, 24 related_name="+", 25 help_text=_( 26 "Configure additional headers to be sent. " 27 "Mapping should return a dictionary of key-value pairs" 28 ), 29 ) 30 31 map_users = models.BooleanField(default=True) 32 map_teams_access_group = models.BooleanField(default=False) 33 34 @property 35 def icon_url(self): 36 return static("authentik/connectors/fleet.svg") 37 38 @property 39 def serializer(self) -> type[Serializer]: 40 from authentik.enterprise.endpoints.connectors.fleet.api import FleetConnectorSerializer 41 42 return FleetConnectorSerializer 43 44 @property 45 def controller(self) -> type[FleetController]: 46 from authentik.enterprise.endpoints.connectors.fleet.controller import FleetController 47 48 return FleetController 49 50 @property 51 def component(self) -> str: 52 return "ak-endpoints-connector-fleet-form" 53 54 class Meta: 55 verbose_name = _("Fleet Connector") 56 verbose_name_plural = _("Fleet Connectors")
15class FleetConnector(Connector): 16 """Ingest device data and policy compliance from a Fleet instance.""" 17 18 url = models.URLField() 19 token = models.TextField() 20 headers_mapping = models.ForeignKey( 21 "authentik_events.NotificationWebhookMapping", 22 on_delete=models.SET_DEFAULT, 23 null=True, 24 default=None, 25 related_name="+", 26 help_text=_( 27 "Configure additional headers to be sent. " 28 "Mapping should return a dictionary of key-value pairs" 29 ), 30 ) 31 32 map_users = models.BooleanField(default=True) 33 map_teams_access_group = models.BooleanField(default=False) 34 35 @property 36 def icon_url(self): 37 return static("authentik/connectors/fleet.svg") 38 39 @property 40 def serializer(self) -> type[Serializer]: 41 from authentik.enterprise.endpoints.connectors.fleet.api import FleetConnectorSerializer 42 43 return FleetConnectorSerializer 44 45 @property 46 def controller(self) -> type[FleetController]: 47 from authentik.enterprise.endpoints.connectors.fleet.controller import FleetController 48 49 return FleetController 50 51 @property 52 def component(self) -> str: 53 return "ak-endpoints-connector-fleet-form" 54 55 class Meta: 56 verbose_name = _("Fleet Connector") 57 verbose_name_plural = _("Fleet Connectors")
Ingest device data and policy compliance from a Fleet instance.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Child.parent is a ForwardManyToOneDescriptor instance.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
39 @property 40 def serializer(self) -> type[Serializer]: 41 from authentik.enterprise.endpoints.connectors.fleet.api import FleetConnectorSerializer 42 43 return FleetConnectorSerializer
Get serializer for this model
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.
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.
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.
Inherited Members
The requested object does not exist
The query returned multiple objects when only one was expected.