ff_core/waitpoint_hmac.rs
1//! Consumer-facing import path for the waitpoint HMAC wire types and
2//! rotation args.
3//!
4//! **v0.7 migration-master Q4.** Today (Valkey backend) all
5//! signing and verification of waitpoint HMAC tokens happens
6//! **server-side inside the FlowFabric Lua library** — the
7//! `ff_sign_waitpoint_token` / `ff_validate_waitpoint_token` FCALLs
8//! read the per-partition `waitpoint_hmac_secrets` hash under the
9//! same redis.call("TIME") clock as suspension / signal delivery.
10//! There is no pure-Rust sign or verify code in the workspace, and
11//! the v0.7 Postgres backend (Wave 4) will continue the pattern via
12//! stored procedures on the global `ff_waitpoint_hmac(kid, secret,
13//! rotated_at)` table.
14//!
15//! This module exists so external crates have ONE stable path
16//! (`ff_core::waitpoint_hmac`) to import the wire-token type, the
17//! per-partition keystore snapshot shape, and the rotation Args /
18//! Result shapes from. Re-exports from `ff_core::backend` and
19//! `ff_core::contracts` — no new types live here and no logic runs
20//! through this module.
21//!
22//! # Signing + verification location
23//!
24//! | Backend | Where `sign` lives | Where `verify` lives |
25//! |----------|-------------------------------------------------------|--------------------------------------------------------|
26//! | Valkey | `lua/waitpoint_hmac.lua` (FCALL `ff_sign_waitpoint_token`) | `lua/waitpoint_hmac.lua` (FCALL `ff_validate_waitpoint_token`) |
27//! | Postgres | Wave-4 stored proc on `ff_waitpoint_hmac` | Wave-4 stored proc on `ff_waitpoint_hmac` |
28//!
29//! Consumers never touch the raw HMAC-SHA256 computation from Rust —
30//! the backend owns the secret material, so the signing / verifying
31//! code runs co-located with the key-storage primitive on each
32//! backend.
33//!
34//! # Rotation
35//!
36//! See [`EngineBackend::rotate_waitpoint_hmac_secret_all`](crate::engine_backend::EngineBackend::rotate_waitpoint_hmac_secret_all)
37//! for the cluster-wide rotation method added in v0.7. The existing
38//! per-partition free-function helper
39//! [`ff_sdk::admin::rotate_waitpoint_hmac_secret_all_partitions`]
40//! stays available for direct-Valkey consumers on older SDKs.
41
42pub use crate::backend::WaitpointHmac;
43pub use crate::contracts::{
44 ListWaitpointHmacKidsArgs, RotateWaitpointHmacSecretAllArgs,
45 RotateWaitpointHmacSecretAllEntry, RotateWaitpointHmacSecretAllResult,
46 RotateWaitpointHmacSecretArgs, RotateWaitpointHmacSecretOutcome, VerifyingKid,
47 WaitpointHmacKids,
48};