Draft
Conversation
Adds an API endpoint to replace credential brokering policies on an existing instance. Since real secrets live host-side and the egress proxy rewrites headers at request time, updating credentials requires no VM changes — hypeman updates stored metadata and the proxy policy. Key changes: - openapi.yaml: UpdateCredentialsRequest schema + PUT endpoint - lib/egressproxy: UpdateInstancePolicy method for atomic rule replacement - lib/instances: UpdateCredentials on Manager interface + implementation - cmd/api/api: UpdateInstanceCredentials handler - Tests: 6 egress proxy tests + 7 instance domain tests 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. |
Credentials included in the request are added or updated by name; credentials not mentioned in the request are left unchanged. This is more useful for secret rotation where you typically rotate one credential at a time without disturbing others. - openapi.yaml: PUT -> PATCH, updated descriptions for merge behavior - lib/instances/update_credentials.go: merge incoming over existing credentials map instead of full replacement - Tests: replaced clear-credentials test with preserve/merge/override tests (9 total, all passing) - lib/oapi/oapi.go: regenerated Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes CI failure: TestAllRoutesHaveScopes requires every registered route to have a scope mapping. Uses InstanceWrite, matching other instance mutation endpoints. 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
Adds
PATCH /instances/{id}/credentialsendpoint for updating/rotating credential brokering policies after instance creation.Since real secrets live host-side and the egress proxy rewrites headers at request time, credential updates require no VM changes.
Merge semantics — only credentials included in the request are updated:
If the instance is running with an active egress proxy, the proxy policy is updated atomically. For stopped/standby instances, the config is persisted and takes effect on next start/restore.
Changes
openapi.yaml—UpdateCredentialsRequestschema +PATCH /instances/{id}/credentialsendpointlib/egressproxy/service.go—UpdateInstancePolicy()for atomic policy replacementlib/egressproxy/types.go—ErrInstanceNotRegisteredsentinel errorlib/instances/update_credentials.go— merge logic: validate, normalize, merge with existing, update proxy, persistlib/instances/manager.go—UpdateCredentialson Manager interfacelib/instances/types.go—UpdateCredentialsRequestdomain typecmd/api/api/instances.go— HTTP handlerlib/egressproxy/README.md— credential rotation docslib/oapi/oapi.go— regeneratedTests
UpdateInstancePolicy(replace, clear, unregistered error, idempotent, isolation, register-then-update)updateCredentials(egress required, env binding validation, merge with existing, override by name, preserve unspecified, normalization, not-found)🤖 Generated with Claude Code