cleanlib_client/lib.rs
1// CleanLibrary shared client library — HTTP / auth / telemetry surface
2// shared between Rust CLI (cleanlib-cli) and any other Rust consumers.
3// Telemetry transport impl lands in subsequent CLEANLIB-N PRs per Client
4// spec rev1 §7.
5
6pub mod attestation_verify;
7pub mod config;
8pub mod customer_state;
9pub mod derive_status;
10pub mod ecosystem_detect;
11pub mod envelope;
12pub mod errors;
13pub mod gate;
14pub mod integrity;
15pub mod proxy;
16pub mod risk_acceptance;
17pub mod transport;
18pub mod types;
19pub mod verdict_to_envelope;
20
21// Re-exports — load-bearing surface for sibling-crate consumers (cleanlib-cli,
22// cleanlib-app integration tests) so they import via `cleanlib_client::*`
23// without reaching into module paths.
24pub use customer_state::{CustomerState, Tier};
25// CLEANLIB-657 (CX-8 P1-b): the verdict()/enforce() dual consumption API — a
26// blocked verdict is a returned value, a couldn't-assess is the exception.
27pub use gate::{enforce, verdict, Assessment, GateError};
28pub use ecosystem_detect::ecosystem_from_path;
29pub use derive_status::{derive_status, DerivedStatus};
30pub use envelope::{ReasonCode, Status, VerdictEnvelopeV1, ALL_REASON_CODES, ALL_VERDICT_SOURCES};
31pub use verdict_to_envelope::verdict_to_envelope_v1;
32
33// CLEANLIB-126 M1″ — extern-consumer surface re-exports (cycle-13).
34// Per cycle-13 R5-Lane-2 F2: third-party consumers importing
35// `cleanlib_client::{Client, Verdict, PolicyDecision}` previously hit
36// `error[E0432]: unresolved imports` because the types lived behind
37// module paths. Re-export at crate-root so the public API matches the
38// documented surface (cf. docs-site SDK-Rust.md customer page).
39pub use transport::{Client, RemediationOutcome};
40pub use types::{PolicyDecision, PreviousVerdict, Verdict};
41// Cosign gate 3 (Q6=a): capability-not-policy attestation verify. Nothing
42// calls this automatically — an integrator opts in explicitly (Q14).
43pub use attestation_verify::{
44 verify_attestation, AttestationKeyLookup, PubkeysEndpointLookup, DEFAULT_PUBKEY_CACHE_TTL,
45};
46// CLEANLIB-536: RFC 9457 problem+json surface — consumers match on
47// `CleanLibraryError::Problem { problem }` and branch on `problem.reason_class`.
48pub use errors::{CleanLibraryError, ProblemDetails};