You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Proposal: Extensible Cofferdam HTTP Transport Pipeline
Summary
Add a richer, extensible HTTP client API to Cofferdam so application integrations can reuse Cofferdam's policy enforcement, credential handling, redirect safety, and redacted evidence model without losing application-specific ledgering, response classification, correlation IDs, or retry/replay semantics.
The current cofferdam.http.request(...) helper is useful for simple calls, but larger integrations need more structured lifecycle hooks and richer request/response result objects.
Problem
Some applications need Cofferdam to be the required outbound safety boundary, but they also need their own integration ledger and domain-specific transport handling.
Example: an ERPNext-to-Windmill integration needs to:
run Cofferdam preflight before any bytes leave the server
resolve bearer tokens only after the policy allows the call
record allow/deny decisions in an application-owned attempt ledger
capture exact HTTP status, response headers, elapsed time, raw body, parsed JSON, and exceptions
attach correlation IDs and idempotency keys
classify HTTP success separately from application-level failure
treat a Windmill synchronous HTTP 200 response containing a script error as a failed Windmill execution
ensure retry/replay/scheduler/background-worker/user-triggered sends all go through the same policy-checked transport
The application can build all of this around raw httpx, but then Cofferdam's HTTP helper becomes hard to reuse directly. Ideally, Cofferdam should provide a policy-enforced transport pipeline that is extensible enough for these integrations.
Design Goal
Cofferdam should own:
policy preflight
fail-closed behavior
host/method/operation/credential checks
secret resolution and injection
redirect revalidation before credential forwarding
no-secret request/response snapshots
structured policy decisions
Application code should own:
application ledger writes
correlation ID and idempotency conventions
response classification
business outcome classification
retry/replay semantics
framework-specific persistence
alerting and operational workflows
Proposed API Shape
Introduce a second-generation API alongside the current convenience helper:
Add a structured request object for policy-checked HTTP calls.
Add a structured result object that preserves decision, redacted request snapshot, response snapshot, exception snapshot, elapsed time, and redirect chain.
Add observer/callback hooks for before decision, after decision, before send, after response, and exception.
Allow callers to supply their own httpx.Client or transport for pooling, timeouts, proxies, and tests.
Ensure credentials are resolved and injected only after an allow decision.
Ensure resolved secrets never appear in exceptions, snapshots, hook events, or logs.
Revalidate every redirect target before forwarding credentials.
Provide a dry-run/preflight API that performs no network I/O.
Keep existing cofferdam.http.request(...) working as a simple wrapper.
This would let integrations such as ERPNext-to-Windmill use Cofferdam's HTTP layer directly while still preserving application-owned ledgering, response classification, correlation IDs, retry/replay behavior, and operational evidence.
The core design principle is:
Cofferdam owns outbound execution authority. Applications own business semantics and operational records.
Proposal: Extensible Cofferdam HTTP Transport Pipeline
Summary
Add a richer, extensible HTTP client API to Cofferdam so application integrations can reuse Cofferdam's policy enforcement, credential handling, redirect safety, and redacted evidence model without losing application-specific ledgering, response classification, correlation IDs, or retry/replay semantics.
The current
cofferdam.http.request(...)helper is useful for simple calls, but larger integrations need more structured lifecycle hooks and richer request/response result objects.Problem
Some applications need Cofferdam to be the required outbound safety boundary, but they also need their own integration ledger and domain-specific transport handling.
Example: an ERPNext-to-Windmill integration needs to:
200response containing a script error as a failed Windmill executionThe application can build all of this around raw
httpx, but then Cofferdam's HTTP helper becomes hard to reuse directly. Ideally, Cofferdam should provide a policy-enforced transport pipeline that is extensible enough for these integrations.Design Goal
Cofferdam should own:
Application code should own:
Proposed API Shape
Introduce a second-generation API alongside the current convenience helper:
Request Object
Result Object
The result should preserve transport evidence without exposing secret values.
Snapshot Objects
Headers should be redacted by default for sensitive names such as:
AuthorizationCookieSet-CookieX-Api-KeyX-Auth-TokenHook / Observer Pattern
Support lifecycle hooks via a protocol or callbacks. Prefer composition over inheritance.
Example usage:
An application observer could create/update its own ledger without Cofferdam needing to know about the framework:
Response Classification
Cofferdam should keep application success separate from transport success.
It should provide transport-level facts:
It should not decide whether a response body means application success.
Optionally support a classifier callback:
For example, an ERPNext Windmill integration could classify:
transport_timeoutwindmill_auth_failedwindmill_execution_failedtransport_succeededCofferdam can pass classifier output through without understanding the application domain.
Request Mutation Rules
The API should make it hard to accidentally bypass policy decisions:
Dry-Run / Preflight API
Expose a no-network preflight API:
This lets applications record denied attempts cleanly without preparing or sending a live request.
Compatibility
Keep the existing
cofferdam.http.request(...)helper as a convenience wrapper over the richer client.Simple users can continue to do:
Advanced users can opt into:
httpx.Client/ test transportsAcceptance Criteria
httpx.Clientor transport for pooling, timeouts, proxies, and tests.cofferdam.http.request(...)working as a simple wrapper.Notes
This would let integrations such as ERPNext-to-Windmill use Cofferdam's HTTP layer directly while still preserving application-owned ledgering, response classification, correlation IDs, retry/replay behavior, and operational evidence.
The core design principle is: