Skip to main content

pdk_core/
lib.rs

1// Copyright (c) 2026, Salesforce, Inc.,
2// All rights reserved.
3// For full license text, see the LICENSE.txt file
4
5//! PDK Core
6//!
7//! This crate contains functionality that is specific for Flex Gateway.
8//! It does not apply for all proxy_wasm hosts.
9
10pub use classy;
11pub(crate) use classy::DefaultHost as Host;
12pub(crate) use classy::Host as HostTrait;
13pub use pdk_macros::entrypoint;
14
15pub use crate::log as logger;
16
17mod middleware;
18
19#[allow(dead_code)]
20mod bindings;
21pub mod client;
22pub mod host;
23pub mod init;
24pub mod log;
25pub mod policy_context;
26
27// Available under the legacy `--cfg fips` build flag (workspace-wide FIPS build,
28// still used by contracts-lib) or the Cargo `fips` feature (opted into by
29// pdk-jwt-lib's feature-based fips backend, which must build without RUSTFLAGS).
30#[cfg(any(fips, feature = "fips"))]
31pub mod ffi {
32    pub use protobuf::Error as ProtobufError;
33    pub use protobuf::Message;
34
35    mod private {
36        include!(concat!(env!("OUT_DIR"), "/protos/mod.rs"));
37    }
38
39    // Explicit re-exports (not globs): each generated proto module also defines
40    // a `file_descriptor()` fn, so globbing all three collides on that name.
41    pub use private::get_sha_digest::{GetShaDigestArguments, GetShaDigestResult};
42    pub use private::sign::{SignArguments, SignResult};
43    pub use private::verify_signature::{VerifySignatureArguments, VerifySignatureResult};
44}