pdk-contracts-lib 1.9.1-alpha.2

PDK Contracts Library
Documentation
// Copyright (c) 2026, Salesforce, Inc.,
// All rights reserved.
// For full license text, see the LICENSE.txt file

//! Contracts API surface
//!
//! Public API for validating client credentials against API contracts pulled
//! from Anypoint Platform. This module exposes:
//!
//! - [`validator`]: the [`ContractValidator`] type used to fetch/update contracts and
//!   perform `authorize` and `authenticate` operations.
//! - [`basic_auth`]: helpers to parse HTTP Basic `Authorization` headers.
//! - [`credentials`]: typed newtypes for client credentials.
//! - [`error`]: error types for authentication/authorization/update flows.
//!
//! Internal submodules `authentication` and `authorization` implement the
//! underlying logic and are not exported.

pub mod basic_auth;
pub mod credentials;
pub mod error;
pub mod validator;

mod authentication;
mod authorization;
mod tracker;

/// The information regarding the client that was authenticated or authorized.
#[derive(Clone, Debug)]
pub struct ClientData {
    /// The client id validated, it is the same as the one provided in the validation.
    pub client_id: String,
    /// The client name associated with validated client.
    pub client_name: String,
    /// The SLA associated to the client id.
    pub sla_id: Option<String>,
}