Skip to main content

Crate vtc_client

Crate vtc_client 

Source
Expand description

Client SDK for a Verifiable Trust Community (VTC).

The VTA SDK (vta_sdk) is the client for VTAs; this crate is the equivalent for VTCs. It lets an operator or an integration drive a VTC’s member-facing and admin-facing surface over REST: authenticate, list members (the community roster), run the join ceremony, remove members, and manage community policy.

It is deliberately thin: authentication reuses vta_sdk::auth_light::challenge_response_light (the challenge-response flow is audience-agnostic — pass the VTC’s URL and DID and the server binds aud to itself), and the join wire types are re-exported from vta_sdk::protocols::join_requests. Only the VTC-specific REST shapes (member records, pagination) are defined here.

§Mount path

A VTC mounts its API under a configurable base (default /v1). Pass the full API base to VtcClient::connect / VtcClient::with_token — e.g. https://vtc.example.com/v1 — so both /auth/* and /members resolve.

§The Trust-Task header is mandatory

The VTC gates every route on a per-route Trust-Task URL header (vtc-service/src/routes/mod.rs, the tt(...) wrapper) and answers 400 without it — only /health and the browser wallet’s /wallet/auth/* aliases are exempt. This client sent it on nothing, so every method failed at the transport layer regardless of its body. task holds the URL for each route and VtcClient::tt attaches it; a new method must go through that helper, not a bare self.http.get(...).

§Scope

Authentication, the member roster, the admin join queue, removal, policy, and the applicant side of the join ceremony (VtcClient::submit_join, which signs its own document and needs no token).

Modules§

join_requests
Re-export of the published join-request protocol wire types, so a consumer driving the join ceremony depends on one crate. Trust Task wire types for the VTC join-request ceremony family.
rooms
The Trust-Task URL each route this client calls is gated on, as declared in vtc-service/src/routes/mod.rs.
task

Structs§

DecideResult
Outcome of approving or rejecting a join request.
JoinRequestSummary
A join request in the admin work queue (subset of the VTC’s JoinRequest).
MemberRecord
A single member of the community, as returned by GET /members. Mirrors the VTC’s MemberResponse (the fields a fleet/operator typically needs); unrecognised fields in the response are ignored.
RemoveResult
Outcome of removing a member (offboarding). The VTC flips the member’s status-list revocation bit as part of removal.
VtcClient
A client bound to one VTC’s API base, holding a bearer token once authenticated.

Enums§

VtcError
Errors surfaced by the VTC client.