Repository navigation
Support Link Pay Token checkout in vault card commands - #298
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
bmsaadat
left a comment
There was a problem hiding this comment.
thanks, the authorize flags, error mapping and field-less fill all line up with the API, and go vet / go test ./... pass locally on v0.126.0. requesting changes for one wording fix, plus one API bug this surfaces:
- user approval before authorize (
cmd/vaults_link.gostep 3,README.md): the flow no longer says to get the user's approval before authorizing, and the README line "After explicit user approval, authorize only if the item advertises it" was removed. the API's Link authorize description still opens with "Use once the user has approved this purchase", so could we add that back to step 3 and the README? - unattached browser returns an opaque 500 (API, from #3950): if the browser isn't attached to the vault (or is deleted, or an unleased pool instance),
vaultFillSessionOncereturns afillUnavailableError, whichlinkCardCheckoutErrordoesn't match (errors.Asonvaultfill.Error), so authorize returns500 provider_error "failed to perform item operation". the CLI's default advice then says to re-get the item and follow its operations, which leads straight back to authorize. probably best fixed in the API (map it tobrowser_unavailable); until then a CLI hint like "check that the browser was created with --vault" on a 5xx with checkout flags would help.
optional:
--page-urlvalidation differs from the API's pattern both ways (e.g. a space in the path or*in the host passes here but the API rejects it); reusing^https://[^/?#@*\s]+(?:[/?#][^\s]*)?$would line them up.- the Link 429 advice drops
Retry-After, which the Kernel path shows. - a network error on Link authorize now hides the underlying cause (
kernelVaultTransportError.Error()prints only the generic message). - Kernel cards no longer get the client-side check for missing fill
fieldsor checkout flags (the API still rejects both with a 400). restart_verification --browser-idsays to pass inputs with--params, but that operation takes none.
|
Thanks. Addressed in 3e75f4c:
Optional items, all done:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3e75f4c. Configure here.
…ove and passkeys Bump kernel-go-sdk to 5fcd5cb3d70a57e4eaa55cf9a4e31d8826a0d4bd, which adds the passkey credential field type and add_fields/remove_fields on credential vault item updates. `vaults credentials update --spec-file` already passes the spec through CredentialVaultItemSpecUpdateParam, so the new fields work as-is; update the help text, example, and README (definitions are no longer immutable; passkey type rules). Also fix the earlier merge of main, which duplicated the authorize field in vaultOperationParams and broke the build. Take main's authorize handling (--browser-id/--page-url from #298), which supersedes this branch's --params variant, and drop its now-obsolete test. Tested: vaults create; vaults credentials create (text/password fields); vaults credentials update with add_fields (totp + passkey), fields values, and remove_fields -> version 2, ready, fields username/otp/pk; vaults items get; vaults delete. go build ./..., go vet ./cmd, go test ./cmd pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Summary
Brings the vault card commands in line with the Link Pay Token vault API (kernel/kernel#3950).
items invoke <vault> <key> authorizetakes optional--browser-idand--page-url, sent asbrowser_idandpage_url. The CLI rejects one without the other, a blank browser ID, a non-https or credential-bearing page URL, and either flag on any other operation, all before calling the API. Without the flags, authorize still sends{"type":"authorize"}.page_not_found,ambiguous_page,browser_not_found,browser_unavailable,destination_denied,timeout,browser_error) say no payment request was made, to fix the tab and authorize again, and to fall back to a virtual card if inspection keeps failing.invalid_requestcovers the virtual card limit; 429 says wait and authorize again.fields(a Link Pay Token fill requires this); the request then omitsfields, and the item's fill description and API validation decide. Credential fills still require fields client-side. A field-less result ("fields":[]) is accepted forcompleted,failed, andunknown, and human output says to submit the checkout yourself.linkCardFlowHelp) appears invaults,wallets create,cards create,cards update, anditems invoke, in the order reach checkout → create card → authorize with browser ID and page URL → share approval URL → wait for fill → fill → submit yourself. Removed or reworded text that conflicted with it (browser attached after card creation, "authorize takes no parameters", unconditional "checkout cards can be edited between authorizations", provider-assigned domains for Link, bare "never retry"). README's Link section follows the same flow.descriptionis shown in human and JSON output.items geton a requested Link card suggestsauthorize --browser-id ... --page-url .... Link card guidance now gives recovery steps instead of "never retry automatically".SDK
Bumps
github.com/kernel/kernel-go-sdkto v0.126.0.Testing
go vet ./...andgo test ./...pass.golangci-lint run: no findings on changed lines (pre-existing findings elsewhere are unchanged).cmd/vaults_link_test.gocover: the shared flow appearing in every command's help and its step order; retired wording; the authorize request body with and without checkout flags; client-side flag validation (no API call); error guidance for each authorize error code; Pay Token fill with nofieldsin the request and field-less results; credential fill still requiring fields; Link card update success and 409; and wallet description output.