feat(project): add payment resources - #2120
Conversation
|
Claude Security Review: no high-confidence findings. (run) |
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
Nice work — the schema variants for manual vs. Quick Create are cleanly modeled, the L3 wiring in cdk-stack.ts narrows the union correctly, and the tests exercise the real filesystem instead of mocking fs (👍 per the harness guidance). A couple of small things to consider but nothing blocking:
-
src/assets/cdk/test/cdk.test.tsL7–L16:beforeAll/afterAlloperate onjoin(process.cwd(), 'agentcore'). ThemkdirSync(..., { recursive: true })won't fail if the directory already exists, andwriteFileSync(..., '{}')will overwrite any existingagentcore.json;afterAllthenrmSyncs the whole directory. If a developer ever runs this test from a real project root (or the vended CDK asset lands somewhere that already has anagentcore/), it would silently clobber real data. Consider usingmkdtempSync(orfs.mkdtempinos.tmpdir()) and pointing the L3 at it, similar to whatpayment-test-support.tsdoes. Non-blocking, but easy hardening. -
src/projectSchemas/project.tsL243–L258: the new credential env-var normalization check applies to all credential types, not just payment credentials. It's the right rule, but it's a project-wide validation change that could reject previously-accepted specs (e.g.service-key+service_key). Worth calling out in the PR description / release notes so it isn't a surprise on upgrade. -
src/projectSchemas/payment.tsL64–L69:defaultSpendLimit's refinement isNumber.isFinite(Number(value)) && Number(value) >= 0.Number("")andNumber(" ")both coerce to 0, so empty/whitespace strings slip through. A quickvalue.trim().length > 0 && ...would tighten it.
Telemetry: the sibling add handlers (gateway, api-key, oauth) don't instrument either, so the new payment handlers are consistent with existing patterns — no action needed here.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #2120 +/- ##
============================================
+ Coverage 97.41% 97.45% +0.04%
============================================
Files 453 457 +4
Lines 27637 28085 +448
============================================
+ Hits 26922 27370 +448
Misses 715 715 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| paymentToolAllowlist?: string[]; | ||
| networkPreferences?: string[]; | ||
| connectors: { name: string; provider?: string; credentialName: string }[]; | ||
| connectors: { |
There was a problem hiding this comment.
This Schema change is already on main, but wasn't done in the fork.
|
Claude Security Review: no high-confidence findings. (run) |
|
Claude Security Review: no high-confidence findings. (run) |
|
Claude Security Review: no high-confidence findings. (run) |
|
Claude Security Review: no high-confidence findings. (run) |
|
Claude Security Review: no high-confidence findings. (run) |
Summary
Adds project-based Payments resource authoring:
Payment credentials are reusable project resources under
credentials[]. Manualconnectors can reference an existing payment credential or atomically create one:
Quick Create is a connector-only mode and creates no
credentials[]entry:The change:
main;@aws/agentcore-cdk@0.1.0-alpha.45to publishedalpha.49;Payment credential secret collection and service-side provisioning remain outside
these project authoring commands. Manual connector deployment continues to consume
credential provider ARNs from target deployed state.
L3 Compatibility
Published L3
0.1.0-alpha.49contains Quick Create support fromaws/agentcore-l3-cdk-constructs#324. New generated projects pass the current
connectorschema intoAgentCorePaymentConnector.aws/agentcore-l3-cdk-constructs#341 has also merged to preserve legacy generated
connector props once a newer L3 version is published.
Testing
Latest review-fix verification on PR head
5a166827:bun test src: 2,155 passed;bun run typecheck;bun run format:check;bun run lint:check;bun run secrets:check;bun run build.Generated CDK package, tested independently with published
alpha.49:npm run build;npm test -- --runInBand: 3 passed;npm run format:check;and collision-safe construct identities.
Fresh refactor project
A project created by this branch's built CLI:
alpha.49dependency and Quick Create adapter;agentcore project build;ProvisionMode: QUICK_CREATEwithCredentialProviderConfigurations: [];agentcore project deploy;CREATE_COMPLETE;PENDING_AUTHENTICATIONstatus, and authorization URL;Cross-version payment matrix
An old-CLI scaffold was populated exclusively through the new project commands,
then validated and deployed by released CLI
0.28.0.Verified:
READY;verified absent.
Scope
This PR does not add imperative Payments commands, TUI screens, or payment
credential deployment orchestration.