fix: security hardening + bearer token auth for SDK#1
Merged
Conversation
…ation When bearerToken is set in StewardClientConfig, the client sends Authorization: Bearer <token> instead of X-Steward-Key. bearerToken takes precedence when both are provided. This enables agent-scoped JWT authentication used in production Steward deployments.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Security hardening pass plus critical auth fix for the SDK client.
Security Fixes
Separate JWT secret from master password — New
STEWARD_JWT_SECRETenv var. Falls back to master password with warning if not set.Bind to localhost by default — Steward now binds to
127.0.0.1instead of0.0.0.0. Configurable viaSTEWARD_BIND_HOST.Request body size limit — 1MB limit via Hono middleware to prevent memory exhaustion.
Request correlation IDs — Every request gets a
X-Request-IdUUID, returned in response headers and included in logs.SDK Auth Fix (Critical)
Bearer token auth for agent-scoped JWTs —
StewardClientnow accepts abearerTokenconfig option that sendsAuthorization: Bearer <token>instead ofX-Steward-Key. This enables agent containers to authenticate with their JWT tokens.Previously, the SDK only supported tenant API key auth (
X-Steward-Key), but production agents use JWT tokens. This mismatch caused all containers to silently fall back to local signing.Environment Variables
STEWARD_JWT_SECRETSTEWARD_BIND_HOST127.0.0.1Testing