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