Skip to content

feat(vdr): add NeoPrism REST API as VDR backend - #1728

Merged
yshyn-iohk merged 12 commits into
mainfrom
vdr-driver-3
Mar 6, 2026
Merged

yshyn-iohk merged 12 commits into
mainfrom
vdr-driver-3

Conversation

@yshyn-iohk

Copy link
Copy Markdown
Contributor

Summary

Adds NeoPrism as a VDR (Verifiable Data Registry) backend in cloud-agent, enabling VDR operations (create, read, update, delete) to be published to neoprism via its REST API instead of requiring prism-node gRPC.

Architecture

  • NeoPrismVdrService — new VdrService implementation that communicates with neoprism over REST. Follows the same pattern as PrismNodeVdrService.
  • Entry hash computed locally as sha256(PrismOperation) — deterministic per the VDR spec, identical in both cloud-agent and neoprism.
  • Previous event hash for update/delete fetched from GET /api/vdr-entries/{entry_hash} on neoprism.
  • Reuses PrismNodeVdrOperationSigner — protobuf wire format is identical between cloud-agent and neoprism (same field numbers, only naming differs).
  • Routing: VdrServiceImpl dispatches to NeoPrismVdrService when drid=neoprism in the VDR URL.

Key changes

Area Change
vdr/neoprism/ New sbt module with NeoPrismVdrService and NeoPrismVdrModule
NeoPrismClient Extended with submitVdrOperation, getVdrBlob, getVdrEntryMetadata, isOperationIndexed
PrismNodeVdrOperationSigner Fixed signedWith to use plain key name (not full DID#key), respecting neoprism's 50-char limit
VdrServiceImpl Routes to neoprism driver based on URL pattern
Modules.scala / AppConfig Conditional wiring via VDR_NEOPRISM_DRIVER_ENABLED
Integration tests Unified ledger test scenario (manage_vdr_ledger.feature) parameterized by VDR_LEDGER_DRIVER env var — same 116 scenarios run for both prism-node and neoprism

Companion PR

Test plan

  • test_neoprism.sh — BUILD SUCCESSFUL (116 scenarios)
  • test_prism_node.sh — BUILD SUCCESSFUL (116 scenarios)
  • VDR CRUD lifecycle: create → read → update → read → update → read → delete → verify deleted
  • Both drivers share identical test scenarios via VDR_LEDGER_DRIVER env var

🤖 Generated with Claude Code

@yshyn-iohk
yshyn-iohk requested a review from a team as a code owner March 4, 2026 15:45
@github-actions

github-actions Bot commented Mar 4, 2026 •

Copy link
Copy Markdown
Contributor

Unit Test Results

113 files  ±0  113 suites  ±0   23m 48s ⏱️ -40s
927 tests +2  919 ✅ +2  8 💤 ±0  0 ❌ ±0 
934 runs  +2  926 ✅ +2  8 💤 ±0  0 ❌ ±0 

Results for commit c647e6d. ± Comparison against base commit 74f3053.

♻️ This comment has been updated with latest results.

yshyn-iohk and others added 6 commits March 4, 2026 23:01
- Add vdr/neoprism sbt module with NeoPrismVdrService implementing
  VdrService trait using NeoPrism REST API transport
- Extend NeoPrismClient in castor with VDR methods: submitVdrOperation,
  getVdrBlob, getVdrEntryMetadata (HTTP implementations)
- Add VDR model classes (NeoPrismSubmissionResult, NeoPrismVdrEntryMetadata)
  in castor to avoid circular dependencies
- Update VdrServiceImpl proxy/router to dispatch to neoprism when
  drid=neoprism in options or URL
- Add neoPrismDriverEnabled config toggle to VdrConfig and application.conf
- Wire NeoPrismVdrService conditionally in Modules.scala based on config
- Update build.sbt with vdrNeoprism project and dependency wiring

Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
…ings

- Add manage_vdr_neoprism.feature with full CRUD test scenario
- Add vdr_neoprism.conf test configuration
- Wire VDR_NEOPRISM_DRIVER_ENABLED env var in agent.yml and Agent.kt
- Update VdrSteps to handle neoprism driver polling (like prism-node)
- Fix NeoPrismVdrService operation status to use CONFIRMED_AND_APPLIED
  to match the convention used by prism-node and expected by tests

Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
The Service data class requires keycloak_oid4vci to be non-nullable,
so it must be present in all test configs even when not directly used.

Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
…o vdr_neoprism config

- Change neoPrismConfigLayer from val to lazy val in Modules.scala to fix
  NullPointerException caused by forward reference in object initialization
- Add webhook URLs for Issuer/Holder/Verifier roles in vdr_neoprism.conf
  to support ListenToEvents ability required by DID publishing tests
- Fix duplicate version line in agents config

Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
- Fix NeoPrismVdrService to compute entry hash as sha256(PrismOperation)
  locally instead of relying on server-provided hash. Both cloud-agent
  and neoprism must produce identical hashes per the VDR specification.

- Fix PrismNodeVdrOperationSigner signedWith field to use just the key
  name (e.g. "vdr-1") instead of full DID#key format, respecting
  neoprism's 50-char PublicKeyId limit.

- Remove operation_hashes from NeoPrismSubmissionResult — the entry
  hash is deterministic and computed client-side.

- Unify VDR ledger integration tests: replace separate neoprism and
  prism-node feature files with a single manage_vdr_ledger.feature
  parameterized by VDR_LEDGER_DRIVER env var. Both test_neoprism.sh
  and test_prism_node.sh now run the same 116 scenarios.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
yshyn-iohk and others added 3 commits March 5, 2026 01:03
… VdrDriver

- Simplify submitSignedOperation to delegate to submitVdrOperation,
  eliminating ~30 lines of duplicated HTTP call logic.
- Add isLedgerBacked property to VdrDriver enum, replacing repeated
  `driver == PRISM_NODE || driver == NEOPRISM` checks across test steps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
…rameter

Add missing neoPrismService: Option[VdrService] parameter (None) to all
VdrServiceImpl constructor calls and add two new tests verifying neoprism
routing: create with drid=neoprism and read with neoprism URL.

Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add driver comparison table, mermaid architecture diagram, and updated
prerequisites listing all 5 VDR drivers (memory, database, neoprism,
prism-node, PRISM blockfrost) with their enable flags and use cases.

Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
yshyn-iohk and others added 3 commits March 6, 2026 02:26
Update the metadata endpoint URL from /api/vdr-entries/{hash} to
/api/vdr-data/{hash}/metadata to match the neoprism API change.

Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
NeoPrismClient:
- Fix bug: getResolutionMetadata treated HTTP errors (500, etc) as 200
- Extract decodeJson() and unexpectedStatus() helpers to eliminate
  repeated JSON decode and error-handling boilerplate across 6 methods
- Add comment explaining NeoPrismDidDocument is only for JSON shape

VdrService (proxy router):
- Remove dead code: unused refineVdrError extension method
- Extract routeByUrl() helper to deduplicate the three-way neoprism >
  prism-node > proxy routing pattern in update/read/delete
- Remove redundant enableNeoPrismDriver boolean from Config; the
  presence of neoPrismClient: Option already captures enabled state

NeoPrismVdrService:
- Remove unused NeoPrismVdrEntryMetadata import
- Rename extractHash() to extractFragment() with clearer implementation
- Add warning log to verify() stub so callers know it's not implemented

Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Mar 6, 2026

Copy link
Copy Markdown

@yshyn-iohk
yshyn-iohk enabled auto-merge (squash) March 6, 2026 12:48
@yshyn-iohk
yshyn-iohk merged commit e7bddd3 into main Mar 6, 2026
11 of 13 checks passed
@yshyn-iohk
yshyn-iohk deleted the vdr-driver-3 branch March 6, 2026 13:05
Yummy-Yums pushed a commit to Yummy-Yums/cloud-agent that referenced this pull request Jul 16, 2026
## [2.2.0](hyperledger-identus/cloud-agent@v2.1.0...v2.2.0) (2026-06-09)

### Features

* add PRISM VDR driver integration ([hyperledger-identus#1671](hyperledger-identus#1671)) ([f48add8](hyperledger-identus@f48add8))
* add VDR capabilities to the cloud-agent using the prism-node ([hyperledger-identus#1685](hyperledger-identus#1685)) ([9931f22](hyperledger-identus@9931f22))
* support NeoPRISM as node backend ([hyperledger-identus#1693](hyperledger-identus#1693)) ([e1a5af2](hyperledger-identus@e1a5af2))
* token permissions and remove codeql ([hyperledger-identus#1665](hyperledger-identus#1665)) ([2f2f1ca](hyperledger-identus@2f2f1ca))
* VDR driver leftovers and improvements ([hyperledger-identus#1712](hyperledger-identus#1712)) ([679e1b8](hyperledger-identus@679e1b8))
* **vdr:** add NeoPrism REST API as VDR backend ([hyperledger-identus#1728](hyperledger-identus#1728)) ([e7bddd3](hyperledger-identus@e7bddd3))

### Bug Fixes

* add allstar exception for thr binaries ([hyperledger-identus#1683](hyperledger-identus#1683)) ([c5980cb](hyperledger-identus@c5980cb))
* **ci:** update neoprism version and fix VDR cucumber tag ([hyperledger-identus#1729](hyperledger-identus#1729)) ([1224017](hyperledger-identus@1224017))
* correct typos, API endpoint documentation and error responses ([hyperledger-identus#1768](hyperledger-identus#1768)) ([18761bd](hyperledger-identus@18761bd))
* docker image ([hyperledger-identus#1639](hyperledger-identus#1639)) ([7a19081](hyperledger-identus@7a19081))
* **docs:** correct glossary link paths in connectionless present-proof ([hyperledger-identus#1796](hyperledger-identus#1796)) ([e1e8be1](hyperledger-identus@e1e8be1))
* **docs:** correct relative link path in VDR manage tutorial ([hyperledger-identus#1737](hyperledger-identus#1737)) ([55a5e4e](hyperledger-identus@55a5e4e))
* pipeline script ([hyperledger-identus#1676](hyperledger-identus#1676)) ([86ac86f](hyperledger-identus@86ac86f))
* remove checksum bypass and pin java-multibase to v1.1.1 ([hyperledger-identus#1769](hyperledger-identus#1769)) ([dddf7fb](hyperledger-identus@dddf7fb))
* **tests:** pin published snapshot and drop invalid github packages repo ([hyperledger-identus#1805](hyperledger-identus#1805)) ([81d2cb3](hyperledger-identus@81d2cb3))
* token permissions ([hyperledger-identus#1666](hyperledger-identus#1666)) ([518c094](hyperledger-identus@518c094))
* Token-Permissions  ([hyperledger-identus#1678](hyperledger-identus#1678)) ([adc81b1](hyperledger-identus@adc81b1))
 [skip ci]

Signed-off-by: Hyperledger Bot <hyperledger-bot@hyperledger.org>
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.

2 participants