authentik.endpoints.connectors.agent.models
1from typing import TYPE_CHECKING 2from uuid import uuid4 3 4from django.db import models 5from django.templatetags.static import static 6from django.utils.translation import gettext_lazy as _ 7from rest_framework.serializers import Serializer 8 9from authentik.core.models import User, default_token_key 10from authentik.crypto.models import CertificateKeyPair 11from authentik.endpoints.models import ( 12 Connector, 13 Device, 14 DeviceAccessGroup, 15 DeviceConnection, 16 DeviceUserBinding, 17) 18from authentik.flows.stage import StageView 19from authentik.lib.generators import generate_id, generate_key 20from authentik.lib.models import ( 21 ExpiringModel, 22 InternallyManagedMixin, 23 SerializerModel, 24 SimpleThroughModel, 25) 26from authentik.lib.utils.time import timedelta_string_validator 27from authentik.stages.authenticator.models import Device as Authenticator 28 29if TYPE_CHECKING: 30 from authentik.endpoints.connectors.agent.controller import AgentConnectorController 31 32 33class AgentConnector(Connector): 34 """Configure authentication and add device compliance using the authentik Agent.""" 35 36 refresh_interval = models.TextField( 37 default="minutes=30", 38 validators=[timedelta_string_validator], 39 ) 40 41 auth_session_duration = models.TextField( 42 default="hours=8", validators=[timedelta_string_validator] 43 ) 44 auth_terminate_session_on_expiry = models.BooleanField(default=False) 45 authorization_flow = models.ForeignKey( 46 "authentik_flows.Flow", null=True, on_delete=models.SET_DEFAULT, default=None 47 ) 48 jwt_federation_providers = models.ManyToManyField( 49 "authentik_providers_oauth2.OAuth2Provider", 50 blank=True, 51 default=None, 52 through="AgentConnectorJWTFederationProvider", 53 ) 54 55 nss_uid_offset = models.PositiveIntegerField(default=1000) 56 nss_gid_offset = models.PositiveIntegerField(default=1000) 57 58 challenge_key = models.ForeignKey(CertificateKeyPair, on_delete=models.CASCADE, null=True) 59 challenge_idle_timeout = models.TextField( 60 validators=[timedelta_string_validator], default="seconds=5" 61 ) 62 challenge_trigger_check_in = models.BooleanField(default=False) 63 64 @property 65 def icon_url(self): 66 return static("dist/assets/icons/icon.svg") 67 68 @property 69 def serializer(self) -> type[Serializer]: 70 from authentik.endpoints.connectors.agent.api.connectors import ( 71 AgentConnectorSerializer, 72 ) 73 74 return AgentConnectorSerializer 75 76 @property 77 def stage(self) -> type[StageView] | None: 78 from authentik.endpoints.connectors.agent.stage import ( 79 AuthenticatorEndpointStageView, 80 ) 81 82 return AuthenticatorEndpointStageView 83 84 @property 85 def controller(self) -> type[AgentConnectorController]: 86 from authentik.endpoints.connectors.agent.controller import AgentConnectorController 87 88 return AgentConnectorController 89 90 @property 91 def component(self) -> str: 92 return "ak-endpoints-connector-agent-form" 93 94 class Meta: 95 verbose_name = _("Agent Connector") 96 verbose_name_plural = _("Agent Connectors") 97 98 99class AgentConnectorJWTFederationProvider(SimpleThroughModel): 100 agent_connector = models.ForeignKey( 101 AgentConnector, on_delete=models.CASCADE, db_column="agentconnector_id" 102 ) 103 oauth2_provider = models.ForeignKey( 104 "authentik_providers_oauth2.OAuth2Provider", 105 on_delete=models.CASCADE, 106 db_column="oauth2provider_id", 107 ) 108 109 class Meta: 110 db_table = "authentik_endpoints_connectors_agent_agentconnector_jwt_fed2bc6" 111 unique_together = (("agent_connector", "oauth2_provider"),) 112 verbose_name = _("Agent Connector JWT Federation Provider") 113 verbose_name_plural = _("Agent Connector JWT Federation Providers") 114 115 def __str__(self): 116 return ( 117 f"AgentConnectorJWTFederationProvider for AgentConnector {self.agent_connector_id} " 118 f"and OAuth2Provider {self.oauth2_provider_id}." 119 ) 120 121 122class AgentDeviceConnection(DeviceConnection): 123 124 apple_key_exchange_key = models.TextField() 125 apple_encryption_key = models.TextField() 126 apple_enc_key_id = models.TextField() 127 apple_signing_key = models.TextField() 128 apple_sign_key_id = models.TextField() 129 130 131class AgentDeviceUserBinding(DeviceUserBinding): 132 133 apple_secure_enclave_key = models.TextField() 134 apple_enclave_key_id = models.TextField() 135 136 class Meta: 137 verbose_name = _("Agent Device User binding") 138 verbose_name_plural = _("Agent Device User bindings") 139 140 141class DeviceToken(InternallyManagedMixin, ExpiringModel): 142 """Per-device token used for authentication.""" 143 144 token_uuid = models.UUIDField(primary_key=True, default=uuid4) 145 device = models.ForeignKey(AgentDeviceConnection, on_delete=models.CASCADE) 146 key = models.TextField(default=generate_key) 147 148 class Meta: 149 verbose_name = _("Device Token") 150 verbose_name_plural = _("Device Tokens") 151 indexes = ExpiringModel.Meta.indexes + [ 152 models.Index(fields=["key"]), 153 ] 154 155 156class EnrollmentToken(ExpiringModel, SerializerModel): 157 """Token used during enrollment, a device will receive 158 a device token for further authentication""" 159 160 token_uuid = models.UUIDField(primary_key=True, editable=False, default=uuid4) 161 name = models.TextField() 162 key = models.TextField(default=default_token_key) 163 connector = models.ForeignKey(AgentConnector, on_delete=models.CASCADE) 164 device_group = models.ForeignKey( 165 DeviceAccessGroup, on_delete=models.SET_DEFAULT, default=None, null=True 166 ) 167 168 @property 169 def serializer(self) -> type[Serializer]: 170 from authentik.endpoints.connectors.agent.api.enrollment_tokens import ( 171 EnrollmentTokenSerializer, 172 ) 173 174 return EnrollmentTokenSerializer 175 176 class Meta: 177 verbose_name = _("Enrollment Token") 178 verbose_name_plural = _("Enrollment Tokens") 179 indexes = ExpiringModel.Meta.indexes + [ 180 models.Index(fields=["key"]), 181 ] 182 permissions = [ 183 ("view_enrollment_token_key", _("View token's key")), 184 ] 185 186 187class DeviceAuthenticationToken(InternallyManagedMixin, ExpiringModel): 188 189 identifier = models.UUIDField(default=uuid4, primary_key=True) 190 device = models.ForeignKey(Device, on_delete=models.CASCADE) 191 device_token = models.ForeignKey(DeviceToken, on_delete=models.CASCADE) 192 connector = models.ForeignKey(AgentConnector, on_delete=models.CASCADE) 193 user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, default=None) 194 token = models.TextField() 195 196 def __str__(self): 197 return f"Device authentication token {self.identifier}" 198 199 class Meta(ExpiringModel.Meta): 200 verbose_name = _("Device authentication token") 201 verbose_name_plural = _("Device authentication tokens") 202 203 204class AppleNonce(InternallyManagedMixin, ExpiringModel): 205 nonce = models.TextField() 206 device_token = models.ForeignKey(DeviceToken, on_delete=models.CASCADE) 207 208 class Meta(ExpiringModel.Meta): 209 verbose_name = _("Apple Nonce") 210 verbose_name_plural = _("Apple Nonces") 211 212 213class AppleAuthorizationCode(InternallyManagedMixin, ExpiringModel): 214 """Short-lived code issued by the authorize endpoint, exchanged for tokens.""" 215 216 code = models.TextField(default=generate_id) 217 user = models.ForeignKey(User, on_delete=models.CASCADE) 218 connector = models.ForeignKey("AgentConnector", on_delete=models.CASCADE) 219 # The device the code was issued to, it is the only one allowed to redeem it 220 device_connection = models.ForeignKey(AgentDeviceConnection, on_delete=models.CASCADE) 221 state = models.TextField(default="") 222 scope = models.TextField() 223 224 class Meta(ExpiringModel.Meta): 225 verbose_name = _("Apple Authorization Code") 226 verbose_name_plural = _("Apple Authorization Codes") 227 indexes = ExpiringModel.Meta.indexes + [ 228 models.Index(fields=["code"]), 229 ] 230 231 232class AppleUnlockKey(InternallyManagedMixin, ExpiringModel): 233 """Server-provisioned EC256 key for Platform SSO v2.0 user_unlock.""" 234 235 identifier = models.UUIDField(primary_key=True, default=uuid4) 236 device_user = models.ForeignKey(AgentDeviceUserBinding, on_delete=models.CASCADE) 237 private_key = models.TextField() 238 certificate_der = models.TextField(default="") 239 240 class Meta(ExpiringModel.Meta): 241 verbose_name = _("Apple Unlock Key") 242 verbose_name_plural = _("Apple Unlock Keys") 243 244 245class AppleIndependentSecureEnclave(Authenticator): 246 """A device-independent secure enclave key, used by Tap-to-login""" 247 248 uuid = models.UUIDField(primary_key=True, default=uuid4) 249 250 apple_secure_enclave_key = models.TextField() 251 apple_enclave_key_id = models.TextField() 252 device_type = models.TextField() 253 254 class Meta: 255 verbose_name = _("Apple Independent Secure Enclave") 256 verbose_name_plural = _("Apple Independent Secure Enclaves")
34class AgentConnector(Connector): 35 """Configure authentication and add device compliance using the authentik Agent.""" 36 37 refresh_interval = models.TextField( 38 default="minutes=30", 39 validators=[timedelta_string_validator], 40 ) 41 42 auth_session_duration = models.TextField( 43 default="hours=8", validators=[timedelta_string_validator] 44 ) 45 auth_terminate_session_on_expiry = models.BooleanField(default=False) 46 authorization_flow = models.ForeignKey( 47 "authentik_flows.Flow", null=True, on_delete=models.SET_DEFAULT, default=None 48 ) 49 jwt_federation_providers = models.ManyToManyField( 50 "authentik_providers_oauth2.OAuth2Provider", 51 blank=True, 52 default=None, 53 through="AgentConnectorJWTFederationProvider", 54 ) 55 56 nss_uid_offset = models.PositiveIntegerField(default=1000) 57 nss_gid_offset = models.PositiveIntegerField(default=1000) 58 59 challenge_key = models.ForeignKey(CertificateKeyPair, on_delete=models.CASCADE, null=True) 60 challenge_idle_timeout = models.TextField( 61 validators=[timedelta_string_validator], default="seconds=5" 62 ) 63 challenge_trigger_check_in = models.BooleanField(default=False) 64 65 @property 66 def icon_url(self): 67 return static("dist/assets/icons/icon.svg") 68 69 @property 70 def serializer(self) -> type[Serializer]: 71 from authentik.endpoints.connectors.agent.api.connectors import ( 72 AgentConnectorSerializer, 73 ) 74 75 return AgentConnectorSerializer 76 77 @property 78 def stage(self) -> type[StageView] | None: 79 from authentik.endpoints.connectors.agent.stage import ( 80 AuthenticatorEndpointStageView, 81 ) 82 83 return AuthenticatorEndpointStageView 84 85 @property 86 def controller(self) -> type[AgentConnectorController]: 87 from authentik.endpoints.connectors.agent.controller import AgentConnectorController 88 89 return AgentConnectorController 90 91 @property 92 def component(self) -> str: 93 return "ak-endpoints-connector-agent-form" 94 95 class Meta: 96 verbose_name = _("Agent Connector") 97 verbose_name_plural = _("Agent Connectors")
Configure authentication and add device compliance using the authentik Agent.
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.
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 objects manager on the forward and reverse sides of a many-to-many relation.
In the example::
class Pizza(Model):
toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings and Topping.pizzas are ManyToManyDescriptor
instances.
Most of the implementation is delegated to a dynamically defined manager
class built by create_forward_many_to_many_manager() defined below.
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.
69 @property 70 def serializer(self) -> type[Serializer]: 71 from authentik.endpoints.connectors.agent.api.connectors import ( 72 AgentConnectorSerializer, 73 ) 74 75 return AgentConnectorSerializer
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.
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Parent.children is a ReverseManyToOneDescriptor instance.
Most of the implementation is delegated to a dynamically defined manager
class built by create_forward_many_to_many_manager() defined below.
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Parent.children is a ReverseManyToOneDescriptor instance.
Most of the implementation is delegated to a dynamically defined manager
class built by create_forward_many_to_many_manager() defined below.
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Parent.children is a ReverseManyToOneDescriptor instance.
Most of the implementation is delegated to a dynamically defined manager
class built by create_forward_many_to_many_manager() defined below.
Inherited Members
The requested object does not exist
The query returned multiple objects when only one was expected.
100class AgentConnectorJWTFederationProvider(SimpleThroughModel): 101 agent_connector = models.ForeignKey( 102 AgentConnector, on_delete=models.CASCADE, db_column="agentconnector_id" 103 ) 104 oauth2_provider = models.ForeignKey( 105 "authentik_providers_oauth2.OAuth2Provider", 106 on_delete=models.CASCADE, 107 db_column="oauth2provider_id", 108 ) 109 110 class Meta: 111 db_table = "authentik_endpoints_connectors_agent_agentconnector_jwt_fed2bc6" 112 unique_together = (("agent_connector", "oauth2_provider"),) 113 verbose_name = _("Agent Connector JWT Federation Provider") 114 verbose_name_plural = _("Agent Connector JWT Federation Providers") 115 116 def __str__(self): 117 return ( 118 f"AgentConnectorJWTFederationProvider for AgentConnector {self.agent_connector_id} " 119 f"and OAuth2Provider {self.oauth2_provider_id}." 120 )
AgentConnectorJWTFederationProvider(id, agent_connector, oauth2_provider)
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.
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.
Inherited Members
The requested object does not exist
The query returned multiple objects when only one was expected.
123class AgentDeviceConnection(DeviceConnection): 124 125 apple_key_exchange_key = models.TextField() 126 apple_encryption_key = models.TextField() 127 apple_enc_key_id = models.TextField() 128 apple_signing_key = models.TextField() 129 apple_sign_key_id = models.TextField()
AgentDeviceConnection(device_connection_uuid, device, connector, deviceconnection_ptr, apple_key_exchange_key, apple_encryption_key, apple_enc_key_id, apple_signing_key, apple_sign_key_id)
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.
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.
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 one-to-one relation.
In the example::
class Restaurant(Model):
place = OneToOneField(Place, related_name='restaurant')
Restaurant.place is a ForwardOneToOneDescriptor instance.
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Parent.children is a ReverseManyToOneDescriptor instance.
Most of the implementation is delegated to a dynamically defined manager
class built by create_forward_many_to_many_manager() defined below.
The requested object does not exist
The query returned multiple objects when only one was expected.
132class AgentDeviceUserBinding(DeviceUserBinding): 133 134 apple_secure_enclave_key = models.TextField() 135 apple_enclave_key_id = models.TextField() 136 137 class Meta: 138 verbose_name = _("Agent Device User binding") 139 verbose_name_plural = _("Agent Device User bindings")
AgentDeviceUserBinding(expires, policy_binding_uuid, enabled, dry_run, expiring, policy, group, user, target, negate, timeout, failure_result, order, policybinding_ptr, is_primary, connector, deviceuserbinding_ptr, apple_secure_enclave_key, apple_enclave_key_id)
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 one-to-one relation.
In the example::
class Restaurant(Model):
place = OneToOneField(Place, related_name='restaurant')
Restaurant.place is a ForwardOneToOneDescriptor instance.
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Parent.children is a ReverseManyToOneDescriptor instance.
Most of the implementation is delegated to a dynamically defined manager
class built by create_forward_many_to_many_manager() defined below.
Inherited Members
The requested object does not exist
The query returned multiple objects when only one was expected.
142class DeviceToken(InternallyManagedMixin, ExpiringModel): 143 """Per-device token used for authentication.""" 144 145 token_uuid = models.UUIDField(primary_key=True, default=uuid4) 146 device = models.ForeignKey(AgentDeviceConnection, on_delete=models.CASCADE) 147 key = models.TextField(default=generate_key) 148 149 class Meta: 150 verbose_name = _("Device Token") 151 verbose_name_plural = _("Device Tokens") 152 indexes = ExpiringModel.Meta.indexes + [ 153 models.Index(fields=["key"]), 154 ]
Per-device token used for authentication.
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.
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 objects manager on the reverse side of a many-to-one relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Parent.children is a ReverseManyToOneDescriptor instance.
Most of the implementation is delegated to a dynamically defined manager
class built by create_forward_many_to_many_manager() defined below.
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example::
class Child(Model):
parent = ForeignKey(Parent, related_name='children')
Parent.children is a ReverseManyToOneDescriptor instance.
Most of the implementation is delegated to a dynamically defined manager
class built by create_forward_many_to_many_manager() defined below.
Inherited Members
The requested object does not exist
The query returned multiple objects when only one was expected.
157class EnrollmentToken(ExpiringModel, SerializerModel): 158 """Token used during enrollment, a device will receive 159 a device token for further authentication""" 160 161 token_uuid = models.UUIDField(primary_key=True, editable=False, default=uuid4) 162 name = models.TextField() 163 key = models.TextField(default=default_token_key) 164 connector = models.ForeignKey(AgentConnector, on_delete=models.CASCADE) 165 device_group = models.ForeignKey( 166 DeviceAccessGroup, on_delete=models.SET_DEFAULT, default=None, null=True 167 ) 168 169 @property 170 def serializer(self) -> type[Serializer]: 171 from authentik.endpoints.connectors.agent.api.enrollment_tokens import ( 172 EnrollmentTokenSerializer, 173 ) 174 175 return EnrollmentTokenSerializer 176 177 class Meta: 178 verbose_name = _("Enrollment Token") 179 verbose_name_plural = _("Enrollment Tokens") 180 indexes = ExpiringModel.Meta.indexes + [ 181 models.Index(fields=["key"]), 182 ] 183 permissions = [ 184 ("view_enrollment_token_key", _("View token's key")), 185 ]
Token used during enrollment, a device will receive a device token for further authentication
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.
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.
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.
169 @property 170 def serializer(self) -> type[Serializer]: 171 from authentik.endpoints.connectors.agent.api.enrollment_tokens import ( 172 EnrollmentTokenSerializer, 173 ) 174 175 return EnrollmentTokenSerializer
Get serializer for this model
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.
Inherited Members
The requested object does not exist
The query returned multiple objects when only one was expected.
188class DeviceAuthenticationToken(InternallyManagedMixin, ExpiringModel): 189 190 identifier = models.UUIDField(default=uuid4, primary_key=True) 191 device = models.ForeignKey(Device, on_delete=models.CASCADE) 192 device_token = models.ForeignKey(DeviceToken, on_delete=models.CASCADE) 193 connector = models.ForeignKey(AgentConnector, on_delete=models.CASCADE) 194 user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, default=None) 195 token = models.TextField() 196 197 def __str__(self): 198 return f"Device authentication token {self.identifier}" 199 200 class Meta(ExpiringModel.Meta): 201 verbose_name = _("Device authentication token") 202 verbose_name_plural = _("Device authentication tokens")
DeviceAuthenticationToken(expires, expiring, identifier, device, device_token, connector, user, token)
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.
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.
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.
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.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
Inherited Members
The requested object does not exist
The query returned multiple objects when only one was expected.
205class AppleNonce(InternallyManagedMixin, ExpiringModel): 206 nonce = models.TextField() 207 device_token = models.ForeignKey(DeviceToken, on_delete=models.CASCADE) 208 209 class Meta(ExpiringModel.Meta): 210 verbose_name = _("Apple Nonce") 211 verbose_name_plural = _("Apple Nonces")
AppleNonce(id, expires, expiring, nonce, device_token)
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.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
Inherited Members
The requested object does not exist
The query returned multiple objects when only one was expected.
214class AppleAuthorizationCode(InternallyManagedMixin, ExpiringModel): 215 """Short-lived code issued by the authorize endpoint, exchanged for tokens.""" 216 217 code = models.TextField(default=generate_id) 218 user = models.ForeignKey(User, on_delete=models.CASCADE) 219 connector = models.ForeignKey("AgentConnector", on_delete=models.CASCADE) 220 # The device the code was issued to, it is the only one allowed to redeem it 221 device_connection = models.ForeignKey(AgentDeviceConnection, on_delete=models.CASCADE) 222 state = models.TextField(default="") 223 scope = models.TextField() 224 225 class Meta(ExpiringModel.Meta): 226 verbose_name = _("Apple Authorization Code") 227 verbose_name_plural = _("Apple Authorization Codes") 228 indexes = ExpiringModel.Meta.indexes + [ 229 models.Index(fields=["code"]), 230 ]
Short-lived code issued by the authorize endpoint, exchanged for tokens.
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.
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.
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.
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.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
Inherited Members
The requested object does not exist
The query returned multiple objects when only one was expected.
233class AppleUnlockKey(InternallyManagedMixin, ExpiringModel): 234 """Server-provisioned EC256 key for Platform SSO v2.0 user_unlock.""" 235 236 identifier = models.UUIDField(primary_key=True, default=uuid4) 237 device_user = models.ForeignKey(AgentDeviceUserBinding, on_delete=models.CASCADE) 238 private_key = models.TextField() 239 certificate_der = models.TextField(default="") 240 241 class Meta(ExpiringModel.Meta): 242 verbose_name = _("Apple Unlock Key") 243 verbose_name_plural = _("Apple Unlock Keys")
Server-provisioned EC256 key for Platform SSO v2.0 user_unlock.
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.
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.
Inherited Members
The requested object does not exist
The query returned multiple objects when only one was expected.
246class AppleIndependentSecureEnclave(Authenticator): 247 """A device-independent secure enclave key, used by Tap-to-login""" 248 249 uuid = models.UUIDField(primary_key=True, default=uuid4) 250 251 apple_secure_enclave_key = models.TextField() 252 apple_enclave_key_id = models.TextField() 253 device_type = models.TextField() 254 255 class Meta: 256 verbose_name = _("Apple Independent Secure Enclave") 257 verbose_name_plural = _("Apple Independent Secure Enclaves")
A device-independent secure enclave key, used by Tap-to-login
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.
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.
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.
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
Method descriptor with partial application of the given arguments and keywords.
Supports wrapping existing descriptors and handles non-descriptor callables as instance methods.
Method descriptor with partial application of the given arguments and keywords.
Supports wrapping existing descriptors and handles non-descriptor callables as instance methods.
Method descriptor with partial application of the given arguments and keywords.
Supports wrapping existing descriptors and handles non-descriptor callables as instance methods.
The requested object does not exist
The query returned multiple objects when only one was expected.