feat(sdk): add extension auth for middleware E2E - #2784
Conversation
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
🌿 Preview your docs: https://nvidia-preview-pr-2784.docs.buildwithfern.com/openshell |
|
/ok to test 3128169 |
|
Label |
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
PR Review StatusValidation: Project-valid maintainer-authored work implementing the authenticated supervisor-middleware SDK direction tracked by #1733, with follow-up scope tracked in #2794. Blocking findings:
Carried findings:
Non-blocking suggestions:
Docs: The SDK README and the relevant Fern supervisor-middleware documentation are updated; no navigation change is needed for the existing page. Checks: Branch Checks and Helm Lint passed. The required Next state: Gator is blocked pending an authorized rerun of the current-head E2E workflow. No rerun was performed by gator. Next action: a maintainer or the operator must authorize or perform the rerun of workflow run 32296038035. |
Summary
Establish the first Rust SDK surface for building OpenShell extension services and add authenticated supervisor middleware end-to-end coverage.
This PR intentionally starts with a narrow foundation: the opt-in
openshell-sdkextensionfeature provides service-side caller verification, and one Docker E2E proves the complete gateway → sandbox supervisor → authenticated middleware → upstream HTTP path. The middleware replaces sensitive content and adds a header before the request reaches the upstream.Related Issue
Related to #1733.
Follow-up coverage and SDK adoption are tracked in #2794.
SDK Direction
The
extensionmodule is intended to become the Rust SDK for implementing extension services. As it grows, the SDK should own common lifecycle concerns such as service interfaces, authentication before handler dispatch, key caching and refresh after trusted bootstrap, protocol lifecycle validation, consistent errors, and observability. Extension authors should primarily implement manifests, configuration validation, and request or message business logic.Rust is the initial proving ground, not a Rust-only extension model. OpenShell's other language SDKs should provide equivalent extension support within their existing packages rather than introducing a separate family of extension packages. The cross-language API shape still needs dedicated design work so each SDK remains idiomatic while sharing the same lifecycle, trust, and interoperability guarantees.
The deployment must continue to provide cold-start trust configuration, including the trusted gateway identity, issuer, audience, and CA or initial verification keys. Extension-specific authorization also remains application-owned. In this initial PR, key refresh remains deployment-owned and middleware protobuf interfaces still come from the existing core surface.
Alternative Considered
We considered publishing a dedicated extension SDK, separate from the existing API SDK in each language. Keeping extension support in the regular SDKs gives OpenShell fewer packages, release paths, and dependency surfaces to maintain. It also reflects the expected usage model: extensions will likely call OpenShell APIs in addition to implementing service interfaces.
A unified SDK can eventually provide an extension-oriented API client wrapper with the appropriate authentication configured for extension-to-OpenShell calls. This avoids requiring extension authors to combine and configure two SDK families themselves. Cargo features and language-appropriate modules can preserve an opt-in boundary without introducing separate packages.
Changes
openshell-sdkextensionfeature with self-contained caller authentication from trusted Ed25519 keys or JWKS, strict token and identity validation, and typed authenticated caller information without a directopenshell-extension-coredependency.Follow-up
Issue #2794 tracks the next layer of work:
examples/supervisor-middleware-content-guardto the SDK and use it as the behavioral E2E fixturekid, algorithm, time bounds, claim shape, and JWKS validationTesting
mise run pre-commitpassesmise run e2e:supervisor-middlewarepasses against a Docker-backed gatewayChecklist