Skip to content

Unify Link checkout card commands - #250

Open
rgarcia wants to merge 9 commits into
mainfrom
hypeship/link-payment-tokens
Open

rgarcia wants to merge 9 commits into
mainfrom
hypeship/link-payment-tokens

Conversation

@rgarcia

@rgarcia rgarcia commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Depends on kernel/kernel#3950; do not merge before it and the SDK release.

Summary

  • create Link checkout credentials through the existing vaults cards create command
  • require browser session ID, exact HTTPS page URL, funding method, purchase amount, merchant name, and context for Link cards (no merchant_url)
  • remove the separate payment-token command, public fallback handling, mutable card updates, and the authorize flow
  • accept either field-bound fill parameters or selector-free fill parameters; selector-free fills omit fields from the request
  • point fill help at each item's advertised fill description in available_operations instead of hardcoding inputs
  • display the immutable checkout binding and safe non-retry guidance without exposing payment material
  • map the browser_unavailable fill error code

Temporary SDK pin

go.mod pins the Go SDK to a preview build generated from kernel/kernel#3950:

replace github.com/kernel/kernel-go-sdk => github.com/kernel/kernel-go-sdk-staging v0.86.1-0.20260924200253-a235f00476bf

(commit a235f00476bf5b0ffec8cc99265ec04abaf89d3d). The preview repository is private, so CI jobs that download modules without access to it (including preview binaries) are expected to fail until the pin is swapped. Local builds need GOPRIVATE=github.com/kernel/* and access to that repository.

The preview SDK does not generate the vault item update method, so vaults credentials update temporarily sends its PATCH through the SDK's generic client (cmd/vaults_credentials.go).

Before merge: remove the replace line, bump github.com/kernel/kernel-go-sdk to the release that includes kernel/kernel#3950, run go mod tidy, and switch saveCredential back to Items.Update if that release exposes it.

Validation

  • go build ./...
  • go vet ./...
  • go test ./...

@kernel-internal

kernel-internal Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🔧 CI Fix Available

I've pushed a fix for the CI failure on this PR, rebuilt on the latest head (e890842).

What failed: make test never got past go vet — the replace directive pointing github.com/kernel/kernel-go-sdk at github.com/kernel/kernel-go-sdk-staging is unresolvable from CI, so every package importing the SDK failed to load.

The fix: drops the staging replace and builds against the released kernel-go-sdk v0.112.0 that main already tracks. That release is newer than the pinned preview build and carries the full surface this branch needs, so no reworking of call sites was required. The one follow-on change restores the typed Items.Update call in cmd/vaults_credentials.go, which had been swapped for a raw client PATCH only because the preview SDK was missing the method.

Behavior is unchanged: make test passes, and the wire-level PATCH contract tests (TestCredentialUpdateIdentityPrecondition, TestCredentialCreateAndUpdate) confirm the typed call sends the same request shape.

👉 Click here to create a PR with the fix

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread cmd/vaults_output.go
Comment thread cmd/vaults_output.go

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread cmd/vaults_secrets.go
@rgarcia
rgarcia force-pushed the hypeship/link-payment-tokens branch from 22a563b to 55056fd Compare September 16, 2026 17:27

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread cmd/vaults_fill.go Outdated
@rgarcia rgarcia changed the title Add Link payment token vault commands Unify Link checkout card commands Sep 24, 2026

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread cmd/vaults_output_test.go
@rgarcia

rgarcia commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

bugbot run verbose=true

@cursor

cursor Bot commented Sep 24, 2026

Copy link
Copy Markdown

Bugbot request id: serverGenReqId_454b1f9d-c2e1-4cf2-a566-ba9f3b8fabc0

@cursor

cursor Bot commented Sep 24, 2026

Copy link
Copy Markdown

Bugbot rules debug

Bugbot rules included in this run
Rule Type Size Status
Search CLI: no-retry Execute; pass-through JSON; document schema (learned-1a6b9588-9429-4c0e-b218-6b65814d4686) learned 974 chars included
Credential field labels are display-only; name is the key (learned-d783169f-e275-49dd-8a58-4a791055db23) learned 887 chars included
Credential create: ordered fields array; preserve order (learned-be4e0a33-7e77-4d70-a9de-c6b6e6ddbb92) learned 779 chars included
Login: OAuth denial, persist-before-success, one output owner (learned-f68e8343-679a-41a3-98c3-fb27cdb6113f) learned 948 chars included
Link is fill-only; aliases are AgentCard-only (learned-6a2276df-d851-4741-9d04-63fd0324440f) learned 922 chars included
Fill/invoke preflight GET must expose status/code (learned-444aca45-38d8-4122-8ad0-c53b26830c57) learned 609 chars included
Auth --region: parseRegionFlag; omit preserves stored region (learned-1cc703cb-c910-4106-9ab9-da26d76707e2) learned 838 chars included
Credential items: own output branch, not wallet/card UI (learned-7595835e-a9ac-403d-9aa0-31ee41752b6c) learned 994 chars included
Vault fill: typed params, value-free outcomes, no retries (learned-5a08bdae-1afd-40d1-af89-ec1d29f68ad6) learned 977 chars included
Vault credentials only at protocol boundaries (learned-ea4fa129-fda7-444d-886c-e41ba404eaca) learned 567 chars included
One effective-action policy for vault recovery items (learned-e4c75023-4588-4e01-922d-93586ef8235c) learned 917 chars included
WebMCP invoke: no retries; preserve JSON numbers and invocation IDs (learned-6a3b4c4a-b00d-407d-a741-578c9b9327f6) learned 954 chars included
Vault operations are API-advertised; 404 delete is success (learned-068ae3d8-0705-4cf4-80f3-9206245db69a) learned 1,000 chars included
Filter vault secrets; print action URLs in full (learned-4ee3c8ca-6658-4d66-a907-67f506c39ceb) learned 953 chars included
Pass vault --spec JSON through without mutation (learned-aa2ce508-1259-42b5-9447-e04b5b8b9686) learned 999 chars included
Kernel API calls must use the authenticated SDK client (learned-656d1c0d-815a-4dcc-ad95-e84f4fe6caaa) learned 928 chars included
Distinguish explicit null from omitted/malformed in respjson fields (learned-1478f861-f441-40f4-aa4b-205e2a6f16cd) learned 1,000 chars included
Use rune-aware truncation for CLI table display strings (learned-c779dbf1-d40d-4d1f-aad0-d5d8e99be52f) learned 702 chars included
Interactive prompts must use pkg/interactive, not direct pterm (learned-2b9b3e9c-ac1c-47b4-aab5-073e3021da38) learned 798 chars included
Do not flag os.Rename as failing on Windows when destination exists (learned-dccfd017-676b-4b53-bd66-2050588c06fb) learned 778 chars included
Do not flag missing HTTP status checks after kernel-go-sdk calls (learned-40c889eb-0368-40db-95e6-e26b4805d72a) learned 910 chars included
Do not flag missing case normalization for API filter parameters (learned-0912b665-6a1d-45a3-90e3-5dee702bf69d) learned 733 chars included
Paginated CLI JSON output must include pagination cursor (learned-4dff1c77-3282-47e3-b9e1-72da805c799b) learned 989 chars included
Streaming CLI commands must handle SIGINT/SIGTERM for clean exit (learned-2dbec253-6a4a-4117-987c-12a62ea9f489) learned 852 chars included
Use shared JSON output helpers in CLI commands (learned-f93f1086-e522-4c94-94d0-e21b6a2116f7) learned 632 chars included

https://cursor.com/docs/bugbot#team-rules

Bugbot request id: serverGenReqId_454b1f9d-c2e1-4cf2-a566-ba9f3b8fabc0

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

- temporarily replace kernel-go-sdk with the preview build for Link checkout cards
- send credential updates through the generic client while the preview SDK lacks the item update method
- omit fields from selector-free fills instead of sending an empty array
- point fill help at each item's advertised fill description and drop authorize wording
- drop merchant_url from display output and map browser_unavailable fill errors

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 92146ac. Configure here.

Comment thread cmd/vaults_output.go Outdated
}
if value, ok := object[key]; ok {
if key == "url" || key == "approval_url" || key == "merchant_url" || key == "merchant_origin" || key == "image_url" || key == "product_url" {
if key == "url" || key == "approval_url" || key == "merchant_origin" || key == "image_url" || key == "product_url" {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checkout page URL skips safety filter

Medium Severity

page_url is now a displayed spec field, but the display-safe URL gate that previously covered merchant_url does not include it. Filtered JSON and the Link card table can therefore emit a checkout URL that carries userinfo or query secrets.

Additional Locations (2)
Fix in Cursor Fix in Web

Triggered by learned rule: Filter vault secrets; print action URLs in full

Reviewed by Cursor Bugbot for commit 92146ac. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed in e890842: page_url now goes through the same display-safe URL filter as other displayed URLs, so JSON and the Link card table withhold checkout URLs with userinfo or secret query/fragment keys. Covered by TestVaultCheckoutPageURLsWithSecretsAreWithheld.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant