Add vault payment commands - #244
Open
rgarcia wants to merge 6 commits into
Open
Conversation
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
Add a project-scoped vault CLI for preparing and observing payment credentials. Commands use the generated SDK and existing Cobra, project selection, table/JSON, and confirmation conventions. They do not submit merchant payments.
Command surface
vaults create --name,vaults list --limit --offset,vaults get <vault>,vaults delete <vault> --yesvaults wallets create <vault> <key> --provider link|agentcard [--user-id] [--open]vaults wallets payment-methods <vault> <key>vaults cards create|update <vault> <key> --provider --wallet --amount --currency --merchant--payment-method-id,--merchant-url,--context, and exactly one of--test/--live.--card-id. Its mode is deployment-controlled; no per-item test/live flags are accepted.vaults cards authorize <vault> <key> [--open]vaults items list <vault>,vaults items get <vault> <key> [--wait 0..60] [--expand payment_methods] [--open]vaults items events <vault> <key> [--after <event-id>] [--wait 0..60],vaults items delete <vault> <key> --yesbrowsers create --vault <id-or-name>(repeatable, max 20; incompatible with pools even with--yes)Project selection is optional for all vault commands and browser vault attachment. Use
--projectorKERNEL_PROJECTto select one; otherwise, the API resolves scope from the credentials and its defaults (the default project for org-wide credentials, not all projects). The API assigns immutable ownership from that scope; there is noproject_idbody field. Vault names and item keys remain immutable. All non-delete vault commands support-o json.Safety and output
requestedstate and advertisedauthorize; the SDK's automatic retries are disabled for every vault request. Pending authorization recovery is deliberately not exposed.Deleted or not found, whether the missing object is the project, vault, or item. Non-404 errors still propagate.Temporary SDK dependency
One
go.modreplacement pins the canonical SDK import to:This resolves to commit
50f33b1b5cf6bea9f2e34b44de8d52af0e80a6f4onstlc/preview/pr-3698. The pseudo-version was resolved through Go, andgo.sumrecords its checksums. The canonicalrequireremains unchanged; no SDK files or branches were modified.For local builds, authenticate GitHub access to the staging repository and set
GOPRIVATE=github.com/kernel/kernel-go-sdk-staging. CI temporarily uses the existing GitHub App credentials to mint a contents-read token scoped only to the preview repository. Go caching is disabled so the private SDK source is not published through public CI caches. Fork CI cannot access this private preview.The preview also renames nine existing browser SDK path fields from
IDtoIDOrName; the corresponding call sites are updated without changing command behavior.Required after the SDK release, before publishing the CLI
go mod edit -dropreplace=github.com/kernel/kernel-go-sdk.go mod tidy.Deliberate limits
Advanced optional Link line items, totals, metadata, and expiry are not configurable in this initial surface.
cards updateis explicitly documented as full-spec replacement: omitted optional details previously set through another client are removed. There are no rename, domain-setting, raw request, callback-code, payment submission, or automatic payment retry commands. Browser vault bindings are creation-only; pool acquisition and existing-browser attachment are not exposed.Verification
Current CI blocker: dependency resolution fails with
unknown revision 50f33b1b5cf6for the pinned preview SDK, including after a rerun. The local checks below passed using the cached pinned SDK. The pin is unchanged; CI must be restored before merging.make testpassed (go vet ./...andgo test ./...).make buildpassed.-race.make lintran with golangci-lint 2.5.0 built using Go 1.25.0: 66 findings in existing code, including SDK deprecations;golangci-lint run --new-from-rev=mainreports 0 issues. The Makefile masks lint exit status, so the incremental check was also run directly.Deleted or not found; rechecked both delete commands and the unchanged failing list command against a local invalid-project fixture.