Repository navigation
Skip Link metadata in the CLI card-data check - #312
Merged
Merged
Conversation
yummybomb
marked this pull request as ready for review
November 6, 2026 21:35
hiroTamada
approved these changes
Nov 6, 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.
Summary
#309 (pr i merged and created this breakage) widened the
--speccard-data check invaultSpecFromFlagsfrom KERNEL specs to every provider.vaultSpecHasCardDatamatches key names at any depth, so it now also scans Linkmetadata. That metadata is a free-form string map that the API forwards to Link unchanged, so a harmless key likenumber,cvcorexpiry(for example an order number) makes Linkcards create,cards updateandpayment-requests create/updatefail before the request with a KERNEL/VGS-specific card-details error. On main before #309 these specs were sent as normal.This change keeps the all-provider check but leaves
metadataout of the scan forlink. It is the only open-ended map in a Link spec; the other objects (line_items,totals,recurring) have closed schemas. Other providers are unchanged: AgentCard, Shop Pay, KERNEL and VGS specs are still scanned in full. AgentCard specs have nometadatafield, and the API rejects unknown spec fields. KERNELmetadatais still covered byTestKernelSpecRejectsCardDetails.The regression is on main but not in a release yet (latest is v0.50.0).
Tests
TestVaultLinkSpecsPreserveMetadataCardKeys: Linkcards create/updateandpayment-requests create/updatesend metadata withnumber,cvcandexpirykeys unchanged. All 4 subtests fail without the fix.TestVaultLinkSpecRejectsCardDetailsOutsideMetadata: top-level andline_itemscard fields on a Link spec are still rejected before any API call.go build ./...,go vet ./...andgo test ./...pass locally. I didn't run against the production API.Note
Medium Risk
Tightens validation scope for Link specs only; KERNEL/VGS paths unchanged. Slight mismatch with PR text if AgentCard metadata skip was intended—it is not in the diff (only
linkskipsmetadata).Overview
Fixes a regression where
vaultSpecHasCardDatascanned the whole--specJSON for every provider, so harmlessmetadatakeys on Link (e.g. ordernumber,cvc,expiry) tripped the card-details guard before the API.For
--provider link, the CLI now clones the spec, dropsmetadata, and runs the card-data check on the remainder so opaque Link metadata is not scanned. KERNEL and VGS behavior is unchanged (full spec still checked; protectedsingle_use_card/cardpaths unchanged).Tests assert Link
cards/payment-requestspreserve metadata with card-like key names, and that real card fields outside metadata (top-level PAN,line_itemsCVC) are still rejected before any request.Reviewed by Cursor Bugbot for commit 335f950. Bugbot is set up for automated code reviews on this repo. Configure here.