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
// Copyright (c) 2026, Salesforce, Inc.,
// All rights reserved.
// For full license text, see the LICENSE.txt file
//! PDK Contracts Library
//!
//! Library for validating client credentials against Anypoint Platform API contracts
//! in Flex Gateway custom policies. It periodically fetches contracts from the
//! platform and keeps a local cache to enable fast authentication and authorization
//! decisions within the policy request path.
//!
//! ## Highlights
//!
//! - Local contracts cache with concurrency-safe updates
//! - Periodic polling and incremental updates from the platform
//! - Authorization via `client_id` and authentication via `client_id`/`client_secret`
//! - Helpers to parse HTTP Basic Auth credentials
//!
//! ## Primary types
//!
//! - [`ContractValidator`]: contracts fetch/update plus `authenticate` and `authorize`
//! - [`ClientData`]: resolved client metadata for successful validations
//! - [`basic_auth_credentials`]: parse the HTTP Basic `Authorization` header
//! - [`BasicAuthError`]
//!
//! ## Readiness and polling cadence
//!
//! - Use [`ContractValidator::is_ready`] to check if contracts have been pulled and cached locally.
//! - Call [`ContractValidator::update_contracts`] periodically. During startup, invoke it every
//! [`ContractValidator::INITIALIZATION_PERIOD`]. After initialization, invoke it every
//! [`ContractValidator::UPDATE_PERIOD`].
//!
pub
pub
pub use ;
pub use *;
pub use *;
pub use ContractValidator;
pub use ClientData;