Add PATCH /instances/{id} for egress proxy secret rotation#157
Draft
sjmiller609 wants to merge 2 commits intomainfrom
Draft
Add PATCH /instances/{id} for egress proxy secret rotation#157sjmiller609 wants to merge 2 commits intomainfrom
sjmiller609 wants to merge 2 commits intomainfrom
Conversation
Allow updating env values (credential secrets) on a running instance
without restart. The egress proxy inject rules are atomically replaced
so rotated keys take effect on the next outbound HTTPS request.
Changes:
- egressproxy.Service.UpdateInstanceInjectRules: swap inject rules
for an already-registered instance without re-applying iptables
- manager.UpdateInstance: merge env, validate credential bindings,
refresh proxy rules, persist metadata
- PATCH /instances/{id} API endpoint (OpenAPI + handler + codegen)
- Integration test: create instance, verify initial key, rotate via
UpdateInstance, verify rotated key is injected
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✱ Stainless preview buildsThis PR will update the Edit this comment to update it. It will appear in the SDK's changelogs. ✅ hypeman-typescript studio · code · diff
✅ hypeman-openapi studio · code · diff
✅ hypeman-go studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
- Add UpdateInstance stub to mockInstanceManager in lib/builds
- Add PATCH /instances/{id} to RouteScopes (InstanceWrite)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
PATCH /instances/{id}API endpoint to update env values on a running instanceChanges
lib/egressproxy/service.go: NewUpdateInstanceInjectRulesmethod that swaps inject rules for an already-registered instance without re-applying iptables enforcementlib/instances/egress_proxy.go: NewupdateInstanceimplementation — merges env values, validates credential bindings, refreshes proxy rules, persists metadatalib/instances/manager.go:UpdateInstanceadded to Manager interface with instance-level lockinglib/instances/types.go:UpdateInstanceRequesttypeopenapi.yaml+lib/oapi/oapi.go: PATCH endpoint schema and codegencmd/api/api/instances.go: API handler following existing patternslib/instances/egress_proxy_integration_test.go: New integration test that creates instance with credentials, verifies initial key injection, rotates via UpdateInstance, and verifies the rotated key is picked upTest plan
go test ./lib/instances/... ./lib/egressproxy/...)TestEgressProxySecretUpdateOnRunningInstanceverifies end-to-end flowgo build ./...)