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
//! Rust SDK for the mountOS provider API.
//!
//! Wraps the appserv provider API (`/api/v1/*`) with ED25519 JWT authentication.
//! Construct a [`Client`] from a [`Config`] and call typed methods grouped by
//! resource, e.g. `client.accounts.list(..)`.
//!
//! ```no_run
//! use mountos_admin_sdk::{Client, Config};
//!
//! # async fn run() -> Result<(), mountos_admin_sdk::Error> {
//! let client = Client::new(Config::new(
//! "https://appserv.example.com",
//! "<base64 ED25519 key>",
//! ))?;
//!
//! let account = client.accounts.get(1).await?;
//! println!("{}", account.name);
//! # Ok(())
//! # }
//! ```
//!
//! Public structs and enums are `#[non_exhaustive]`. Build a struct with `new(required...)`,
//! `Default` and the `with_<field>` setters, not with a struct literal:
//!
//! ```
//! use mountos_admin_sdk::{AccountListOptions, CreateAccountRequest};
//!
//! let req = CreateAccountRequest::new("Acme").with_description("Demo account");
//! let opts = AccountListOptions::default().with_page(1).with_limit(10);
//! # let _ = (req, opts);
//! ```
//!
//! The `private_key` is a base64-encoded ED25519 key - either a 32-byte seed or
//! a 64-byte seed+public-key. JWT tokens are signed locally and cached for ~55
//! minutes (1h TTL with a 5-minute refresh margin).
// Public structs and enums stay non_exhaustive so a new field or variant is not a breaking change.
// Compiles and runs the README snippets as doc tests.
;
// Generated files are not rustfmt-clean by construction.
pub use *;
pub use ;
pub use sign_dashboard_user;
pub use Error;
pub use *;
pub use *;
// Re-exported so callers can build `serde_json::Value` fields (e.g.
// `provider_info`) without taking their own version-matched dependency.
pub use serde_json;