pdk-contracts-lib 1.10.0

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:
//!
//! - [`basic_auth`]: helpers to parse HTTP Basic `Authorization` headers.
//! - [`credentials`]: typed newtypes for client credentials.
//!
//! Internal submodule `authentication` and `authorization` implement the
//! underlying logic and are not exported.

pub mod basic_auth;
#[cfg(feature = "experimental_contracts_v2")]
pub mod contracts;
pub mod credentials;
pub mod error;

/// 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>,
}