refactor(manifest): rename egress_proxy key to egress
Now that `bottle.egress` (the old allowlist/dlp_action block) is
gone, the longer `egress_proxy:` disambiguator isn't needed. The
manifest field reads more naturally as just `egress:` with the
same nested `routes: [...]` shape.
Renamed:
- Manifest YAML key: `egress_proxy:` → `egress:`
- Bottle dataclass attr: `bottle.egress_proxy` → `bottle.egress`
- `_BOTTLE_KEYS` entry, schema docstring, and all
user-facing error message labels (`egress.routes[N]`,
`egress has unknown key …`, etc.).
Kept (these refer to the egress-proxy SIDECAR, not the manifest
field):
- File names: `egress_proxy.py`, `egress_proxy_apply.py`,
`egress_proxy_addon.py`, `egress_proxy_addon_core.py`.
- Class names: `EgressProxyConfig`, `EgressProxyRoute`,
`EgressProxyPlan`, `EgressProxy`, `DockerEgressProxy`.
- Helper names: `egress_proxy_manifest_routes`,
`egress_proxy_routes_for_bottle`,
`egress_proxy_token_env_map`, etc.
- Constants: `EGRESS_PROXY_HOSTNAME`, `EGRESS_PROXY_ROLES`,
`EGRESS_PROXY_AUTH_SCHEMES`, `EGRESS_PROXY_FORWARD_PROXY`,
`EGRESS_PROXY_INTROSPECT_URL`, `EGRESS_PROXY_PORT`, etc.
- Container name prefix `claude-bottle-egress-proxy-*`, the
`egress-proxy` docker network alias, the
`egress-proxy-block` + `list-egress-proxy-routes` MCP tool
IDs, the `egress-proxy` audit-log component label.
Local bottle migrated (`~/.claude-bottle/bottles/dev.md` already
updated). The legacy `egress_proxy` key isn't surfaced anywhere
anymore; the generic unknown-key validator catches typos with a
"did you mean: egress, env, git, supervise" hint.
409 unit + integration tests pass.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -252,7 +252,7 @@ class TestRealisticBottleFile(unittest.TestCase):
|
||||
|
||||
def test_dev_bottle(self):
|
||||
out = _y("""
|
||||
egress_proxy:
|
||||
egress:
|
||||
routes:
|
||||
- host: api.anthropic.com
|
||||
auth:
|
||||
@@ -270,25 +270,21 @@ class TestRealisticBottleFile(unittest.TestCase):
|
||||
IdentityFile: ~/.ssh/gitea.pem
|
||||
ExtraHosts:
|
||||
gitea.dideric.is: 100.78.141.42
|
||||
egress:
|
||||
allowlist:
|
||||
- example.com
|
||||
""")
|
||||
# Spot-check the deep parts; the structure is large.
|
||||
self.assertEqual(2, len(out["egress_proxy"]["routes"]))
|
||||
self.assertEqual(2, len(out["egress"]["routes"]))
|
||||
self.assertEqual(
|
||||
["/didericis/"],
|
||||
out["egress_proxy"]["routes"][1]["path_allowlist"],
|
||||
out["egress"]["routes"][1]["path_allowlist"],
|
||||
)
|
||||
self.assertEqual(
|
||||
"Bearer",
|
||||
out["egress_proxy"]["routes"][0]["auth"]["scheme"],
|
||||
out["egress"]["routes"][0]["auth"]["scheme"],
|
||||
)
|
||||
self.assertEqual(
|
||||
"100.78.141.42",
|
||||
out["git"][0]["ExtraHosts"]["gitea.dideric.is"],
|
||||
)
|
||||
self.assertEqual(["example.com"], out["egress"]["allowlist"])
|
||||
|
||||
|
||||
class TestFrontmatter(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user