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
84
85
86
87
88
89
90
91
92
93
//! Rust client for canopy's public API.
//!
//! The wire types and the per-endpoint methods in [`schema`] are generated from
//! canopy's OpenAPI document, which lives in the same repository as this crate,
//! so they are the types canopy declares rather than a separate description of
//! them. The document and this crate carry the same version.
//!
//! # Calling canopy
//!
//! [`CanopyClient`] has one method per operation, taking and returning the
//! generated types. The method name comes from the path (`/backup-credentials`
//! becomes `backup_credentials`), with the verb prefixed where a path is served
//! by more than one verb.
//!
//! How a request reaches canopy is the consumer's to decide: this crate depends
//! on no HTTP client, and a consumer supplies a [`CanopyTransport`] which
//! resolves the host, the scheme, and the authentication itself. Any status
//! outside the success range surfaces as [`CanopyHttpError`], since endpoints
//! give particular statuses a meaning only the caller can read.
//!
//! # What the generated types carry
//!
//! Timestamp fields are [`jiff::Timestamp`] rather than text, and credential
//! secrets are wrapped in [`Redacted`] so they stay out of `Debug` output and
//! logs; read them through the inner value. Schemas that carry arbitrary further
//! keys alongside their declared fields generate a map field holding the rest, so
//! those keys can be both sent and read.
//!
//! Generated structs are `#[non_exhaustive]` and carry a builder, so a schema
//! gaining a field leaves construction working for a consumer that does not set
//! it.
use fmt;
use ;
/// Wire types and per-endpoint methods generated from canopy's OpenAPI document.
///
/// Regenerate with `just gen-api` after changing the public API; the generated
/// source is committed, so a change to this surface appears in the change that
/// causes it.
pub use async_trait;
pub use CanopyClient;
pub use ;
pub use ;
pub use ;
/// Wraps a sensitive value so its `Debug` output doesn't leak the contents.
///
/// Serialises and deserialises as the inner value, so it is transparent on the
/// wire; only `Debug` is withheld. Read the value through [`Deref`](std::ops::Deref)
/// or the public field.
;