portage-ucp 0.7.1 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/lib/portage/ucp/manifest.rb +14 -7
- data/lib/portage/ucp/rack/manifest_endpoint.rb +1 -1
- data/lib/portage/ucp/resolver.rb +7 -2
- data/lib/portage/ucp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 411d3c147d477882ffab11e8679a8c188735faaf34cf764feab94e0b209d14cf
|
|
4
|
+
data.tar.gz: 9687a224d4cce5c79a6c501e4583d0adab98283aaa166027d91eb79213f04831
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ee057628093a5cca7d1240fbf1a0d2ac9982563f86a080536fe2d3f42e17476809415622c8e8f670125e131ba17bd7f54d7c8320f9d5c33531c99942f7240785
|
|
7
|
+
data.tar.gz: 74db4f514c5c9d3d3f57e8537ada8a1dddb51d29f912bfb5682c7ff22c244d6055459bade3483472ddb31c3cadbb8aae97c46c88d1800b9dcae122d3a7045643
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,29 @@ All notable changes to this project are documented here. Format loosely follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/); this project is
|
|
5
5
|
pre-1.0, so APIs may still shift between minor versions.
|
|
6
6
|
|
|
7
|
+
## [0.8.1] - 2026-09-22
|
|
8
|
+
|
|
9
|
+
- `Resolver`'s WooCommerce platform entry threads `payment_method`/
|
|
10
|
+
`billing_address` from `WOOCOMMERCE_PAYMENT_METHOD`/`WOOCOMMERCE_BILLING_ADDRESS`
|
|
11
|
+
through to `Adapter.new`. It previously built the client and adapter
|
|
12
|
+
without either, so `complete_checkout` failed with no gateway or address
|
|
13
|
+
configured even when both env vars were set — the resolver's `env:` map
|
|
14
|
+
simply never named them.
|
|
15
|
+
|
|
16
|
+
## [0.8.0] - 2026-09-17
|
|
17
|
+
|
|
18
|
+
- **Breaking:** `Manifest#to_h` now emits the shape live UCP stores actually
|
|
19
|
+
serve (confirmed against Shopify's `2026-08-25` rollout) instead of the
|
|
20
|
+
flat one this gem invented: everything nests under a top-level `ucp`
|
|
21
|
+
object, `ucp_version` becomes `version`, and `capabilities` is keyed by
|
|
22
|
+
capability name (`{"dev.ucp.shopping.catalog" => [{version: ...}]}`)
|
|
23
|
+
rather than an array of `{name:, version:}` hashes. When a signer is
|
|
24
|
+
configured the signature still covers the manifest body and rides inside
|
|
25
|
+
the `ucp` object. Anything reading a Portage-served manifest by the old
|
|
26
|
+
top-level keys needs updating — `Rack::ManifestEndpoint`'s own
|
|
27
|
+
advertised-payment check and `skills/serve-via-ucp`'s `verify.sh` both
|
|
28
|
+
did, and are fixed here.
|
|
29
|
+
|
|
7
30
|
## [0.7.1] - 2026-09-16
|
|
8
31
|
|
|
9
32
|
- No behavior change — 0.7.0 was built and pushed with `gem build` run from
|
data/lib/portage/ucp/manifest.rb
CHANGED
|
@@ -31,24 +31,31 @@ module Portage
|
|
|
31
31
|
@services = services
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
+
# Nests everything under a "ucp" envelope, and keys `capabilities` by
|
|
35
|
+
# capability name (matching what live Shopify UCP rollouts — Casper,
|
|
36
|
+
# Allbirds, Glossier, and 34+ others — actually serve as of manifest
|
|
37
|
+
# "version": "2026-08-25"; see docs/well-known-ucp.md and
|
|
38
|
+
# portage-ucp-client's Client.discover, which this shape now matches).
|
|
34
39
|
def to_h
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
ucp = {
|
|
41
|
+
version: UCP_VERSION,
|
|
37
42
|
business: @business,
|
|
38
43
|
services: @services,
|
|
39
|
-
capabilities:
|
|
40
|
-
{ name: capability.name, version: capability.version }
|
|
41
|
-
end,
|
|
44
|
+
capabilities: capability_hash,
|
|
42
45
|
payment_handlers: @payment_handlers,
|
|
43
46
|
signing_keys: @signing_keys
|
|
44
47
|
}
|
|
45
|
-
|
|
48
|
+
ucp = ucp.merge(signature: sign(ucp)) if @signer
|
|
46
49
|
|
|
47
|
-
|
|
50
|
+
{ ucp: ucp }
|
|
48
51
|
end
|
|
49
52
|
|
|
50
53
|
private
|
|
51
54
|
|
|
55
|
+
def capability_hash
|
|
56
|
+
@registry.advertised(@adapter).to_h { |capability| [capability.name, [{ version: capability.version }]] }
|
|
57
|
+
end
|
|
58
|
+
|
|
52
59
|
def sign(payload)
|
|
53
60
|
canonical = JSON.generate(payload)
|
|
54
61
|
{ kid: @signer.kid, value: Base64.strict_encode64(@signer.sign(canonical)) }
|
data/lib/portage/ucp/resolver.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
1
3
|
module Portage
|
|
2
4
|
module Ucp
|
|
3
5
|
# Shared platform-detection + adapter-building logic for anything that
|
|
@@ -39,14 +41,17 @@ module Portage
|
|
|
39
41
|
namespace: "WooCommerce",
|
|
40
42
|
markers: [/woocommerce/i, %r{wp-content/plugins/woocommerce}i],
|
|
41
43
|
env: { site_url: "WOOCOMMERCE_SITE_URL", consumer_key: "WOOCOMMERCE_CONSUMER_KEY",
|
|
42
|
-
consumer_secret: "WOOCOMMERCE_CONSUMER_SECRET", currency: "WOOCOMMERCE_CURRENCY"
|
|
44
|
+
consumer_secret: "WOOCOMMERCE_CONSUMER_SECRET", currency: "WOOCOMMERCE_CURRENCY",
|
|
45
|
+
payment_method: "WOOCOMMERCE_PAYMENT_METHOD", billing_address: "WOOCOMMERCE_BILLING_ADDRESS" },
|
|
43
46
|
required: %i[site_url consumer_key consumer_secret],
|
|
44
47
|
build_client: lambda { |ns, env|
|
|
45
48
|
ns::Client.new(site_url: env.fetch(:site_url), consumer_key: env.fetch(:consumer_key),
|
|
46
49
|
consumer_secret: env.fetch(:consumer_secret))
|
|
47
50
|
},
|
|
48
51
|
build_adapter: lambda { |ns, client, env|
|
|
49
|
-
ns::Adapter.new(client: client, site_url: env.fetch(:site_url), currency: env.fetch(:currency, "USD")
|
|
52
|
+
ns::Adapter.new(client: client, site_url: env.fetch(:site_url), currency: env.fetch(:currency, "USD"),
|
|
53
|
+
payment_method: env[:payment_method],
|
|
54
|
+
billing_address: env[:billing_address] && JSON.parse(env[:billing_address]))
|
|
50
55
|
}
|
|
51
56
|
),
|
|
52
57
|
Platform.new(
|
data/lib/portage/ucp/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: portage-ucp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.8.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tom Whitbread
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|