E2E: expand default_application_auth_strategy scenario to cover update and removal lifecycle#700
Draft
E2E: expand default_application_auth_strategy scenario to cover update and removal lifecycle#700
Conversation
7 tasks
…emove/sync-delete steps - Add steps 002-005 to the e2e scenario to cover get portal verification, update to a second auth strategy, removal of the auth strategy link, and sync-delete lifecycle - Add testdata/app-auth-strategy-2.yaml (second key-auth strategy) - Add overlay directories for steps 003, 004, and 005 - Implement ClearPortalDefaultAuthStrategyID in PortalAPI to send explicit JSON null via raw PATCH (SDK omitempty cannot express null) - Add ClearDefaultAuthStrategyID sentinel in portal planner so absent default_application_auth_strategy_id in desired config triggers an UPDATE - Wire the new clear method through state.Client and executor - Update all PortalAPI mocks with the new method Agent-Logs-Url: https://github.com/Kong/kongctl/sessions/eaad5a86-d450-4127-babc-55f449daa1cc Co-authored-by: rspurgeon <10521262+rspurgeon@users.noreply.github.com>
…omment clarity Agent-Logs-Url: https://github.com/Kong/kongctl/sessions/eaad5a86-d450-4127-babc-55f449daa1cc Co-authored-by: rspurgeon <10521262+rspurgeon@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Expand default_application_auth_strategy scenario for update and removal
feat(e2e): expand default_application_auth_strategy scenario to cover update and removal lifecycle
Mar 30, 2026
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.
The existing scenario only covered CREATE + idempotency for
default_application_auth_strategy_id, leaving UPDATE, REMOVE, and sync-DELETE paths completely untested — including the!refcross-resource reference resolution in the portal planner.New e2e scenario steps
get portalafter initial apply; assertsdefault_application_auth_strategy_idis a 36-char UUID!ref apikey-app-auth-strategy-2#id; plan/apply/get-portal + idempotencydefault_application_auth_strategy_idfrom portal YAML; plan showsUPDATE, apply clears the field, get-portal asserts null + idempotencyDELETEfor both, then verifies 0 changes on re-planNew fixtures:
testdata/app-auth-strategy-2.yamland overlay dirs003–005.Implementation: clear
default_application_auth_strategy_id(previously unsupported)Step 004 required a new capability — the SDK's
UpdatePortalstruct usesomitempty, so it cannot express explicit JSONnull. Two changes make this work:Planner (
portal_planner.go): whendesired.DefaultApplicationAuthStrategyID == nilbut current portal has it set, plan anUPDATEwith the sentinel valueClearDefaultAuthStrategyID = "$clear-default-auth-strategy".Executor (
portal_operations.go): when the sentinel is detected, skip setting the SDK field and after theUpdatePortalcall, invokeClearPortalDefaultAuthStrategyID.New
PortalAPImethod (helpers/portals.go): bypasses the SDK and sends a raw PATCH:PortalAPIImplnow storesBaseURLandBearerToken(populated viaKonnectSDKfrom the existing factory) to construct the authenticated raw request.All four
PortalAPImock implementations updated accordingly.