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
{{ message }}
Repository navigation
Commit 94bfecd
Browse filesBrowse the repository at this point in the historyBrowse files
fix(bff): preserve full policy fidelity and fix binary upload corruption
Two HIGH-severity data-integrity regressions from the SDK-migration audit.
1) Policy fidelity (models): the hand-rolled policy<->JSON converter only
serialized 6 endpoint fields, silently dropping L7 allow/deny rules, IP
allowlists, multi-port, MCP options, credential binding, signing, GraphQL
persisted queries, and network middleware on both read AND write — a
sandbox created or a rule edited with those fields lost them before
reaching the gateway, weakening egress policy with no error. Replace it
with a proto round-trip via protojson (policyproto.go ports the SDK's
internal domain<->proto converter, which is not importable), reproducing
the exact camelCase, full-fidelity JSON contract the pre-SDK code emitted.
Unknown-field rejection is preserved. Added a round-trip test over a
fully-populated policy.
2) Binary upload (files): uploads were piped through Exec().Interactive,
which forces a PTY — terminal line discipline (EOF/flow-control bytes,
CR/LF translation, echo) silently corrupts binary payloads. The SDK
exposes no non-TTY stdin exec (Run has no stdin; Interactive forces TTY)
and its file transport is a stub, on latest too. Add a small dedicated
RawExecClient that calls the gateway's ExecSandbox RPC with Stdin bytes
and Tty=false, resolving name->UUID via the SDK first. Uses the same
address/TLS/bearer-forwarding as the main client. Added a bufconn test
proving raw stdin bytes and Tty=false reach the server.
Verified live against a local gateway (v0.0.85, podman): creating a sandbox
with L7 rules / allowedIps / multi-port / denyRules and GETting it back
preserves every field; the upload path issues ExecSandbox (non-TTY), with
zero ExecSandboxInteractive calls.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Gage Krumbach <gkrumbac@redhat.com>
0 commit comments