: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
feat(data-warehouse): add 4 missing tables to the Snyk source (#123828)
Tom Owers2e8cf203fdb7
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.mdindex 748c9d999052..539e87b49a32 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md@@ -11339,10 +11339,10 @@ Today (4): `issues`, `organizations`, `projects`, `targets`Diffed against: <https://api.snyk.io/rest/openapi/2026-03-25>-- [ ] `GET /orgs/{org_id}/memberships` — user-to-org membership with role - the lookup that resolves who owns the projects and issues we sync (high)+- [x] `GET /orgs/{org_id}/memberships` — user-to-org membership with role - the lookup that resolves who owns the projects and issues we sync (high)- [ ] `GET /groups and GET /groups/{group_id}/orgs` — group is the parent of every org; without it multi-org rollups have no hierarchy to aggregate on (high)-- [ ] `GET /groups/{group_id}/memberships and /org_memberships` — group-level membership and role assignment across all orgs (medium)-- [ ] `GET /orgs/{org_id}/collections and /collections/{collection_id}/relationships/projects` — collection membership - the standard breakdown dimension for grouping projects in reporting (medium)+- [x] `GET /groups/{group_id}/memberships and /org_memberships` — group-level membership and role assignment across all orgs (medium)+- [x] `GET /orgs/{org_id}/collections and /collections/{collection_id}/relationships/projects` — collection membership - the standard breakdown dimension for grouping projects in reporting (medium)- [ ] `GET /orgs/{org_id}/policies and GET /orgs/{org_id}/policies/{policy_id}/events` — ignore/severity policies plus their event log explain why issues we sync are suppressed or re-rated (medium)- [ ] `GET /orgs/{org_id}/container_images (and /relationships/image_target_refs)` — container image inventory joining images to the targets already synced (medium)- [ ] `GET /orgs/{org_id}/audit_logs/search (and group-level equivalent)` — state/transition history for org and project changes (medium)diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/canonical_descriptions.pyindex a8cb5428e1f1..0067c3b8659b 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/canonical_descriptions.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/canonical_descriptions.py@@ -72,4 +72,52 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {"updated_at": "When the issue was last updated.",},},+ "org_memberships": {+ "description": "A user's membership of a Snyk organization, with the role the user holds in that organization.",+ "docs_url": "https://apidocs.snyk.io/#get-/orgs/-org_id-/memberships",+ "columns": {+ "id": "Unique identifier (UUID) of the membership.",+ "type": "JSON:API resource type (org_membership).",+ "organization_id": "Identifier of the organization the membership belongs to.",+ "created_at": "When the user became a member of the organization.",+ "relationships": "The organization, the user (id, name, email, username, login method) and the role (id, name) of the membership.",+ },+ },+ "group_memberships": {+ "description": "A user's membership of a Snyk group, with the group-level role the user holds. A group is the parent of a set of organizations.",+ "docs_url": "https://apidocs.snyk.io/#get-/groups/-group_id-/memberships",+ "columns": {+ "id": "Unique identifier (UUID) of the membership.",+ "type": "JSON:API resource type (group_membership).",+ "group_id": "Identifier of the group the membership belongs to.",+ "created_at": "When the user became a member of the group.",+ "meta": "Membership metadata, such as the number of group memberships the user has.",+ "relationships": "The group, the user (id, name, email, username, login method) and the role (id, name) of the membership.",+ },+ },+ "collections": {+ "description": "A collection is a named set of projects in an organization, used to group projects for reporting.",+ "docs_url": "https://apidocs.snyk.io/#get-/orgs/-org_id-/collections",+ "columns": {+ "id": "Unique identifier (UUID) of the collection.",+ "type": "JSON:API resource type (collection).",+ "organization_id": "Identifier of the organization the collection belongs to.",+ "name": "Name of the collection.",+ "is_generated": "Whether Snyk generated the collection rather than a user.",+ "meta": "Counts for the collection: projects and issues by severity (critical, high, medium, low).",+ "relationships": "The organization of the collection and the user who created it.",+ },+ },+ "collection_projects": {+ "description": "One row for each project in a collection. A project can be in more than one collection.",+ "docs_url": "https://apidocs.snyk.io/#get-/orgs/-org_id-/collections/-collection_id-/relationships/projects",+ "columns": {+ "id": "Identifier (UUID) of the project.",+ "type": "JSON:API resource type (project).",+ "collection_id": "Identifier of the collection that contains the project.",+ "organization_id": "Identifier of the organization the collection belongs to.",+ "meta": "Project data: when it was imported, when it was last tested, and its issue counts by severity.",+ "relationships": "The target the project was imported from.",+ },+ },}diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/settings.pyindex c31892abcd48..0b66737569e3 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/settings.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/settings.py@@ -16,6 +16,12 @@ class SnykScope(Enum):ORGANIZATION = "organization"# Fan out over every organization the token can see (GET /rest/orgs/{org_id}/...).PER_ORG = "per_org"+ # Fan out over the distinct groups of the organizations (GET /rest/groups/{group_id}/...).+ # Snyk lists groups only on a beta version, so the group ids come from the orgs' ``group_id``.+ PER_GROUP = "per_group"+ # Fan out over every collection of every organization+ # (GET /rest/orgs/{org_id}/collections/{collection_id}/...).+ PER_COLLECTION = "per_collection"@dataclass@@ -56,11 +62,11 @@ def _timestamp_incremental_field(field_name: str) -> IncrementalField:# Endpoint catalog. Coverage mirrors the canonical Snyk streams (org inventory, projects,-# targets, and the high-value issues/findings table).+# targets, and the high-value issues/findings table), plus memberships and collections.## Incremental vs full refresh: only the issues endpoint documents genuine server-side# timestamp filters (``updated_after`` / ``created_after``), so only issues is marked-# incremental. Orgs/projects/targets have no reliable server-side time filter, so they ship+# incremental. The other endpoints have no reliable server-side time filter, so they ship# full refresh and dedupe on their primary key.SNYK_ENDPOINTS: dict[str, SnykEndpointConfig] = {"organizations": SnykEndpointConfig(@@ -81,6 +87,32 @@ SNYK_ENDPOINTS: dict[str, SnykEndpointConfig] = {path="/orgs/{org_id}/targets",primary_keys=["id", "organization_id"],),+ "org_memberships": SnykEndpointConfig(+ name="org_memberships",+ scope=SnykScope.PER_ORG,+ path="/orgs/{org_id}/memberships",+ primary_keys=["id", "organization_id"],+ ),+ "group_memberships": SnykEndpointConfig(+ name="group_memberships",+ scope=SnykScope.PER_GROUP,+ path="/groups/{group_id}/memberships",+ primary_keys=["id", "group_id"],+ ),+ "collections": SnykEndpointConfig(+ name="collections",+ scope=SnykScope.PER_ORG,+ path="/orgs/{org_id}/collections",+ primary_keys=["id", "organization_id"],+ ),+ # One row per project in a collection. A project can be in several collections, so the+ # collection id is part of the key.+ "collection_projects": SnykEndpointConfig(+ name="collection_projects",+ scope=SnykScope.PER_COLLECTION,+ path="/orgs/{org_id}/collections/{collection_id}/relationships/projects",+ primary_keys=["id", "collection_id", "organization_id"],+ ),"issues": SnykEndpointConfig(name="issues",scope=SnykScope.PER_ORG,diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/snyk.py b/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/snyk.pyindex 92537d93d33a..de6fd0f694f2 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/snyk.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/snyk.py@@ -1,5 +1,6 @@import reimport dataclasses+from collections.abc import Callablefrom datetime import UTC, date, datetimefrom typing import Any, Optionalfrom urllib.parse import urlparse@@ -48,6 +49,10 @@ _ORG_ID_RE = re.compile(r"^[a-zA-Z0-9-]+$")# The parent resource name used when fanning out per-org endpoints over every org._PARENT_ORGS = "organizations"_PARENT_ID_KEY = f"_{_PARENT_ORGS}_id"+_PARENT_GROUP_ID_KEY = f"_{_PARENT_ORGS}_group_id"+_PARENT_COLLECTIONS = "collections"+_PARENT_COLLECTION_ID_KEY = f"_{_PARENT_COLLECTIONS}_id"+_PARENT_COLLECTION_ORG_KEY = f"_{_PARENT_COLLECTIONS}_organization_id"@dataclasses.dataclass@@ -276,6 +281,34 @@ def snyk_source(client, endpoint, list_endpoint, _flatten_map, resumable_source_manager, resume, team_id, job_id, None)+ if endpoint_config.scope == SnykScope.PER_GROUP:+ return _build_group_fanout(+ client,+ endpoint,+ endpoint_config.path,+ params,+ resumable_source_manager,+ resume,+ host,+ single_org,+ team_id,+ job_id,+ )++ if endpoint_config.scope == SnykScope.PER_COLLECTION:+ return _build_collection_fanout(+ client,+ endpoint,+ endpoint_config.path,+ params,+ resumable_source_manager,+ resume,+ host,+ single_org,+ team_id,+ job_id,+ )+# PER_ORG endpoints.params.update(_incremental_params(endpoint, should_use_incremental_field, incremental_field))@@ -366,6 +399,32 @@ def _build_simple()+def _orgs_endpoint(host: str, single_org: str | None) -> Endpoint:+ if single_org is not None:+ return {+ "path": f"/orgs/{single_org}",+ "params": {"version": SNYK_REST_VERSION},+ "data_selector": "data",+ "paginator": SinglePagePaginator(),+ }+ return {+ "path": "/orgs",+ "params": {"version": SNYK_REST_VERSION, "limit": SNYK_ENDPOINTS[_PARENT_ORGS].page_size},+ "data_selector": "data",+ "paginator": SnykJSONAPIPaginator(host),+ }+++def _fanout_resume(+ manager: ResumableSourceManager[SnykResumeConfig], resume: SnykResumeConfig | None+) -> tuple[Optional[dict[str, Any]], Callable[[Optional[dict[str, Any]]], None]]:+ def save_checkpoint(state: Optional[dict[str, Any]]) -> None:+ if state is not None:+ manager.save_state(SnykResumeConfig(fanout_state=state))++ return (resume.fanout_state if resume is not None else None), save_checkpoint++def _build_fanout(client: ClientConfig,endpoint: str,@@ -378,15 +437,7 @@ def _build_fanout(job_id: str,db_incremental_field_last_value: Optional[Any],) -> Resource:- parent_resource: EndpointResource = {- "name": _PARENT_ORGS,- "endpoint": {- "path": "/orgs",- "params": {"version": SNYK_REST_VERSION, "limit": SNYK_ENDPOINTS[_PARENT_ORGS].page_size},- "data_selector": "data",- "paginator": SnykJSONAPIPaginator(host),- },- }+ parent_resource: EndpointResource = {"name": _PARENT_ORGS, "endpoint": _orgs_endpoint(host, None)}child_endpoint: Endpoint = {"path": child_path,"params": {**child_params, "org_id": {"type": "resolve", "resource": _PARENT_ORGS, "field": "id"}},@@ -403,11 +454,7 @@ def _build_fanout(# Only the framework's fan-out resume state round-trips here; an old single-collection bookmark# (next_url/org_id without fanout_state) starts fresh and the merge dedupes any re-pulled rows.- initial_state = resume.fanout_state if resume is not None else None-- def save_checkpoint(state: Optional[dict[str, Any]]) -> None:- if state is not None:- manager.save_state(SnykResumeConfig(fanout_state=state))+ initial_state, save_checkpoint = _fanout_resume(manager, resume)resources = rest_api_resources(config,@@ -420,6 +467,160 @@ def _build_fanout(return next(r for r in resources if r.name == endpoint)+def _first_org_of_each_group() -> Callable[[dict[str, Any]], bool]:+ """Keep one org row per group, so each group's endpoint is fetched once.++ Personal orgs have no group and are dropped. The group id goes into a URL path, so a value that+ could alter the path shape is dropped too.+ """+ seen: set[str] = set()++ def _keep(item: dict[str, Any]) -> bool:+ attributes = item.get("attributes")+ group_id = attributes.get("group_id") if isinstance(attributes, dict) else None+ if not isinstance(group_id, str) or not _ORG_ID_RE.match(group_id) or group_id in seen:+ return False+ seen.add(group_id)+ return True++ return _keep+++def _group_child_map(item: dict[str, Any]) -> dict[str, Any]:+ item = _flatten_item(item)+ if _PARENT_GROUP_ID_KEY in item:+ item["group_id"] = item.pop(_PARENT_GROUP_ID_KEY)+ return item+++def _collection_child_map(item: dict[str, Any]) -> dict[str, Any]:+ item = _flatten_item(item)+ if _PARENT_COLLECTION_ID_KEY in item:+ item["collection_id"] = item.pop(_PARENT_COLLECTION_ID_KEY)+ if _PARENT_COLLECTION_ORG_KEY in item:+ item["organization_id"] = item.pop(_PARENT_COLLECTION_ORG_KEY)+ return item+++def _build_group_fanout(+ client: ClientConfig,+ endpoint: str,+ child_path: str,+ child_params: dict[str, Any],+ manager: ResumableSourceManager[SnykResumeConfig],+ resume: SnykResumeConfig | None,+ host: str,+ single_org: str | None,+ team_id: int,+ job_id: str,+) -> Resource:+ # The parent row is flattened before the child reads it, so `group_id` is a root field.+ parent_resource: EndpointResource = {+ "name": _PARENT_ORGS,+ "endpoint": _orgs_endpoint(host, single_org),+ "data_map": _flatten_map,+ }+ child_resource: EndpointResource = {+ "name": endpoint,+ "endpoint": {+ "path": child_path,+ "params": {+ **child_params,+ "group_id": {"type": "resolve", "resource": _PARENT_ORGS, "field": "group_id"},+ },+ "data_selector": "data",+ "paginator": SnykJSONAPIPaginator(host),+ },+ "include_from_parent": ["group_id"],+ "data_map": _group_child_map,+ }+ config: RESTAPIConfig = {"client": client, "resource_defaults": {}, "resources": [parent_resource, child_resource]}+ initial_state, save_checkpoint = _fanout_resume(manager, resume)++ resources = rest_api_resources(+ config,+ team_id,+ job_id,+ None,+ resume_hook=save_checkpoint,+ initial_paginator_state=initial_state,+ )+ next(r for r in resources if r.name == _PARENT_ORGS).add_filter(_first_org_of_each_group())+ return next(r for r in resources if r.name == endpoint)+++def _build_collection_fanout(+ client: ClientConfig,+ endpoint: str,+ child_path: str,+ child_params: dict[str, Any],+ manager: ResumableSourceManager[SnykResumeConfig],+ resume: SnykResumeConfig | None,+ host: str,+ single_org: str | None,+ team_id: int,+ job_id: str,+) -> Resource:+ collections_resource: EndpointResource+ resource_list: list[str | EndpointResource] = []+ if single_org is not None:+ collections_resource = {+ "name": _PARENT_COLLECTIONS,+ "endpoint": {+ "path": SNYK_ENDPOINTS[_PARENT_COLLECTIONS].path.format(org_id=single_org),+ "params": dict(child_params),+ "data_selector": "data",+ "paginator": SnykJSONAPIPaginator(host),+ },+ "data_map": _single_org_flatten_map(single_org),+ }+ else:+ # Two fan-out levels (orgs -> collections -> projects). The framework does not resume a+ # chained fan-out, so an interrupted run starts again and the merge dedupes.+ resource_list.append({"name": _PARENT_ORGS, "endpoint": _orgs_endpoint(host, None)})+ collections_resource = {+ "name": _PARENT_COLLECTIONS,+ "endpoint": {+ "path": SNYK_ENDPOINTS[_PARENT_COLLECTIONS].path,+ "params": {**child_params, "org_id": {"type": "resolve", "resource": _PARENT_ORGS, "field": "id"}},+ "data_selector": "data",+ "paginator": SnykJSONAPIPaginator(host),+ },+ "include_from_parent": ["id"],+ "data_map": _child_flatten_map,+ }+ resource_list.append(collections_resource)+ resource_list.append(+ {+ "name": endpoint,+ "endpoint": {+ "path": child_path,+ "params": {+ **child_params,+ "org_id": {"type": "resolve", "resource": _PARENT_COLLECTIONS, "field": "organization_id"},+ "collection_id": {"type": "resolve", "resource": _PARENT_COLLECTIONS, "field": "id"},+ },+ "data_selector": "data",+ "paginator": SnykJSONAPIPaginator(host),+ },+ "include_from_parent": ["id", "organization_id"],+ "data_map": _collection_child_map,+ }+ )+ config: RESTAPIConfig = {"client": client, "resource_defaults": {}, "resources": resource_list}+ initial_state, save_checkpoint = _fanout_resume(manager, resume)++ resources = rest_api_resources(+ config,+ team_id,+ job_id,+ None,+ resume_hook=save_checkpoint,+ initial_paginator_state=initial_state,+ )+ return next(r for r in resources if r.name == endpoint)++def validate_credentials(region: Optional[str], api_token: str, organization_id: Optional[str] = None) -> tuple[bool, str | None]:diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/source.pyindex 043ad9c1c37c..8606c3c7c308 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/source.py@@ -56,9 +56,9 @@ class SnykSource(ResumableSource[SnykSourceConfig, SnykResumeConfig]):category=DataWarehouseSourceCategory.ENGINEERING___MONITORING,label="Snyk",releaseStatus=ReleaseStatus.GA,- caption="""Connect your Snyk account to sync organizations, projects, targets, and vulnerability issues into the PostHog Data warehouse.+ caption="""Connect your Snyk account to sync organizations, projects, targets, vulnerability issues, memberships, and collections into the PostHog Data warehouse.-Generate an API token from your [Snyk account settings](https://app.snyk.io/account) (or use a service account token from your organization or group settings). The token is sent as `Authorization: token <token>` and can read every organization it has access to.+Generate an API token from your [Snyk account settings](https://app.snyk.io/account) (or use a service account token from your organization or group settings). The token is sent as `Authorization: token <token>` and can read every organization it has access to. The group memberships table needs a token that can view group memberships.Pick the region your Snyk account is hosted on — Snyk's regional stacks are independent and a token only works on its own region.""",iconPath="/static/services/snyk.png",diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/tests/test_snyk.py b/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/tests/test_snyk.pyindex 10fa8f07275c..73aa48b17680 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/tests/test_snyk.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/snyk/tests/test_snyk.py@@ -230,3 +230,108 @@ class TestTokenRedaction:# carried inside the `token <token>` api-key value.redact_values = [value for options in result.session_options for value in options.get("redact_values") or ()]assert any("super-secret-token" in value for value in redact_values)+++def _org(org_id: str, group_id: str | None) -> dict:+ return {"id": org_id, "type": "org", "attributes": {"name": org_id, "group_id": group_id}}+++def _paths(result: DriveResult) -> list[str]:+ return [url.split("?")[0].removeprefix(f"{HOST}/rest") for url in result.urls]+++class TestGroupFanOut:+ def test_fetches_each_group_once_and_skips_orgs_without_a_usable_group(self) -> None:+ result = _run(+ "group_memberships",+ [+ _page([_org("o1", "g1"), _org("o2", "g1"), _org("o3", None), _org("o4", "../g")]),+ _page([{"id": "m1", "attributes": {"created_at": "2026-01-01T00:00:00Z"}}]),+ ],+ )+ assert result.raised is None+ assert _paths(result) == ["/orgs", "/groups/g1/memberships"]+ assert result.rows == [{"id": "m1", "created_at": "2026-01-01T00:00:00Z", "group_id": "g1"}]++ def test_dedupe_spans_org_pages(self) -> None:+ page2 = f"{HOST}/rest/orgs?version={SNYK_REST_VERSION}&limit=100&starting_after=cursor"+ result = _run(+ "group_memberships",+ [+ _page([_org("o1", "g1")], next_link=page2),+ _page([{"id": "m1"}]),+ _page([_org("o2", "g1")]),+ ],+ )+ assert _paths(result) == ["/orgs", "/groups/g1/memberships", "/orgs"]+ assert result.rows == [{"id": "m1", "group_id": "g1"}]++ @parameterized.expand(+ [("grouped_org", "g9", ["/orgs/o9", "/groups/g9/memberships"]), ("personal_org", None, ["/orgs/o9"])]+ )+ def test_configured_org_reads_only_its_own_group(+ self, _name: str, group_id: str | None, expected_paths: list[str]+ ) -> None:+ result = _run(+ "group_memberships",+ [ScriptedResponse(json={"data": _org("o9", group_id)}), _page([{"id": "m1"}])],+ organization_id="o9",+ )+ assert result.raised is None+ assert _paths(result) == expected_paths++ def test_resume_skips_groups_already_synced(self) -> None:+ result = _run(+ "group_memberships",+ [_page([_org("o1", "g1"), _org("o2", "g2")]), _page([{"id": "m2"}])],+ resume_state=SnykResumeConfig(+ fanout_state={"completed": ["/groups/g1/memberships"], "current": None, "child_state": None}+ ),+ )+ assert _paths(result) == ["/orgs", "/groups/g2/memberships"]+ assert result.rows == [{"id": "m2", "group_id": "g2"}]+++class TestCollectionFanOut:+ def test_walks_orgs_then_collections_then_projects(self) -> None:+ projects_page2 = f"{HOST}/rest/orgs/o1/collections/c1/relationships/projects?version={SNYK_REST_VERSION}&limit=100&starting_after=p1"+ result = _run(+ "collection_projects",+ [+ _page([{"id": "o1"}, {"id": "o2"}]),+ _page([{"id": "c1", "attributes": {"name": "Prod"}}]),+ _page([{"id": "p1", "meta": {"issues_high_count": 2}}], next_link=projects_page2),+ _page([{"id": "p2"}]),+ _page([{"id": "c2", "attributes": {"name": "Dev"}}]),+ _page([{"id": "p1"}]),+ ],+ )+ assert result.raised is None+ assert _paths(result) == [+ "/orgs",+ "/orgs/o1/collections",+ "/orgs/o1/collections/c1/relationships/projects",+ "/orgs/o1/collections/c1/relationships/projects",+ "/orgs/o2/collections",+ "/orgs/o2/collections/c2/relationships/projects",+ ]+ # The same project in two collections stays two rows, told apart by collection_id.+ assert result.rows == [+ {"id": "p1", "meta": {"issues_high_count": 2}, "collection_id": "c1", "organization_id": "o1"},+ {"id": "p2", "collection_id": "c1", "organization_id": "o1"},+ {"id": "p1", "collection_id": "c2", "organization_id": "o2"},+ ]++ def test_configured_org_skips_org_enumeration(self) -> None:+ result = _run(+ "collection_projects",+ [_page([{"id": "c1"}, {"id": "c2"}]), _page([{"id": "p1"}]), _page([])],+ organization_id="o9",+ )+ assert result.raised is None+ assert _paths(result) == [+ "/orgs/o9/collections",+ "/orgs/o9/collections/c1/relationships/projects",+ "/orgs/o9/collections/c2/relationships/projects",+ ]+ assert result.rows == [{"id": "p1", "collection_id": "c1", "organization_id": "o9"}]