Skip to content

Phase 4: Enforce SSO#2770

Draft
GregorShear wants to merge 5 commits intomasterfrom
greg/enforce-sso
Draft

Phase 4: Enforce SSO#2770
GregorShear wants to merge 5 commits intomasterfrom
greg/enforce-sso

Conversation

@GregorShear
Copy link
Contributor

Summary

Enforce SSO at the authorization layer so that when a tenant has enforce_sso = true, non-SSO users' grants on that tenant are excluded.

  • Add sso_provider_id and enforce_sso columns to the tenants table
  • Update internal.user_roles() to filter out user grants, block transitive grants to non-sso users from sso tenants
  • Apply the same SSO filtering to the snapshot query (user_grants fetch) used by the GraphQL API

Test plan

  • Verify that a non-SSO user loses access to an SSO-enforced tenant's resources via both GraphQL and PostgREST
  • Verify that SSO users retain access to SSO-enforced tenants
  • Verify transitive grants through SSO-enforced tenants are also excluded for non-SSO users

closes #2766

@GregorShear GregorShear changed the base branch from master to greg/invite_links March 13, 2026 19:00
@GregorShear GregorShear changed the title Enforce SSO Phase 4: Enforce SSO Mar 13, 2026
@GregorShear
Copy link
Contributor Author

Need to check these SSO users who each have access to 2 tenants - are both of those SSO tenants? if so, how do we resolve the one sso user to one sso tenant constraint?

[
  {
    "id": "0214efc9-08e8-41e4-bbd2-7a935c34c2c4",
    "email": "fabio.bricchi@openfiber.it",
    "tenant_count": 2,
    "tenants": "{OpenFiber_AWS/,OpenFiber_Test/}"
  },
  {
    "id": "24e836af-8b6e-493c-9833-fa084882a0df",
    "email": "kbinder@aaalife.com",
    "tenant_count": 2,
    "tenants": "{AAA_Life/,AAA_Life_Insurance_Company/}"
  },
  {
    "id": "2b76e63b-5408-43a7-94b6-ad9cfc9f59cc",
    "email": "mlaporta.sys.ca@firstlight.net",
    "tenant_count": 2,
    "tenants": "{FirstLightFiber/,FirstLight_POC/}"
  },
  {
    "id": "42146fef-6128-4c67-90c4-fa7215656aa7",
    "email": "leonardo.massari@openfiber.it",
    "tenant_count": 2,
    "tenants": "{OpenFiber_AWS/,OpenFiber_Test/}"
  },
  {
    "id": "42b4b67d-d923-4089-b705-9b7d0364bfe6",
    "email": "rreddygangireddy@aaalife.com",
    "tenant_count": 2,
    "tenants": "{AAALI/,AAA_Life/}"
  },
  {
    "id": "4706869f-1739-4123-bdc8-2f0ce4b08c63",
    "email": "tommaso.ruta.external@openfiber.it",
    "tenant_count": 2,
    "tenants": "{OpenFiber_AWS/,OpenFiber_Test/}"
  },
  {
    "id": "4dcf393b-3531-4d9b-ac39-2508187adb15",
    "email": "francesco.surace.external@openfiber.it",
    "tenant_count": 2,
    "tenants": "{OpenFiber_AWS/,OpenFiber_Test/}"
  },
  {
    "id": "51aa6826-0112-4921-959e-41b553b3b307",
    "email": "denise.trovato.external@openfiber.it",
    "tenant_count": 2,
    "tenants": "{OpenFiber_AWS/,OpenFiber_Test/}"
  },
  {
    "id": "63408de3-04b7-42cb-a8aa-2f2f3aeec570",
    "email": "tbarlow@aaalife.com",
    "tenant_count": 2,
    "tenants": "{AAALifeInsurance/,AAA_Life/}"
  },
  {
    "id": "a3f168f0-6669-4896-8bc0-c3b80850655c",
    "email": "antonio.grande.external@openfiber.it",
    "tenant_count": 2,
    "tenants": "{OpenFiber_AWS/,OpenFiber_Test/}"
  },
  {
    "id": "a458f8d5-6259-4b7d-8f94-59af26b2f685",
    "email": "massimo.iovine.external@openfiber.it",
    "tenant_count": 2,
    "tenants": "{OpenFiber_AWS/,OpenFiber_Test/}"
  },
  {
    "id": "a9a7b590-c9e6-406a-a080-734c279910d7",
    "email": "dreyling@aaalife.com",
    "tenant_count": 2,
    "tenants": "{AAA_Life/,aaa-life/}"
  },
  {
    "id": "ce7c7165-004e-44ba-8e8b-3a770fcae4c1",
    "email": "antonio.pollidori.external@openfiber.it",
    "tenant_count": 2,
    "tenants": "{OpenFiber_AWS/,OpenFiber_Test/}"
  },
  {
    "id": "e46278f8-cb38-4faf-9e62-71a93f91580f",
    "email": "luigi.dauria.external@openfiber.it",
    "tenant_count": 2,
    "tenants": "{OpenFiber_AWS/,OpenFiber_Test/}"
  }
]

@GregorShear GregorShear force-pushed the greg/invite_links branch 5 times, most recently from ca6b2cf to d7e4dbf Compare March 13, 2026 21:33
@GregorShear GregorShear force-pushed the greg/enforce-sso branch 3 times, most recently from 29e6c63 to 50bd948 Compare March 14, 2026 02:02
@GregorShear GregorShear force-pushed the greg/invite_links branch 3 times, most recently from 1566581 to 3fbc8d2 Compare March 17, 2026 17:33
Base automatically changed from greg/invite_links to master March 17, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 4: Enforce SSO, filter grants

1 participant