feat: add API Key and No Auth support for API Gateway targets#514
Merged
feat: add API Key and No Auth support for API Gateway targets#514
Conversation
Contributor
Coverage Report
|
- Add api-gateway-auth wizard step with IAM/API Key/No Auth options - Implement wizard resume pattern: after credential creation, wizard resumes at confirm step with state preserved via initialConfig/initialStep - Fix confirm-step-skip bug for both mcpServer and apiGateway flows - Schema/validation: reject only OAuth for apiGateway, accept API Key and None - Pass outboundAuth through in CLI dispatch and createApiGatewayTarget - Narrow ApiGatewayTargetConfig.outboundAuth.type to 'API_KEY' | 'NONE' - Add 3 new validation tests
Rename oauthCredentials to allCredentials in useCdkPreflight and useDeployFlow — the TUI deploy path was only passing OAuth credentials to buildDeployedState, silently dropping API key credential ARNs. The CDK construct needs these ARNs to wire API key credentials to gateway targets.
bf4f45d to
2c9c823
Compare
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.
Description
Add API Key and No Auth support for API Gateway targets, plus fix the confirm-step-skip bug for credential creation flows.
Auth Types
API Gateway targets now support three authorization modes in both the TUI wizard and CLI:
outboundAuth— CDK usesGATEWAY_IAM_ROLEoutboundAuth: { type: 'API_KEY', credentialName: '...' }— shows existing API key credentials + "Create new" optionoutboundAuth: { type: 'NONE' }— CDK falls back toGATEWAY_IAM_ROLEWizard Resume Pattern
After credential creation (via AddIdentityScreen), the wizard now resumes at the confirm step with state preserved — instead of skipping confirm and creating the target immediately. This fixes a pre-existing UX issue that affected both mcpServer (OAuth) and apiGateway (API Key) flows. Implemented via
initialConfig/initialStepprops on the wizard hook and screen.Deploy Pipeline Fix
The TUI deploy path (
useCdkPreflight→useDeployFlow) was only passing OAuth credential ARNs tobuildDeployedState, silently dropping API key credential ARNs. RenamedoauthCredentials→allCredentialsand ensured the combined credentials object (API key + OAuth) is passed through.Changes by file
mcp.ts(schema): Reject only OAuth for apiGateway (was rejecting all outboundAuth)validate.ts: Accept--outbound-auth api-key(with--credential-name) andnone, rejectoauthvalidate.test.ts: 3 new tests replacing 1 blanket rejection testGatewayTargetPrimitive.ts: Addapi_keyto outboundAuthMap, pass outboundAuth in apiGateway CLI dispatch andcreateApiGatewayTargettypes.ts: Addapi-gateway-authstep,API_GATEWAY_AUTH_OPTIONS,outboundAuthonApiGatewayTargetConfig(narrowed to'API_KEY' | 'NONE')useAddGatewayTargetWizard.ts: AcceptinitialConfig/initialStep, addapi-gateway-authto step sequence, addsetApiGatewayAuthsetterAddGatewayTargetScreen.tsx: Auth step UI (WizardSelect + credential list),initialConfig/initialStep/existingApiKeyCredentialNamesprops, confirm narrowing includes outboundAuth, ConfirmReview shows "IAM (default)" when no auth selectedAddGatewayTargetFlow.tsx:resumeConfig/resumeStepon FlowState,apiKeyCredentialNames, resume wizard after credential creation, conditionalinitialTypefor identity screenuseCdkPreflight.ts: RenameoauthCredentials→allCredentials, set to combined credentialsuseDeployFlow.ts: RenameoauthCredentials→allCredentialsRelated Issues
Companion to CDK PR:
feat/api-gateway-authon agentcore-l3-cdk-constructsType of Change
Testing
How have you tested the change?
npx tsc --noEmit)deployed-state.jsoncorrectly persists API key credential ARNs after deployChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.