Commit Graph

6 Commits

Author SHA1 Message Date
Grant c86c7fe0d2 Correct stale workspace name in docs and comments 2026-06-17 15:24:55 -05:00
Grant ed2d758041 Update API-stability note to Keysat v0.2 2026-06-13 06:40:14 -05:00
Grant 8a80cf6ab8 README: align positioning with 'Bitcoin-native self-hosted software licensing' 2026-05-11 08:46:38 -05:00
Grant 76f0d1dabe EntitlementsCatalog field in PublicPoliciesProduct (parity with TS / Rust / Python 0.3.0)
Mirrors keysat 0014 + the v0.3.0 cuts of the other three SDKs. New
EntitlementDef type with Slug + Name + Description; PublicPoliciesProduct
gains EntitlementsCatalog []EntitlementDef. SDK consumers' in-app
tier pickers can render display names + tooltip descriptions instead
of raw slugs. Empty slice on legacy products without a catalog.
No breaking change.
2026-05-10 07:59:00 -05:00
Grant bf4ffddbf1 StartPurchase + ListPublicPolicies (parity with TS / Rust / Python 0.2.0)
The Go SDK's online client previously only exposed Validate +
PublicKey. This adds the purchase-side surface so Go consumers
have the same capabilities as the other three language clients:

- StartPurchaseOptions struct (BuyerEmail, BuyerNote, RedirectURL,
  Code, PolicySlug). Zero-valued fields are omitted from the
  JSON request body.
- Client.StartPurchase(ctx, productSlug, opts) → PurchaseSession
  with InvoiceID, BTCPayInvoiceID, CheckoutURL, AmountSats,
  PollURL.
- Client.ListPublicPolicies(ctx, productSlug) →
  PublicPoliciesResponse for rendering an in-app tier picker.
  Public endpoint, no auth.

  session, err := client.StartPurchase(ctx, "recap",
      keysat.StartPurchaseOptions{
          PolicySlug:  "pro",
          BuyerEmail:  "buyer@example.com",
          RedirectURL: "https://recap.app/thank-you",
      })
  // open session.CheckoutURL in the buyer's browser

  tiers, err := client.ListPublicPolicies(ctx, "recap")
  for _, p := range tiers.Policies {
      fmt.Println(p.Slug, p.Name, p.PriceSats, p.Entitlements)
  }

Build + existing crosscheck tests pass clean.
2026-05-09 09:09:05 -05:00
Grant 81a621423a Initial Go SDK for Keysat licensing service
Pure-Go, stdlib-only implementation of the LIC1 wire format:
- ParseKey + Verify + ParseAndVerify for offline verification
- HashFingerprint helper (SHA-256, matching the daemon's contract)
- LoadPublicKeyPEM for the standard PKIX-encoded Ed25519 public keys
  the daemon emits
- Client.Validate / Client.PublicKey for online checks against a
  running Keysat daemon
- LicensePayload struct with idiomatic Go getters (IsTrial,
  IsFingerprintBound, IsExpiredAt, HasEntitlement)

Wire-format crosscheck against the shared tests/crosscheck/vector.json
(the same file the Rust, TypeScript, Python SDKs and the daemon itself
test against). All four fixtures pass — v1 legacy fingerprint-bound,
v2 trial with entitlements, v2 perpetual unbound, plus end-to-end
PEM-load → ParseAndVerify signature roundtrip. Confirms byte-for-byte
agreement across five independent implementations.

No third-party dependencies. Module path:
github.com/keysat-xyz/keysat-client-go
go 1.21
2026-05-08 11:17:46 -05:00