feat(identity): add directory resource support - #1433
Draft
rspurgeon wants to merge 6 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Kong Identity directory support to kongctl, wiring it through declarative workflows and Konnect CLI commands, alongside the necessary SDK/model updates and test/docs coverage.
Changes:
- Introduces
identity.directoriesas a new top-level declarative resource group, including validation, planning/sync scoping, protection lookup, and Konnect state client wiring. - Adds Konnect CLI support for identity directories (
get/list/adopt) and integrates identity directories into dump/navigator selection paths. - Expands E2E/integration coverage and adds declarative examples; also improves E2E
reset-orgoutput with a deletion summary.
Reviewed changes
Copilot reviewed 222 out of 223 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/integration/declarative/sdk_helper_test.go | Formatting adjustment for multi-line error construction. |
| test/integration/declarative/error_scenarios_test.go | Formatting adjustments in mock Return() calls. |
| test/integration/declarative/api_test.go | Updates API implementation service reference field name (SDK model change). |
| test/e2e/scenarios/identity/directories/testdata/sync.yaml | Adds identity directories sync scenario test data. |
| test/e2e/scenarios/identity/directories/testdata/initial.yaml | Adds identity directories initial scenario test data. |
| test/e2e/harness/step.go | Adds create endpoints for identity directories in the E2E harness. |
| test/e2e/harness/reset_test.go | Adds tests for reset deletion summary output; minor formatting changes. |
| test/e2e/harness/cmd/reset-org/main.go | Switches reset-org to summary-returning helpers and prints deletion summary. |
| test/e2e/extensions_test.go | Formatting adjustment in JSON decode fatal output. |
| pkg/sdk/context.go | Ensures output.jq is always included when marshaling OutputContext. |
| internal/processes/redact_test.go | Formatting adjustment to require.Equal call. |
| internal/lint/lint.go | Formatting adjustment to fmt.Fprintf call. |
| internal/konnect/httpclient/retrying_client.go | Formatting-only changes in logging/append calls. |
| internal/konnect/httpclient/retrying_client_test.go | Formatting adjustments in http.NewRequestWithContext calls. |
| internal/konnect/httpclient/logging.go | Formatting adjustment in attrs append. |
| internal/konnect/helpers/sdk.go | Adds IdentityDirectory API accessor to SDK wrapper. |
| internal/konnect/helpers/sdk_mock.go | Adds IdentityDirectory API accessor to mock SDK. |
| internal/konnect/helpers/portal_identity_providers.go | Converts create request types and rejects unsupported login_path. |
| internal/konnect/helpers/portal_identity_providers_test.go | Updates tests for portal identity provider response/model changes + login_path rejection. |
| internal/konnect/helpers/portal_customizations.go | Updates PortalCustomization request type to PortalCustomizationV3. |
| internal/konnect/helpers/identity_directories.go | Adds IdentityDirectory API wrapper over sdk-konnect-go directories endpoints. |
| internal/konnect/helpers/event_gateway_tls_trust_bundles.go | SDK call signature formatting update. |
| internal/konnect/helpers/event_gateway_static_keys.go | SDK call signature formatting update. |
| internal/konnect/helpers/event_gateway_schema_registries.go | SDK call signature formatting update. |
| internal/konnect/helpers/event_gateway_produce_policies.go | SDK call signature formatting update. |
| internal/konnect/helpers/event_gateway_data_plane_certificates.go | SDK call signature formatting update. |
| internal/konnect/helpers/event_gateway_consume_policies.go | SDK call signature formatting update. |
| internal/konnect/helpers/event_gateway_cluster_policies.go | SDK call signature formatting update. |
| internal/konnect/helpers/control_planes.go | Updates ControlPlane filter name model type (SDK model change). |
| internal/konnect/helpers/app_auth_strategies.go | Minor arithmetic simplification (page check). |
| internal/extensions/runtime.go | Keeps extension runtime OutputContext jq always marshaled; continues building defaults. |
| internal/extensions/runtime_test.go | Formatting adjustment to require.Equal call. |
| internal/extensions/compatibility.go | Formatting adjustments for multi-line fmt.Errorf calls. |
| internal/declarative/validator/namespace_validator.go | Includes identity directories in namespace requirement validation and parent count. |
| internal/declarative/state/client_test.go | Adds tests for portal identity provider login_path rejection and nil list response handling. |
| internal/declarative/state/client_pagination_test.go | Updates portal team role region enum (SDK model change). |
| internal/declarative/resources/types.go | Adds identity resource grouping and identity directory resource set helpers/constants. |
| internal/declarative/resources/portal_customization.go | Updates embedded customization type to PortalCustomizationV3. |
| internal/declarative/resources/identity_test.go | Adds unit tests for identity directory TTL validation bounds. |
| internal/declarative/resources/event_gateway_listener_policy.go | Formatting adjustment to error construction. |
| internal/declarative/resources/catalog_service.go | Adds explicit YAML/JSON unmarshaling for catalog services (SDK JSON-tag-only type). |
| internal/declarative/resources/api_implementation.go | Updates API implementation service reference field name (SDK model change). |
| internal/declarative/resources/api_implementation_marshal_test.go | Updates marshaling test for service reference model change. |
| internal/declarative/protection/lookup.go | Adds protection label lookup support for identity directories. |
| internal/declarative/planner/sync_scope.go | Adds identity directories to planner sync scope roots. |
| internal/declarative/planner/resolver.go | Resolves references under allowed_control_planes.* as control plane refs. |
| internal/declarative/planner/portal_planner.go | Formatting-only logger/warning call adjustments. |
| internal/declarative/planner/portal_external_child_deletes_test.go | Updates portal assigned role region enum type (SDK model change). |
| internal/declarative/planner/portal_child_planner.go | Updates portal customization type and mode enum (SDK model change). |
| internal/declarative/planner/organization_team_planner.go | Formatting adjustment for warning construction. |
| internal/declarative/planner/organization_team_planner_test.go | Updates enum/pointer helpers in tests (SDK model changes). |
| internal/declarative/planner/interfaces.go | Adds IdentityDirectoryPlanner interface marker. |
| internal/declarative/planner/event_gateway_tls_trust_bundle_planner.go | Formatting-only logger call adjustments. |
| internal/declarative/planner/event_gateway_static_key_planner.go | Formatting-only logger call adjustments. |
| internal/declarative/planner/event_gateway_schema_registry_planner.go | Formatting-only logger call adjustments. |
| internal/declarative/planner/event_gateway_consume_policy_planner_test.go | Updates consume policy config constructor usage (SDK model change). |
| internal/declarative/planner/event_gateway_cluster_policy_planner_test.go | Updates ACL policy enums (SDK model change). |
| internal/declarative/planner/egw_control_plane_planner.go | Formatting adjustment for warning construction. |
| internal/declarative/planner/deck_requirements.go | Formatting-only logging/error wrapping adjustments. |
| internal/declarative/planner/deck_requirements_test.go | Updates API implementation service reference types (SDK model change). |
| internal/declarative/planner/dashboard_planner.go | Formatting adjustment for warning construction. |
| internal/declarative/planner/control_plane_planner.go | Formatting adjustment for warning construction. |
| internal/declarative/planner/control_plane_planner_test.go | Updates control plane config model type (SDK model change). |
| internal/declarative/planner/control_plane_data_plane_certificate_planner.go | Formatting-only logger call adjustments. |
| internal/declarative/planner/control_plane_data_plane_certificate_planner_test.go | Updates control plane config model type (SDK model change). |
| internal/declarative/planner/constants.go | Adds planner field constants for identity directory fields + resource type string constant. |
| internal/declarative/planner/catalog_service_planner.go | Formatting adjustment for warning construction. |
| internal/declarative/planner/base_planner.go | Adds base planner accessor for desired identity directories by namespace. |
| internal/declarative/planner/auth_strategy_planner.go | Formatting-only adjustments in warnings/logging and field error construction. |
| internal/declarative/planner/api_planner.go | Updates API implementation service reference field name (SDK model change). |
| internal/declarative/loader/validator.go | Adds identity directory validation and reference validation hook. |
| internal/declarative/loader/validator_test.go | Updates API implementation service reference types (SDK model change). |
| internal/declarative/loader/sync_scope.go | Captures identity.directories root in sync-scope detection. |
| internal/declarative/loader/loader.go | Applies namespace defaults to identity directories and extracts nested identity resources. |
| internal/declarative/loader/loader_test.go | Adds loader test for identity directory TTL minimum validation. |
| internal/declarative/executor/portal_team_role_adapter.go | Formatting-only logger call adjustment. |
| internal/declarative/executor/portal_integration_adapter.go | Formatting-only logger call adjustment. |
| internal/declarative/executor/portal_identity_provider_adapter_test.go | Updates portal identity provider response/model names (SDK model change). |
| internal/declarative/executor/portal_customization_adapter.go | Updates customization types/mode and visibility enum types (SDK model change). |
| internal/declarative/executor/portal_customization_adapter_test.go | Updates tests for customization v3 + visibility enum type changes. |
| internal/declarative/executor/portal_child_operations.go | Updates customization build/update types and enums (SDK model change). |
| internal/declarative/executor/organization_team_role_adapter.go | Formatting-only logger call adjustment. |
| internal/declarative/executor/event_gateway_virtual_cluster_adapter.go | Updates virtual cluster namespace mode enum type (SDK model change). |
| internal/declarative/executor/event_gateway_backend_cluster_adapter.go | Updates SASL algorithm enum type (SDK model change). |
| internal/declarative/executor/deck_execution.go | Formatting-only logger/error wrapping adjustments. |
| internal/declarative/executor/api_implementation_adapter.go | Updates API implementation service reference model field/type (SDK model change). |
| internal/cmd/root/verbs/view/view.go | Formatting-only flag declaration wrapping. |
| internal/cmd/root/verbs/listen/listen.go | Formatting-only flag declaration wrapping. |
| internal/cmd/root/verbs/listen/auditlogs.go | Formatting-only flag declaration wrapping. |
| internal/cmd/root/verbs/list/themes.go | Formatting-only table rendering / fmt.Sprintf wrapping. |
| internal/cmd/root/verbs/list/portal.go | Formatting-only flag/help wrapping. |
| internal/cmd/root/verbs/list/organization.go | Formatting-only flag/help wrapping. |
| internal/cmd/root/verbs/list/list.go | Formatting-only flag/help wrapping. |
| internal/cmd/root/verbs/list/dcrprovider.go | Formatting-only flag/help wrapping. |
| internal/cmd/root/verbs/list/authstrategy.go | Formatting-only flag/help wrapping. |
| internal/cmd/root/verbs/list/api.go | Formatting-only flag/help wrapping. |
| internal/cmd/root/verbs/install/skills_test.go | Formatting-only os.WriteFile call wrapping. |
| internal/cmd/root/verbs/get/regions.go | Formatting-only flag declaration wrapping. |
| internal/cmd/root/verbs/get/portal.go | Formatting-only flag/help wrapping. |
| internal/cmd/root/verbs/get/me.go | Formatting-only flag declaration wrapping. |
| internal/cmd/root/verbs/get/get.go | Formatting-only flag/help wrapping. |
| internal/cmd/root/verbs/get/eventgateway.go | Formatting-only flag/help wrapping. |
| internal/cmd/root/verbs/get/dcrprovider.go | Formatting-only flag/help wrapping. |
| internal/cmd/root/verbs/get/catalog.go | Formatting-only flag/help wrapping. |
| internal/cmd/root/verbs/get/authstrategy.go | Updates filter param type; formatting-only in render calls and enum casts. |
| internal/cmd/root/verbs/get/auditlogs.go | Formatting-only flag/help wrapping. |
| internal/cmd/root/verbs/get/api.go | Formatting-only flag/help wrapping. |
| internal/cmd/root/verbs/get/analytics.go | Formatting-only flag/help wrapping. |
| internal/cmd/root/verbs/extensions/extensions.go | Formatting-only fmt.Fprintf calls. |
| internal/cmd/root/verbs/dump/tfimport.go | Updates filter param types and control plane name filter model type (SDK model change). |
| internal/cmd/root/verbs/dump/declarative_children.go | Updates dumped portal customization and API implementation models (SDK model change). |
| internal/cmd/root/verbs/dump/declarative_children_test.go | Updates dumped portal identity provider models (SDK model change). |
| internal/cmd/root/verbs/dump/common.go | Adds identity.directories dump resource selector + aliases mapping. |
| internal/cmd/root/verbs/del/del.go | Formatting-only flag declaration wrapping. |
| internal/cmd/root/verbs/create/create.go | Formatting-only flag declaration wrapping. |
| internal/cmd/root/verbs/api/api.go | Formatting-only flag declaration wrapping. |
| internal/cmd/root/verbs/adopt/direct.go | Formatting-only flag declaration wrapping. |
| internal/cmd/root/products/konnect/token/token.go | Formatting-only variadic arg wrapping. |
| internal/cmd/root/products/konnect/regions/getRegions.go | Formatting-only table rendering call wrapping. |
| internal/cmd/root/products/konnect/portal/teams.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/portal/team_roles.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/portal/snippets.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/portal/portal.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/portal/pages.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/portal/interactive_children.go | Updates portal identity providers list field name (SDK model change). |
| internal/cmd/root/products/konnect/portal/identity_providers_test.go | Updates portal identity provider models/config enums (SDK model change). |
| internal/cmd/root/products/konnect/portal/getPortal.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/portal/email_domains.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/portal/developers.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/portal/developer_teams.go | Formatting-only examples/table render wrapping + variadic attrs wrapping. |
| internal/cmd/root/products/konnect/portal/deletePortal.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/portal/auth_settings.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/portal/assets.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/portal/applications.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/portal/applications_delete.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/portal/application_registrations.go | Formatting-only examples/table render wrapping + variadic attrs wrapping. |
| internal/cmd/root/products/konnect/portal/application_registrations_delete.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/organization/user/user_roles.go | Formatting-only table render wrapping. |
| internal/cmd/root/products/konnect/organization/user/user_roles_test.go | Updates enums/pointer helpers in tests (SDK model change). |
| internal/cmd/root/products/konnect/organization/user/getUser.go | Formatting-only table render wrapping. |
| internal/cmd/root/products/konnect/organization/team/team_roles.go | Formatting-only table render wrapping. |
| internal/cmd/root/products/konnect/organization/team/getTeam.go | Formatting-only table render wrapping. |
| internal/cmd/root/products/konnect/organization/systemaccount/getSystemAccount.go | Formatting-only table render wrapping. |
| internal/cmd/root/products/konnect/organization/systemaccount/assignments.go | Formatting-only table render wrapping. |
| internal/cmd/root/products/konnect/organization/organization.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/navigator/dump_action.go | Adds identity directories to navigator dump resource mappings. |
| internal/cmd/root/products/konnect/me/me.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/me/getMe.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/logoutKonnect.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/konnect.go | Adds identity command to konnect product command tree for adopt and standard verbs. |
| internal/cmd/root/products/konnect/identity/identity.go | Adds new konnect identity command group scaffold (directories for get/list/adopt). |
| internal/cmd/root/products/konnect/identity/identity_test.go | Adds tests for directory command aliases/detail output/adopt labels behavior. |
| internal/cmd/root/products/konnect/gateway/service/getService.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/gateway/route/getRoute.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/gateway/flags.go | Formatting-only flag/help wrapping. |
| internal/cmd/root/products/konnect/gateway/controlplane/helm_output_test.go | Updates control plane config model type in tests (SDK model change). |
| internal/cmd/root/products/konnect/gateway/controlplane/getControlPlane.go | Updates control plane name filter model type; formatting-only table render wrapping. |
| internal/cmd/root/products/konnect/gateway/controlplane/getControlPlane_test.go | Updates control plane config model type in tests (SDK model change). |
| internal/cmd/root/products/konnect/gateway/controlplane/createControlPlane.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/gateway/controlplane/controlplane.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/gateway/consumer/getConsumer.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/eventgateway/virtual_clusters.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/eventgateway/tls_trust_bundles.go | Formatting-only examples + error wrapping style. |
| internal/cmd/root/products/konnect/eventgateway/static_keys.go | Formatting-only examples + error wrapping style. |
| internal/cmd/root/products/konnect/eventgateway/schema_registries.go | Formatting-only examples + variadic attrs wrapping. |
| internal/cmd/root/products/konnect/eventgateway/produce-policies.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/eventgateway/listeners.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/eventgateway/listener-policies.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/eventgateway/getEventGateway.go | Formatting + variadic attrs wrapping; minor i18n call formatting. |
| internal/cmd/root/products/konnect/eventgateway/data_plane_certificates.go | Formatting-only examples + variadic attrs wrapping. |
| internal/cmd/root/products/konnect/eventgateway/consume-policies.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/eventgateway/cluster-policies.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/eventgateway/backend_clusters.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/declarative/declarative.go | Wires identity directory API into declarative state client construction. |
| internal/cmd/root/products/konnect/dcrprovider/getDCRProvider.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/dcrprovider/dcrprovider.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/common/view_identifiers.go | Adds identity directory view parent and navigator selector identifiers. |
| internal/cmd/root/products/konnect/authstrategy/getAuthStrategy.go | Updates filter param types + formatting-only render wrapping. |
| internal/cmd/root/products/konnect/authstrategy/authstrategy.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/auditlogs/tail_stream.go | Formatting-only variadic arg wrapping. |
| internal/cmd/root/products/konnect/auditlogs/listen_test.go | Formatting-only require.Equal wrapping. |
| internal/cmd/root/products/konnect/auditlogs/create_destination.go | Formatting-only multiline call wrapping. |
| internal/cmd/root/products/konnect/api/versions.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/api/publications.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/api/implementations.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/api/getAPI.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/api/documents.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/api/attributes.go | Formatting-only examples/table render wrapping. |
| internal/cmd/root/products/konnect/api/api.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/analytics/dashboards.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/analytics/dashboards_test.go | Uses slices.Contains helper (Go 1.21+ style). |
| internal/cmd/root/products/konnect/analytics/analytics.go | Formatting-only examples wrapping. |
| internal/cmd/root/products/konnect/adopt/analytics.go | Formatting-only examples wrapping. |
| go.sum | Updates checksums for replaced Konnect SDK module target. |
| go.mod | Bumps sdk-konnect-go version and adds replace to sdk-konnect-go-internal. |
| docs/examples/declarative/identity/README.md | Adds identity declarative examples README and usage notes. |
| docs/examples/declarative/identity/directory-with-control-plane-ref.yaml | Adds declarative example for restricted directory using !ref control plane. |
| docs/examples/declarative/identity/directories.yaml | Adds declarative example for unrestricted directory. |
Comment on lines
+51
to
+55
| func (a *IdentityDirectoryAPIImpl) ListKongDirectories( | ||
| ctx context.Context, | ||
| page *kkComps.CursorPageParameters, | ||
| sort *string, | ||
| opts ...kkOps.Option, |
rspurgeon
force-pushed
the
gh-1414-ki-directory
branch
2 times, most recently
from
July 1, 2026 21:08
e4a21a5 to
4e97443
Compare
rspurgeon
force-pushed
the
gh-1414-ki-directory
branch
from
July 1, 2026 21:21
4e97443 to
0d4d224
Compare
rspurgeon
marked this pull request as draft
July 2, 2026 19:42
tapheret2
reviewed
Jul 15, 2026
tapheret2
left a comment
There was a problem hiding this comment.
Review: feat(identity): add directory resource support
Files: docs/examples/declarative/identity/README.md, docs/examples/declarative/identity/directories.yaml, docs/examples/declarative/identity/directory-with-control-plane-ref.yaml, go.mod, go.sum (+82)
Size: +5294 / -131
Notes
- Tests/fixtures present — good signal for correctness.
Thanks @rspurgeon — independent review on the patch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
get/list/adopt identity directory|directoriesCLI supportCloses #1414
Testing
make buildmake testgo test -tags e2e ./test/e2e/harness ./test/e2e/harness/scenario./kongctl plan -f docs/examples/declarative/identity/directories.yaml --mode apply./kongctl plan -f docs/examples/declarative/identity/directory-with-control-plane-ref.yaml --mode applyNotes
make lintstill fails on existing generated/mock findings outside this feature, includingtest/e2e/harness/portalclient/portal_api.gen.go,internal/cmd/helper_mock.go, andinternal/konnect/helpers/controlplaneapi_mock.go.