pdk-cors-lib 1.7.0

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

//! PDK CORS Library
//!
//! Library for validating CORS requests and producing CORS responses in Flex Gateway custom
//! policies. It evaluates request headers against a provided configuration and
//! returns the appropriate CORS response headers for preflight and main flows.
//!
//! ## Primary types
//!
//! - [`Configuration`]: defines CORS policy (origin groups, methods, headers, credentials)
//! - [`Cors`]: performs checks for incoming requests and computes response headers
//! - [`Check`]: result containing the response type and computed headers
//! - [`ResponseType`]: `Preflight` or `Main`
//! - [`CorsError`]: error type for invalid inputs or configuration
//!

mod model;

mod configuration;
mod error;

pub use configuration::*;
pub use error::CorsError;

mod check;
pub use check::{Check, Cors, ResponseType};

pub(crate) type HeaderValue = str;
pub(crate) type HeaderMap<'a> = [(&'a str, &'a HeaderValue)];