Repository navigation
feat(compat): keep v0 credential provider names - #2579
Conversation
|
Claude Security Review: no high-confidence findings. (run) |
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
The core change is small and well-scoped: providerName returns the bare credential name when project.legacy is set, and createCredentialRemover short-circuits the delete for v0 API-key/OAuth providers while still removing payment providers (matching v0's own teardown).
Things I checked that look correct:
providerNameis only called from the two sites in this file (createCredentialProvisionerandcreateCredentialRemover); no other callers rely on the old(projectName, targetName, credentialName)signature.rollbackonly deletes providers added tocreatedon this run, so a reused existing v0 provider ({ reuse: ... }branch inresolveApiKey/resolveOauth2) is never touched by rollback — matching the "reuses the provider v0 created when no secret is available locally" test.orphanedCredentialskeys are spec names, which flow intoproviderName(project, ...)in the remover and resolve to the bare name for v0, consistent with how the provisioner records them.- The teardown path in
cdk.ts(providers: [...orphaned, ...project.spec.credentials]) also goes throughcreateCredentialRemover, so v0 API-key/OAuth providers are correctly preserved on teardown too; only payment providers get removed. - Tests use real temp dirs + a fake Identity client as an in-memory account — appropriate boundary, no excessive mocking.
- No telemetry gap: this is a provisioning-level compat tweak, not a new user-facing surface.
One behavior worth flagging in the PR description (not a code change): with the bare-name scheme, two v0 projects that declare the same payment credential name in the same account/region will fight over that provider on deploy, and either project's teardown will delete it out from under the other. The code comment acknowledges this is intentional parity with v0, but it's a sharp edge worth calling out to reviewers/users.
No blocking issues.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #2579 +/- ##
=========================================
Coverage 96.32% 96.32%
=========================================
Files 670 670
Lines 51173 51181 +8
=========================================
+ Hits 49290 49298 +8
Misses 1883 1883 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
v0 named Identity credential providers by the bare credential name, and the agent code it deployed looks them up by that name. For v0 projects, provision, update, record and remove providers under that bare name instead of the project/target-scoped v1 name, so a deploy never creates a second set of providers beside the ones in use. v0 providers can be shared between projects in an account, so teardown and orphan removal never delete a v0 project's API key or OAuth providers. Payment providers are still deleted, as v0's teardown did. v1 projects are unchanged.
eb31023 to
953439f
Compare
|
Claude Security Review: no high-confidence findings. (run) |
Description
v0 projects keep v0's credential provider names. v0 named Identity providers after the bare credential name (
my-api-key), and the agent code it deployed looks them up by that name. v1 uses<project>_<target>_<credential>, so using it on a v0 project would create a second set of providers beside the ones in use.project.legacyprojects, provisioning, update, reuse, the recorded ARN, rollback and removal all use the bare name. v1 projects are unchanged._NAMEenv var, harness permissions, gateway auth and status already take the name from the recorded ARN, so they follow automatically.The
assertV1Projectgate from #2575 stays in place; this is a prerequisite for lifting it on deploy.Builds on #2575, which is now merged.
Type of Change
Testing
bun testbun run typecheckbun run lint:checkbun run format:checkChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.