Conversation
🦋 Changeset detectedLatest commit: 3c74893 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✱ Stainless preview buildsThis PR will update the ✅ stagehand-ruby studio · code
✅ stagehand-go studio · code
|
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant Client as Stainless Client
participant UI as API Consumer UI
participant Gateway as Fastify Gateway
participant Guard as Security Guard
participant SpecGen as OpenAPI Spec Generator
participant SpecFile as openapi.v3.yaml
participant Route as Route Handler V3
participant ModelAPI as External Model API
Note over Client,ModelAPI: Runtime Request Flow
UI->>Gateway: HTTP request with BrowserbaseApiKey & BrowserbaseProjectId
Gateway->>Guard: Validate security requirements
alt ModelApiKey NOT required (current state)
Guard->>Guard: Check BrowserbaseApiKey and BrowserbaseProjectId only
Guard-->>Gateway: Allowed
Gateway->>Route: Forward request
Route->>ModelAPI: Call external model API
ModelAPI-->>Route: Model response
Route-->>UI: Response with model data
else ModelApiKey required (previous state)
Guard->>Guard: Check BrowserbaseApiKey, BrowserbaseProjectId, and ModelApiKey
alt Missing ModelApiKey
Guard-->>Gateway: 401 Unauthorized
Gateway-->>UI: Error response
end
end
Note over SpecGen,SpecFile: OpenAPI Spec Generation (build-time)
SpecGen->>SpecFile: Read existing spec
SpecGen->>SpecFile: Update global security section
SpecFile->>SpecGen: Updated spec with ModelApiKey removed
SpecGen-->>Client: Provide updated spec
Client->>Client: Regenerate client code
Client-->>UI: Updated SDK without ModelApiKey requirement
Note over Gateway,Guard: Security Boundary
Summary
Verification
Summary by cubic
Make the model API key optional by removing
ModelApiKeyfrom server v3 OpenAPI global security (STG-1806). Update the spec/generator in@browserbasehq/stagehand-server-v3and add a patch changeset so Stainless clients no longer require a model key.ModelApiKeyas required auth.Written for commit 3c74893. Summary will update on new commits.