Skip to content

generic-devkit: catalog/publish support for the generic BPP - #17

Open
nirmay wants to merge 12 commits into
mainfrom
catalog-publisher
Open

generic-devkit: catalog/publish support for the generic BPP#17
nirmay wants to merge 12 commits into
mainfrom
catalog-publisher

Conversation

@nirmay

@nirmay nirmay commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Wires the catalog/publish DS-internal trigger into the generic devkit's BPP (generic-bpp.yaml), backed by beckn-onix's catalogpublisher plugin/catalogPublishHandler.
  • Serves the generated manifest/catalog-index/catalog files over the existing ngrok tunnel via a new /beckn/* static route in install/Caddyfile, backed by a ../data/beckn bind mount (renamed from an earlier /catalog layout).
  • Enables schema validation (schemav2validator) for incoming catalogs, and a manifest-link check (manifestloader) that warns (without writing to the real DeDi manifest) when this publisher's catalog index isn't yet declared there.
  • Adds a corrected Beckn Catalog Index JSON Schema matching the current file spec.
  • Removes catalogPull/catalog-crawler wiring from this branch — that work is proceeding independently, and the handler type it depended on no longer exists on the beckn-onix catalog-publisher branch this devkit points at (its absence was crashing the BPP on startup: invalid module: catalogPull).
  • Sets up two independent test identities: bppTxnReceiver/bppTxnCaller keep the original bpp.example.com identity so the regular transaction flow keeps signing correctly; catalogPublish's own keyManager block and manifestSubscriberId use a separate staging.p-node.fabric.nfh.global / DeDi-registered test identity.
  • docker-compose-generic.yml (pinned fidedocker/onix-adapter image) gets the same volume mounts as -local.yml so it's ready once a release image with the catalogPublish handler is pinned there.

Test plan

  • docker compose -f generic-devkit/install/docker-compose-generic-local.yml up brings up BAP/BPP cleanly (no invalid module crash).
  • Regular discover → ... → confirm transaction flow still signs/verifies correctly (BPP identity unchanged).
  • POST /catalog/publish (Postman 2 — Catalog Publishing / publish) succeeds and writes to generic-devkit/data/beckn/.
  • Generated manifest/index/catalog files are reachable at the public ngrok URL under /beckn/*.
  • Once beckn-onix:1.7.5 is pushed with catalogPublish support, docker-compose-generic.yml (pinned image) also works end-to-end.

🤖 Generated with Claude Code

nirmay added 12 commits July 23, 2026 10:44
Adds a catalogPull handler alongside bapTxnReceiver/bapTxnCaller on the
onix-bap container, serving /catalog/pull as a DS-internal trigger that
fetches and verifies a provider node's manifest -> index -> catalog chain.
Uses {{networkId}} and {{bpp_uri}} collection variables, consistent with
the existing Discovery/Transaction requests. Adds bap_base_url since
catalog/pull is a root-level path, not nested under /bap/caller like the
other requests.
Aligns with beckn.yaml Context.receiverId naming (the PN's DID) rather
than reusing bppUri. Value is still the PN's URI for now -- real DID
resolution isn't implemented, this is a field-name alignment only.
Pins onix-bap/onix-bpp to fidedocker/onix-adapter:1.7.5 (built from
beckn-onix's catalog-crawler branch) instead of the implicit :latest, so
the team gets the catalog/pull handler without rebuilding locally.
Adds a "Catalog Crawler" section covering what /catalog/pull does, how
to trigger it (Postman or curl, using networkId=beckn.one/testnet), and
sample COMPLETED/FAILED responses -- so this is discoverable from
starter-kit itself, not just beckn-onix's own plugin README.
Reference schema for the details payload of a catalog-index DeDi file
(registry.name: "beckn-catalogs"): one record per catalogId, describing
its version, lifecycle status, visibility, and the digest/location of
its content (plain, unsigned Beckn Catalog JSON at parts[].url).

Matches the draft-07, flat, additionalProperties:false style of
nfh-trust-labs/DeDi's own Beckn_subscriber.json / Beckn_subscriber_reference.json,
intended as a starting point to eventually move there.
The published schema described a single catalog entry from a
pre-file-spec design: visibility as public/{networks}, a flat parts[]
list with no signature at all, no index wrapper. The current file spec's
catalog index has since moved to a signed, versioned model entirely --
this rewrite matches it:

- Top-level document: {participantId, version, next_update, catalogs[]},
  not a single entry.
- Each catalog entry is either ACTIVE (catalogType, optional networkIds/
  authMethods/schemaTypes/crawlHint, baseline + changes) or RETIRED
  (catalogId, status, retiredAt only, enforced via if/then/else so a
  tombstone can't also carry files).
- baseline/changes entries are file-entry objects requiring version, with
  url/size/digest/signature only required together -- allowing the spec's
  lightweight forward-pointer form ({"version": 43}, no file yet).
- Each file's signature is its own object {keyId, value, validUntil} --
  the tuple it signs (per its description) now includes size, matching
  the file spec's binding update.
- authMethods reshaped to the current method/header/signedHeaders/
  freshnessSeconds form (no more algorithm/challenge fields).

Verified against the file spec's own worked example (all three catalog
entries -- ACTIVE with a forward-pointer change, ACTIVE restricted with
authMethods, and a RETIRED tombstone) and against a battery of documents
that should be rejected (the old single-entry shape, a RETIRED entry
carrying a baseline, a fileEntry missing digest, a bad digest pattern,
and the old authMethods shape).
Wires the catalog-publisher plugin into the generic BPP devkit: new
catalogPublish module in generic-bpp.yaml, docker-compose updates,
Postman requests for the /catalog/publish endpoint, and README docs.
Tested end-to-end against the generic devkit.
…ngrok tunnel

Adds a /catalog/* static route to beckn-router's Caddyfile, serving
../data/catalog (onix-bpp's catalogPublish outputRoot) read-only
through the same port-9000 tunnel the BAP/BPP routes already use --
no second port or tunnel needed. Sets catalogBaseURL in
generic-bpp.yaml to that tunnel's URL + /catalog so generated
manifest/index/catalog files carry real, publicly fetchable URLs
instead of the pending-artifact-store:// placeholder.
Adds schemaValidator (schemav2validator) to the catalogPublish module
in generic-bpp.yaml, so submitted catalogs are validated against
catalog/publish's real message.catalogs[]:Catalog[] schema before
they're published. No type/location set, matching the other modules
in this file, so it resolves the canonical protocol-specifications-v2
beckn.yaml via becknConstants. checkPolicy (opapolicychecker)
intentionally left out for now.
…to beckn

Renames the on-host data dir, container mount, and Caddy static route
for catalogPublish's output from catalog to beckn throughout: data/catalog
-> data/beckn, /catalog (container) -> /beckn, /srv/catalog -> /srv/beckn,
Caddyfile's /catalog/* route -> /beckn/*, and outputRoot/catalogBaseURL in
generic-bpp.yaml updated to match. The /catalog/publish API path itself
is unrelated and untouched.
… pinned-image compose too

catalogPull is being developed independently now; the beckn-onix
catalog-publisher branch no longer registers that handler type, so
generic-bap.yaml's catalogPull module crashed the BAP on startup
("invalid module: catalogPull"). Removes that module block and its
Postman/README references.

Adds manifestSubscriberId to generic-bpp.yaml's catalogPublisher
config -- the DeDi-native namespace/registry/recordName identifier the
node-manifest self-lookup requires, kept separate from subscriberId
(used for keyset/signing) since the two have different formats.

bppTxnReceiver/bppTxnCaller keep their original bpp.example.com
identity (keys + Postman bpp_id variable) -- only catalogPublish's own
keyManager block and manifestSubscriberId use the new
staging.p-node.fabric.nfh.global test identity, so the regular
select/init/confirm transaction flow keeps signing correctly.

docker-compose-generic.yml (the pinned fidedocker/onix-adapter image,
as opposed to -local.yml's locally-built beckn-onix:latest) was
missing the volume mounts and doc comment catalog-publish needs --
added those too so it's ready once a release image with the
catalogPublish handler is pinned there.
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