authentik.enterprise.providers.google_workspace.models
Google workspace sync provider
1"""Google workspace sync provider""" 2 3from typing import Any, Self 4from uuid import uuid4 5 6from django.db import models 7from django.templatetags.static import static 8from django.utils.translation import gettext_lazy as _ 9from dramatiq.actor import Actor 10from google.oauth2.service_account import Credentials 11from rest_framework.serializers import Serializer 12 13from authentik.core.models import ( 14 BackchannelProvider, 15 Group, 16 PropertyMapping, 17 User, 18) 19from authentik.lib.models import InternallyManagedMixin, SerializerModel, SimpleThroughModel 20from authentik.lib.sync.outgoing.base import BaseOutgoingSyncClient 21from authentik.lib.sync.outgoing.models import ( 22 OutgoingSyncDeleteAction, 23 OutgoingSyncObjectQueryMixin, 24 OutgoingSyncProvider, 25) 26 27 28def default_scopes() -> list[str]: 29 return [ 30 "https://www.googleapis.com/auth/admin.directory.user", 31 "https://www.googleapis.com/auth/admin.directory.group", 32 "https://www.googleapis.com/auth/admin.directory.group.member", 33 "https://www.googleapis.com/auth/admin.directory.domain.readonly", 34 ] 35 36 37class GoogleWorkspaceProviderUser(InternallyManagedMixin, SerializerModel): 38 """Mapping of a user and provider to a Google user ID""" 39 40 id = models.UUIDField(primary_key=True, editable=False, default=uuid4) 41 google_id = models.TextField() 42 user = models.ForeignKey(User, on_delete=models.CASCADE) 43 provider = models.ForeignKey("GoogleWorkspaceProvider", on_delete=models.CASCADE) 44 attributes = models.JSONField(default=dict) 45 46 @property 47 def serializer(self) -> type[Serializer]: 48 from authentik.enterprise.providers.google_workspace.api.users import ( 49 GoogleWorkspaceProviderUserSerializer, 50 ) 51 52 return GoogleWorkspaceProviderUserSerializer 53 54 class Meta: 55 verbose_name = _("Google Workspace Provider User") 56 verbose_name_plural = _("Google Workspace Provider Users") 57 unique_together = (("google_id", "user", "provider"),) 58 59 def __str__(self) -> str: 60 return f"Google Workspace Provider User {self.user_id} to {self.provider_id}" 61 62 63class GoogleWorkspaceProviderGroup(InternallyManagedMixin, SerializerModel): 64 """Mapping of a group and provider to a Google group ID""" 65 66 id = models.UUIDField(primary_key=True, editable=False, default=uuid4) 67 google_id = models.TextField() 68 group = models.ForeignKey(Group, on_delete=models.CASCADE) 69 provider = models.ForeignKey("GoogleWorkspaceProvider", on_delete=models.CASCADE) 70 attributes = models.JSONField(default=dict) 71 72 @property 73 def serializer(self) -> type[Serializer]: 74 from authentik.enterprise.providers.google_workspace.api.groups import ( 75 GoogleWorkspaceProviderGroupSerializer, 76 ) 77 78 return GoogleWorkspaceProviderGroupSerializer 79 80 class Meta: 81 verbose_name = _("Google Workspace Provider Group") 82 verbose_name_plural = _("Google Workspace Provider Groups") 83 unique_together = (("google_id", "group", "provider"),) 84 85 def __str__(self) -> str: 86 return f"Google Workspace Provider Group {self.group_id} to {self.provider_id}" 87 88 89class GoogleWorkspaceProvider( 90 OutgoingSyncObjectQueryMixin, OutgoingSyncProvider, BackchannelProvider 91): 92 """Sync users from authentik into Google Workspace.""" 93 94 delegated_subject = models.EmailField() 95 credentials = models.JSONField() 96 scopes = models.TextField(default=",".join(default_scopes())) 97 98 default_group_email_domain = models.TextField() 99 exclude_users_service_account = models.BooleanField(default=False) 100 user_delete_action = models.TextField( 101 choices=OutgoingSyncDeleteAction.choices, default=OutgoingSyncDeleteAction.DELETE 102 ) 103 group_delete_action = models.TextField( 104 choices=OutgoingSyncDeleteAction.choices, default=OutgoingSyncDeleteAction.DELETE 105 ) 106 107 group_filters = models.ManyToManyField( 108 "authentik_core.group", 109 default=None, 110 blank=True, 111 help_text=_("Group filters used to define sync-scope for groups."), 112 related_name="+", 113 through="GoogleWorkspaceProviderGroupFilter", 114 ) 115 116 # Keep the legacy field for rolling upgrades and group deletion. 117 filter_group = models.ForeignKey( 118 "authentik_core.group", on_delete=models.SET_DEFAULT, default=None, null=True 119 ) 120 121 property_mappings_group = models.ManyToManyField( 122 PropertyMapping, 123 default=None, 124 blank=True, 125 help_text=_("Property mappings used for group creation/updating."), 126 through="GoogleWorkspaceProviderPropertyMappingsGroup", 127 ) 128 129 @property 130 def sync_actor(self) -> Actor: 131 from authentik.enterprise.providers.google_workspace.tasks import google_workspace_sync 132 133 return google_workspace_sync 134 135 def client_for_model( 136 self, 137 model: type[User | Group | GoogleWorkspaceProviderUser | GoogleWorkspaceProviderGroup], 138 ) -> BaseOutgoingSyncClient[User | Group, Any, Any, Self]: 139 if issubclass(model, User | GoogleWorkspaceProviderUser): 140 from authentik.enterprise.providers.google_workspace.clients.users import ( 141 GoogleWorkspaceUserClient, 142 ) 143 144 return GoogleWorkspaceUserClient(self) 145 if issubclass(model, Group | GoogleWorkspaceProviderGroup): 146 from authentik.enterprise.providers.google_workspace.clients.groups import ( 147 GoogleWorkspaceGroupClient, 148 ) 149 150 return GoogleWorkspaceGroupClient(self) 151 raise ValueError(f"Invalid model {model}") 152 153 @classmethod 154 def get_object_mappings(cls, obj: User | Group) -> list[tuple[str, str]]: 155 if isinstance(obj, User): 156 return list( 157 obj.googleworkspaceprovideruser_set.values_list("provider__pk", "google_id") 158 ) 159 if isinstance(obj, Group): 160 return list( 161 obj.googleworkspaceprovidergroup_set.values_list("provider__pk", "google_id") 162 ) 163 raise ValueError(f"Invalid type {type(obj)}") 164 165 def google_credentials(self): 166 return { 167 "credentials": Credentials.from_service_account_info( 168 self.credentials, scopes=self.scopes.split(",") 169 ).with_subject(self.delegated_subject), 170 } 171 172 @property 173 def icon_url(self) -> str | None: 174 return static("authentik/sources/google/light.svg") 175 176 @property 177 def component(self) -> str: 178 return "ak-provider-google-workspace-form" 179 180 @property 181 def serializer(self) -> type[Serializer]: 182 from authentik.enterprise.providers.google_workspace.api.providers import ( 183 GoogleWorkspaceProviderSerializer, 184 ) 185 186 return GoogleWorkspaceProviderSerializer 187 188 def __str__(self): 189 return f"Google Workspace Provider {self.name}" 190 191 class Meta: 192 verbose_name = _("Google Workspace Provider") 193 verbose_name_plural = _("Google Workspace Providers") 194 195 196class GoogleWorkspaceProviderGroupFilter(SimpleThroughModel): 197 group = models.ForeignKey(Group, on_delete=models.CASCADE) 198 google_workspace_provider = models.ForeignKey( 199 GoogleWorkspaceProvider, 200 on_delete=models.CASCADE, 201 db_column="googleworkspaceprovider_id", 202 ) 203 204 class Meta: 205 db_table = "authentik_providers_google_workspace_group_filters" 206 unique_together = (("group", "google_workspace_provider"),) 207 verbose_name = _("Google Workspace Provider Group Filter") 208 verbose_name_plural = _("Google Workspace Provider Group Filters") 209 210 def __str__(self): 211 return ( 212 f"GoogleWorkspaceProviderGroupFilter for GoogleWorkspaceProvider " 213 f"{self.google_workspace_provider_id} and Group {self.group_id}." 214 ) 215 216 217class GoogleWorkspaceProviderPropertyMappingsGroup(SimpleThroughModel): 218 google_workspace_provider = models.ForeignKey( 219 GoogleWorkspaceProvider, 220 on_delete=models.CASCADE, 221 db_column="googleworkspaceprovider_id", 222 ) 223 property_mapping = models.ForeignKey( 224 PropertyMapping, on_delete=models.CASCADE, db_column="propertymapping_id" 225 ) 226 227 class Meta: 228 db_table = "authentik_providers_google_workspace_googleworkspaceprovide63d9" 229 unique_together = (("google_workspace_provider", "property_mapping"),) 230 verbose_name = _("Google Workspace Provider Property Mappings Group") 231 verbose_name_plural = _("Google Workspace Provider Property Mappings Groups") 232 233 def __str__(self): 234 return ( 235 "GoogleWorkspaceProviderPropertyMappingsGroup for GoogleWorkspaceProvider " 236 f"{self.google_workspace_provider_id} " 237 f"and PropertyMapping {self.property_mapping_id}." 238 ) 239 240 241class GoogleWorkspaceProviderMapping(PropertyMapping): 242 """Map authentik data to outgoing Google requests""" 243 244 expression_allowed_types = [dict] 245 246 @property 247 def component(self) -> str: 248 return "ak-property-mapping-provider-google-workspace-form" 249 250 @property 251 def serializer(self) -> type[Serializer]: 252 from authentik.enterprise.providers.google_workspace.api.property_mappings import ( 253 GoogleWorkspaceProviderMappingSerializer, 254 ) 255 256 return GoogleWorkspaceProviderMappingSerializer 257 258 def __str__(self): 259 return f"Google Workspace Provider Mapping {self.name}" 260 261 class Meta: 262 verbose_name = _("Google Workspace Provider Mapping") 263 verbose_name_plural = _("Google Workspace Provider Mappings")
29def default_scopes() -> list[str]: 30 return [ 31 "https://www.googleapis.com/auth/admin.directory.user", 32 "https://www.googleapis.com/auth/admin.directory.group", 33 "https://www.googleapis.com/auth/admin.directory.group.member", 34 "https://www.googleapis.com/auth/admin.directory.domain.readonly", 35 ]
38class GoogleWorkspaceProviderUser(InternallyManagedMixin, SerializerModel): 39 """Mapping of a user and provider to a Google user ID""" 40 41 id = models.UUIDField(primary_key=True, editable=False, default=uuid4) 42 google_id = models.TextField() 43 user = models.ForeignKey(User, on_delete=models.CASCADE) 44 provider = models.ForeignKey("GoogleWorkspaceProvider", on_delete=models.CASCADE) 45 attributes = models.JSONField(default=dict) 46 47 @property 48 def serializer(self) -> type[Serializer]: 49 from authentik.enterprise.providers.google_workspace.api.users import ( 50 GoogleWorkspaceProviderUserSerializer, 51 ) 52 53 return GoogleWorkspaceProviderUserSerializer 54 55 class Meta: 56 verbose_name = _("Google Workspace Provider User") 57 verbose_name_plural = _("Google Workspace Provider Users") 58 unique_together = (("google_id", "user", "provider"),) 59 60 def __str__(self) -> str: 61 return f"Google Workspace Provider User {self.user_id} to {self.provider_id}"
Mapping of a user and provider to a Google user 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 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.
47 @property 48 def serializer(self) -> type[Serializer]: 49 from authentik.enterprise.providers.google_workspace.api.users import ( 50 GoogleWorkspaceProviderUserSerializer, 51 ) 52 53 return GoogleWorkspaceProviderUserSerializer
Get serializer for this model
Inherited Members
The requested object does not exist
The query returned multiple objects when only one was expected.
64class GoogleWorkspaceProviderGroup(InternallyManagedMixin, SerializerModel): 65 """Mapping of a group and provider to a Google group ID""" 66 67 id = models.UUIDField(primary_key=True, editable=False, default=uuid4) 68 google_id = models.TextField() 69 group = models.ForeignKey(Group, on_delete=models.CASCADE) 70 provider = models.ForeignKey("GoogleWorkspaceProvider", on_delete=models.CASCADE) 71 attributes = models.JSONField(default=dict) 72 73 @property 74 def serializer(self) -> type[Serializer]: 75 from authentik.enterprise.providers.google_workspace.api.groups import ( 76 GoogleWorkspaceProviderGroupSerializer, 77 ) 78 79 return GoogleWorkspaceProviderGroupSerializer 80 81 class Meta: 82 verbose_name = _("Google Workspace Provider Group") 83 verbose_name_plural = _("Google Workspace Provider Groups") 84 unique_together = (("google_id", "group", "provider"),) 85 86 def __str__(self) -> str: 87 return f"Google Workspace Provider Group {self.group_id} to {self.provider_id}"
Mapping of a group and provider to a Google group 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 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.
73 @property 74 def serializer(self) -> type[Serializer]: 75 from authentik.enterprise.providers.google_workspace.api.groups import ( 76 GoogleWorkspaceProviderGroupSerializer, 77 ) 78 79 return GoogleWorkspaceProviderGroupSerializer
Get serializer for this model
Inherited Members
The requested object does not exist
The query returned multiple objects when only one was expected.
90class GoogleWorkspaceProvider( 91 OutgoingSyncObjectQueryMixin, OutgoingSyncProvider, BackchannelProvider 92): 93 """Sync users from authentik into Google Workspace.""" 94 95 delegated_subject = models.EmailField() 96 credentials = models.JSONField() 97 scopes = models.TextField(default=",".join(default_scopes())) 98 99 default_group_email_domain = models.TextField() 100 exclude_users_service_account = models.BooleanField(default=False) 101 user_delete_action = models.TextField( 102 choices=OutgoingSyncDeleteAction.choices, default=OutgoingSyncDeleteAction.DELETE 103 ) 104 group_delete_action = models.TextField( 105 choices=OutgoingSyncDeleteAction.choices, default=OutgoingSyncDeleteAction.DELETE 106 ) 107 108 group_filters = models.ManyToManyField( 109 "authentik_core.group", 110 default=None, 111 blank=True, 112 help_text=_("Group filters used to define sync-scope for groups."), 113 related_name="+", 114 through="GoogleWorkspaceProviderGroupFilter", 115 ) 116 117 # Keep the legacy field for rolling upgrades and group deletion. 118 filter_group = models.ForeignKey( 119 "authentik_core.group", on_delete=models.SET_DEFAULT, default=None, null=True 120 ) 121 122 property_mappings_group = models.ManyToManyField( 123 PropertyMapping, 124 default=None, 125 blank=True, 126 help_text=_("Property mappings used for group creation/updating."), 127 through="GoogleWorkspaceProviderPropertyMappingsGroup", 128 ) 129 130 @property 131 def sync_actor(self) -> Actor: 132 from authentik.enterprise.providers.google_workspace.tasks import google_workspace_sync 133 134 return google_workspace_sync 135 136 def client_for_model( 137 self, 138 model: type[User | Group | GoogleWorkspaceProviderUser | GoogleWorkspaceProviderGroup], 139 ) -> BaseOutgoingSyncClient[User | Group, Any, Any, Self]: 140 if issubclass(model, User | GoogleWorkspaceProviderUser): 141 from authentik.enterprise.providers.google_workspace.clients.users import ( 142 GoogleWorkspaceUserClient, 143 ) 144 145 return GoogleWorkspaceUserClient(self) 146 if issubclass(model, Group | GoogleWorkspaceProviderGroup): 147 from authentik.enterprise.providers.google_workspace.clients.groups import ( 148 GoogleWorkspaceGroupClient, 149 ) 150 151 return GoogleWorkspaceGroupClient(self) 152 raise ValueError(f"Invalid model {model}") 153 154 @classmethod 155 def get_object_mappings(cls, obj: User | Group) -> list[tuple[str, str]]: 156 if isinstance(obj, User): 157 return list( 158 obj.googleworkspaceprovideruser_set.values_list("provider__pk", "google_id") 159 ) 160 if isinstance(obj, Group): 161 return list( 162 obj.googleworkspaceprovidergroup_set.values_list("provider__pk", "google_id") 163 ) 164 raise ValueError(f"Invalid type {type(obj)}") 165 166 def google_credentials(self): 167 return { 168 "credentials": Credentials.from_service_account_info( 169 self.credentials, scopes=self.scopes.split(",") 170 ).with_subject(self.delegated_subject), 171 } 172 173 @property 174 def icon_url(self) -> str | None: 175 return static("authentik/sources/google/light.svg") 176 177 @property 178 def component(self) -> str: 179 return "ak-provider-google-workspace-form" 180 181 @property 182 def serializer(self) -> type[Serializer]: 183 from authentik.enterprise.providers.google_workspace.api.providers import ( 184 GoogleWorkspaceProviderSerializer, 185 ) 186 187 return GoogleWorkspaceProviderSerializer 188 189 def __str__(self): 190 return f"Google Workspace Provider {self.name}" 191 192 class Meta: 193 verbose_name = _("Google Workspace Provider") 194 verbose_name_plural = _("Google Workspace Providers")
Sync users from authentik into Google Workspace.
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.
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.
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 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.
136 def client_for_model( 137 self, 138 model: type[User | Group | GoogleWorkspaceProviderUser | GoogleWorkspaceProviderGroup], 139 ) -> BaseOutgoingSyncClient[User | Group, Any, Any, Self]: 140 if issubclass(model, User | GoogleWorkspaceProviderUser): 141 from authentik.enterprise.providers.google_workspace.clients.users import ( 142 GoogleWorkspaceUserClient, 143 ) 144 145 return GoogleWorkspaceUserClient(self) 146 if issubclass(model, Group | GoogleWorkspaceProviderGroup): 147 from authentik.enterprise.providers.google_workspace.clients.groups import ( 148 GoogleWorkspaceGroupClient, 149 ) 150 151 return GoogleWorkspaceGroupClient(self) 152 raise ValueError(f"Invalid model {model}")
154 @classmethod 155 def get_object_mappings(cls, obj: User | Group) -> list[tuple[str, str]]: 156 if isinstance(obj, User): 157 return list( 158 obj.googleworkspaceprovideruser_set.values_list("provider__pk", "google_id") 159 ) 160 if isinstance(obj, Group): 161 return list( 162 obj.googleworkspaceprovidergroup_set.values_list("provider__pk", "google_id") 163 ) 164 raise ValueError(f"Invalid type {type(obj)}")
Get a list of mapping between User/Group and ProviderUser/Group: [("provider_pk", "obj_pk")]
181 @property 182 def serializer(self) -> type[Serializer]: 183 from authentik.enterprise.providers.google_workspace.api.providers import ( 184 GoogleWorkspaceProviderSerializer, 185 ) 186 187 return GoogleWorkspaceProviderSerializer
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.
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 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.
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.
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.
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
- authentik.lib.sync.outgoing.models.OutgoingSyncProvider
- Meta
- get_paginator
- get_object_sync_time_limit_ms
- get_sync_time_limit_ms
- sync_lock
- sync_dispatch
- schedule_specs
- authentik.lib.sync.outgoing.models.OutgoingSyncObjectQueryMixin
- backchannel_application
- get_object_qs
- authentik.core.models.Provider
- name
- authentication_flow
- invalidation_flow
- property_mappings
- is_backchannel
- objects
- launch_url
- authentication_flow_id
- invalidation_flow_id
- backchannel_application_id
- id
- application
- providerpropertymapping_set
- outpost_set
- outpostprovider_set
- oauth2provider
- ldapprovider
- racprovider
- radiusprovider
- samlprovider
- scimprovider
- googleworkspaceprovider
- microsoftentraprovider
- ssfprovider
The requested object does not exist
The query returned multiple objects when only one was expected.
197class GoogleWorkspaceProviderGroupFilter(SimpleThroughModel): 198 group = models.ForeignKey(Group, on_delete=models.CASCADE) 199 google_workspace_provider = models.ForeignKey( 200 GoogleWorkspaceProvider, 201 on_delete=models.CASCADE, 202 db_column="googleworkspaceprovider_id", 203 ) 204 205 class Meta: 206 db_table = "authentik_providers_google_workspace_group_filters" 207 unique_together = (("group", "google_workspace_provider"),) 208 verbose_name = _("Google Workspace Provider Group Filter") 209 verbose_name_plural = _("Google Workspace Provider Group Filters") 210 211 def __str__(self): 212 return ( 213 f"GoogleWorkspaceProviderGroupFilter for GoogleWorkspaceProvider " 214 f"{self.google_workspace_provider_id} and Group {self.group_id}." 215 )
GoogleWorkspaceProviderGroupFilter(id, group, google_workspace_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.
218class GoogleWorkspaceProviderPropertyMappingsGroup(SimpleThroughModel): 219 google_workspace_provider = models.ForeignKey( 220 GoogleWorkspaceProvider, 221 on_delete=models.CASCADE, 222 db_column="googleworkspaceprovider_id", 223 ) 224 property_mapping = models.ForeignKey( 225 PropertyMapping, on_delete=models.CASCADE, db_column="propertymapping_id" 226 ) 227 228 class Meta: 229 db_table = "authentik_providers_google_workspace_googleworkspaceprovide63d9" 230 unique_together = (("google_workspace_provider", "property_mapping"),) 231 verbose_name = _("Google Workspace Provider Property Mappings Group") 232 verbose_name_plural = _("Google Workspace Provider Property Mappings Groups") 233 234 def __str__(self): 235 return ( 236 "GoogleWorkspaceProviderPropertyMappingsGroup for GoogleWorkspaceProvider " 237 f"{self.google_workspace_provider_id} " 238 f"and PropertyMapping {self.property_mapping_id}." 239 )
GoogleWorkspaceProviderPropertyMappingsGroup(id, google_workspace_provider, property_mapping)
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.
242class GoogleWorkspaceProviderMapping(PropertyMapping): 243 """Map authentik data to outgoing Google requests""" 244 245 expression_allowed_types = [dict] 246 247 @property 248 def component(self) -> str: 249 return "ak-property-mapping-provider-google-workspace-form" 250 251 @property 252 def serializer(self) -> type[Serializer]: 253 from authentik.enterprise.providers.google_workspace.api.property_mappings import ( 254 GoogleWorkspaceProviderMappingSerializer, 255 ) 256 257 return GoogleWorkspaceProviderMappingSerializer 258 259 def __str__(self): 260 return f"Google Workspace Provider Mapping {self.name}" 261 262 class Meta: 263 verbose_name = _("Google Workspace Provider Mapping") 264 verbose_name_plural = _("Google Workspace Provider Mappings")
Map authentik data to outgoing Google requests
247 @property 248 def component(self) -> str: 249 return "ak-property-mapping-provider-google-workspace-form"
Return component used to edit this object
251 @property 252 def serializer(self) -> type[Serializer]: 253 from authentik.enterprise.providers.google_workspace.api.property_mappings import ( 254 GoogleWorkspaceProviderMappingSerializer, 255 ) 256 257 return GoogleWorkspaceProviderMappingSerializer
Get serializer for this model
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
- authentik.core.models.PropertyMapping
- pm_uuid
- name
- expression
- objects
- evaluate
- managed
- provider_set
- source_userpropertymappings_set
- source_grouppropertymappings_set
- sourceuserpropertymapping_set
- sourcegrouppropertymapping_set
- providerpropertymapping_set
- notificationwebhookmapping
- kerberossourcepropertymapping
- ldapsourcepropertymapping
- oauthsourcepropertymapping
- scopemapping
- racpropertymapping
- radiusproviderpropertymapping
- samlsourcepropertymapping
- samlpropertymapping
- scimprovider_set
- scimprovidergrouppropertymapping_set
- scimmapping
- plexsourcepropertymapping
- scimsourcepropertymapping
- telegramsourcepropertymapping
- googleworkspaceprovider_set
- googleworkspaceproviderpropertymappingsgroup_set
- googleworkspaceprovidermapping
- microsoftentraprovider_set
- microsoftentraproviderpropertymappingsgroup_set
- microsoftentraprovidermapping
The requested object does not exist
The query returned multiple objects when only one was expected.