:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore: add scope columns to idp config (#75089)
Reece Jonescf3bccc7be06
diff --git a/posthog/migrations/1278_identityproviderconfig_config_scope_and_more.py b/posthog/migrations/1278_identityproviderconfig_config_scope_and_more.pynew file mode 100644index 000000000000..499cf9b765e3--- /dev/null+++ b/posthog/migrations/1278_identityproviderconfig_config_scope_and_more.py@@ -0,0 +1,32 @@+# Generated by Django 5.2.14 on 2026-07-29 20:57++from django.db import migrations, models+++class Migration(migrations.Migration):+ dependencies = [+ ("posthog", "1277_drop_duckgresserverteam_hot_table_fks"),+ ]++ operations = [+ migrations.AddField(+ model_name="identityproviderconfig",+ name="config_scope",+ field=models.CharField(+ blank=True,+ choices=[("saml", "Saml"), ("scim", "Scim"), ("xaa", "Xaa")],+ max_length=4,+ null=True,+ ),+ ),+ migrations.AddField(+ model_name="identityproviderconfig",+ name="domain_scope",+ field=models.CharField(+ blank=True,+ choices=[("all", "All"), ("selected", "Selected")],+ max_length=8,+ null=True,+ ),+ ),+ ]diff --git a/posthog/migrations/max_migration.txt b/posthog/migrations/max_migration.txtindex 048bf8e2dd06..68b4884554ca 100644--- a/posthog/migrations/max_migration.txt+++ b/posthog/migrations/max_migration.txt@@ -1 +1 @@-1277_drop_duckgresserverteam_hot_table_fks+1278_identityproviderconfig_config_scope_and_morediff --git a/posthog/models/identity_provider_config.py b/posthog/models/identity_provider_config.pyindex 5066024e127d..9df03722a4b2 100644--- a/posthog/models/identity_provider_config.py+++ b/posthog/models/identity_provider_config.py@@ -9,6 +9,17 @@ from posthog.models.utils import UUIDModellogger = structlog.get_logger(__name__)+class DomainScope(models.TextChoices):+ ALL = "all"+ SELECTED = "selected"+++class ConfigScope(models.TextChoices):+ SAML = "saml"+ SCIM = "scim"+ XAA = "xaa"++class IdentityProviderConfig(ModelActivityMixin, UUIDModel):"""Identity provider (IdP) configuration for an organization.@@ -31,6 +42,8 @@ class IdentityProviderConfig(ModelActivityMixin, UUIDModel):default="",help_text="Display name for this IdP configuration (e.g. 'Okta production').",)+ domain_scope = models.CharField(max_length=8, choices=DomainScope, blank=True, null=True)+ config_scope = models.CharField(max_length=4, choices=ConfigScope, blank=True, null=True)created_at = models.DateTimeField(auto_now_add=True)updated_at = models.DateTimeField(auto_now=True)