Skip to content

fix(webvh): decode the daemon's camelCase DID-management response - #609

Merged
stormer78 merged 1 commit into
mainfrom
fix/requesturi-camelcase
Jul 2, 2026
Merged

fix(webvh): decode the daemon's camelCase DID-management response#609
stormer78 merged 1 commit into
mainfrom
fix/requesturi-camelcase

Conversation

@stormer78

Copy link
Copy Markdown
Contributor

Problem

After a VTA authenticates + is authorized to a did-hosting-daemon (via #604, #606, and affinidi-webvh-service#55), the publish path fails at path reservation: webvh-server response parse error: error decoding response body for POST /api/dids.

The daemon's RequestUriResponse (did-hosting-common/src/types.rs) carries #[serde(rename_all = "camelCase")], so it serializes did_url as didUrl. The VTA's mirror RequestUriResponse (vta-service/src/webvh_client.rs) lacked the rename and expected snake_case did_url → serde fails to decode → the whole publish path (both POST /api/dids and POST /api/dids/register, which reuse this type) breaks.

Fix

Add #[serde(rename_all = "camelCase")] to the VTA's RequestUriResponse — the same wire-alignment #606 applied to the auth response types. One attribute; no behavior change beyond decoding the daemon's actual shape.

Test

request_uri_response_deserializes_camelcase_daemon_body deserializes the daemon's real body {"mnemonic":"...","didUrl":"..."} and asserts both fields populate.

cargo test/clippy/fmt -p vta-service --features webvh,didcomm green.

Context

Found in a live cross-service run (a VTA provisioning a did:webvh agent with a WEBVH_SERVER). With this, path reservation decodes and the flow proceeds to log publication. (A separate daemon-side issue then surfaces: the publish path's IDNA host validation rejects the percent-encoded host%3Aport form of a did:webvh identifier for non-standard-port hosts — filed/handled separately.)

The VTA's RequestUriResponse mirror (POST /api/dids reserve + /api/dids/register)
lacked #[serde(rename_all = "camelCase")], but the daemon
(did-hosting-common::RequestUriResponse) serializes camelCase — so `did_url`
arrives as `didUrl` and the body failed to decode ("webvh-server response parse
error"), breaking the publish path right after auth succeeded.

Add the camelCase rename to match the daemon (the same alignment #606 applied to
the auth response wire types). Regression test deserializes the daemon's real
`{mnemonic, didUrl}` body.

Signed-off-by: Glenn Gore <glenn@affinidi.com>
@stormer78
stormer78 requested a review from a team as a code owner July 2, 2026 11:35
@stormer78
stormer78 merged commit 461987f into main Jul 2, 2026
9 of 10 checks passed
@stormer78
stormer78 deleted the fix/requesturi-camelcase branch July 2, 2026 11:36
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