1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! Transport-agnostic query client for the Affinidi Trust Registry.
//!
//! Queries are TRQP authorization/recognition checks carried as **Trust Task
//! documents** (`registry/authorization/0.1`, `registry/recognition/0.1` from
//! [`trust_tasks_rs::specs::registry`]) — the same contract the registry
//! serves over every transport. The document is the protocol; a transport is
//! only a pipe that moves one request document and returns the peer's reply
//! document (see [`TrqlTransport`]).
//!
//! Three bindings are provided behind features:
//!
//! * `https` (default) — [`HttpsTransport`]: `POST <registry>/trust-tasks`,
//! the `trust-tasks-https` wire contract.
//! * `didcomm` — [`DidcommTransport`]: the `trust-tasks-didcomm` envelope over
//! an ATM mediator websocket.
//! * `tsp` — [`TspTransport`]: the `trust-tasks-tsp` envelope sealed in a TSP
//! `Direct` message, multiplexed on the same mediator websocket.
//!
//! Every reply is correlated to its request (`threadId` == request `id`) and
//! a reply that cannot be parsed is surfaced as a contract error, never as a
//! transport failure. A registry rejection arrives as a typed
//! [`TrqlError::Rejected`] carrying the machine-readable trust-task-error
//! code.
//!
//! ```rust,ignore
//! use std::sync::Arc;
//! use trql_client::{HttpsTransport, HttpsTransportConfig, TrqlClient, TrqpQuery};
//!
//! let transport = HttpsTransport::new(HttpsTransportConfig::new("http://localhost:3232"))?;
//! let client = TrqlClient::new(Arc::new(transport), "did:webvh:...registry");
//!
//! let response = client
//! .authorization(TrqpQuery::new(
//! "did:webvh:...signer", // entity
//! "did:webvh:...authority", // authority
//! "git.commit.sign", // action
//! "openvtc", // resource
//! ))
//! .await?;
//! if response.authorized { /* ... */ }
//! ```
pub use ;
pub use ;
pub use TrqlError;
pub use ;
pub use ;
pub use ;
pub use ;
/// The generated request/response payload types this client speaks, re-exported
/// so consumers don't need a direct `trust-tasks-rs` dependency for the basics.