Skip to content

feat(payment): add connector credential rotation - #2343

Draft
aidandaly24 wants to merge 3 commits into
aws:refactorfrom
aidandaly24:feat/payment-connector-rotate-credentials
Draft

aidandaly24 wants to merge 3 commits into
aws:refactorfrom
aidandaly24:feat/payment-connector-rotate-credentials

Conversation

@aidandaly24

Copy link
Copy Markdown
Contributor

Draft: blocked on SDK publication. The current SDK does not expose rotation, so this branch
cannot typecheck or start the CLI. See the dependency and validation details below.

Summary

Adds one headless command:

agentcore payment connector rotate-credentials \
  --manager-id "$MANAGER_ID" \
  --connector-id "$CONNECTOR_ID" \
  --secrets API_KEY WALLET_SECRET
  • Requires an explicit selection of API_KEY, WALLET_SECRET, or both.
  • Supports an optional client token and the existing region, endpoint, credentials, and JSON behavior.
  • Uses the existing Handler -> CorePaymentClient -> PaymentClient -> injected control SDK path.
  • Extends the existing payment command tests; adds no fixture framework or duplicate Core suite.
  • Documents Quick Create eligibility and non-atomic wallet-secret rotation behavior.

This targets refactor after #2276 merged. It does not include the parked CUD PRs or TUI work.
No IAM provisioning, OAuth wizard, polling, custom retries, or custom signing is added.

Blocking SDK Dependency

Draft only. Do not merge: this branch currently cannot typecheck or start the CLI.

The verified operation contract requires the following SDK exports, which are absent from both
the lockfile SDK and the latest published control-plane SDK checked, 3.1136.0:

  • RotatePaymentConnectorCredentialsCommand
  • RotatePaymentConnectorCredentialsRequest
  • RotatePaymentConnectorCredentialsResponse
  • CoinbaseCdpSecret

The implementation uses those expected generated exports directly. There is no invented version pin,
vendored SDK, declaration patch, or compatibility shim. The SDK version and lockfile update remain
pending until a release containing the operation is available.

Validation

Baseline at a23e4729:

  • Build, typecheck, and formatting passed.
  • All 41 existing payment/provider tests passed.
  • Before implementation, the extended command test file had 24 passes and eight expected failures
    for the missing rotation command/tree entry.

Current draft:

  • Formatting, lint, secret scan, git diff --check, and bundling pass.
  • Typecheck fails with seven missing-SDK-export errors.
  • Payment/provider tests fail during module loading; the new cases cannot yet execute.
  • Built CLI help fails at startup because the SDK exports are unavailable. Bundling alone is not
    runtime validation because the SDK is external to the bundle.
  • Full-suite and gamma validation have not been completed.
  • No credentials were rotated and no AWS resources were changed.

Before Ready For Review

  • Pin a published SDK containing the operation and update the lockfile.
  • Verify generated names/shapes against the modeled request and response.
  • Pass typecheck, payment/provider tests, the full suite, build, and built-CLI smoke tests.
  • Validate gamma with an approved Quick Create test connector: API key only, wallet secret only,
    both, token replay, and actual post-rotation credential usability.

@github-actions github-actions Bot added the size/m PR size: M label Sep 18, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress and removed agentcore-harness-reviewing AgentCore Harness review in progress labels Sep 18, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 18, 2026
@aidandaly24 aidandaly24 reopened this Sep 21, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 21, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress labels Sep 21, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 21, 2026

@agentcore-devx-automation agentcore-devx-automation Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AgentCore Harness Review

Verdict: Looks good

Small, additive change that fits cleanly with the existing payment connector command family:

  • Handler mirrors the shape of the sibling get/list commands, and mocks at the AWS SDK client boundary (no over-mocking).
  • Zod validation covers the enum values, minimum selection, and duplicate rejection — the negative tests exercise all three.
  • Both single-secret and combined-secret paths are covered, plus error propagation.
  • Docs call out the non-atomicity and wallet-secret disruption risk, which is the right place to surface it for a command that has no TUI confirmation step.

Minor observations (non-blocking, author's call):

  • The test lives in payment.read.test.tsx but rotation is a mutating call; if you care about the naming split you may want to move the new cases into a payment.write.test.tsx (or rename the file). Not required.
  • No telemetry instrumentation, but the sibling read commands don't emit any either — consistent with the current payment surface.

Nothing here needs to change before merging.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Sep 21, 2026
@aidandaly24
aidandaly24 marked this pull request as ready for review September 21, 2026 22:49
@aidandaly24
aidandaly24 marked this pull request as draft September 21, 2026 22:49

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant