smbcloud_ascapi_frontend/lib.rs
1//! Operations shared by the `ascapi` command line and its MCP server.
2//!
3//! Both surfaces need the same things: resolve credentials, call the App
4//! Store Connect client, and shape the result into something worth showing
5//! a human or handing a model. Putting that here means the two front ends
6//! cannot drift, and in particular that the ordering guarantee in
7//! [`certificates::issue_certificate`] (private key written before the
8//! network call) has exactly one implementation.
9//!
10//! Two rules the result types are built around, because one of the
11//! consumers is a language model:
12//!
13//! - **No key material in a result.** [`certificates::IssuedCertificate`]
14//! carries the path a key was written to, never the key. Enforced by
15//! construction rather than filtered at the edge, since a filter is one
16//! refactor away from being bypassed.
17//! - **No certificate bodies either.** They are large, never needed to
18//! decide what to do next, and would otherwise land in a transcript.
19//! [`profiles::ProfileSummary`] applies the same rule to
20//! `profileContent`, and [`profiles::download_profile`] returns the path
21//! it wrote instead.
22
23pub mod certificates;
24pub mod enums;
25pub mod env;
26pub mod profiles;
27pub mod time;
28
29pub use certificates::{
30 certificate_type_from_str, issue_certificate, CertificateSummary, IssuedCertificate,
31};
32pub use enums::{bundle_id_platform_from_str, display_type_from_str, platform_from_str};
33pub use env::api_key_from_env;
34pub use profiles::{download_profile, profile_type_from_str, DownloadedProfile, ProfileSummary};
35pub use time::{is_expired, now_iso8601};