Skip to content

sdk: DirectoryClient::publish omits X-Capsule-Identity-Key, so every publish is a 400 against the real server #466

Description

@justin13888

What

capsule_sdk::directory::DirectoryClient::publish (capsule-sdk/src/directory.rs) posts the CBOR directory with only Content-Type. The server's publish_device_directory (capsule-server/src/routes/directory.rs) requires X-Capsule-Identity-Key (invariant 23's second clause, S-C42) and answers 400 error.directory.malformed ("X-Capsule-Identity-Key is required") without it.

Nothing exercises the SDK's publish against the router: capsule-server/tests/sdk_client.rs anchors directories through the fixture's own test client.

Evidence

Found while landing capsule-e2e (#409, PR #463): the harness publishes the directory through Session::execute with the header (capsule-e2e/src/lib.rs, Device::publish_directory) because the SDK client cannot. That hand-written request should go away when this is fixed.

Fix shape

publish takes (or the client is constructed with) the user identity verifying key and sends it base64 in X-Capsule-Identity-Key; add a socket test in sdk_client.rs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions