feat: extend enterprise gateway policies billing protocols and operations

This commit is contained in:
wlx committed 2026-10-13 19:08:50 +08:00
1 parent 1528b71882
commit af43947b5d
67 files changed
+1822 -69

No files matched your search

+4
View File
@@ -30,6 +30,10 @@ def execute(command, capture=False, data=None):
# shell stdin. This is especially important when deploy.py is invoked from
# an SSH heredoc; only an explicit data payload may be sent to a process.
options = {"input": data} if data is not None else {"stdin": subprocess.DEVNULL}
if command[:2] == ["docker", "compose"] and "--env-file" in command:
environment = os.environ.copy()
environment["MOYI_RUNTIME_ENV_FILE"] = str(Path(command[command.index("--env-file") + 1]).resolve())
options["env"] = environment
result = subprocess.run(command, cwd=HERE, capture_output=capture,
text=True, encoding="utf-8", errors="replace", **options)
if result.returncode:
+2 -1
View File
@@ -12,7 +12,7 @@ services:
# Pass per-route key pools from the deployment secret file without
# committing secret names or values to the repository.
env_file:
- .env.cloud
- ${MOYI_RUNTIME_ENV_FILE:-.env.cloud}
environment:
CONTROL_PLANE_HOST: 0.0.0.0
CONTROL_PLANE_PORT: 8787
@@ -28,6 +28,7 @@ services:
MOYI_REDIS_SSL: ${MOYI_REDIS_SSL:-false}
MOYI_REDIS_KEY_PREFIX: ${MOYI_REDIS_KEY_PREFIX:-moyi:test:}
FLYWAY_ENABLED: true
MOYI_FORWARD_HEADERS_STRATEGY: native
FLYWAY_BASELINE_ON_MIGRATE: false
AUTH_SECURE_COOKIE: false
AUTH_PASSWORD_PEPPER: ${AUTH_PASSWORD_PEPPER:?Initialize auth secrets}
+1
View File
@@ -43,6 +43,7 @@ services:
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD}
SPRING_DATA_REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379/0
FLYWAY_ENABLED: true
MOYI_FORWARD_HEADERS_STRATEGY: native
depends_on:
postgres:
condition: service_healthy
+1 -1
View File
@@ -23,7 +23,7 @@ location /api/ {
proxy_read_timeout 120s;
proxy_next_upstream off;
}
location /v1/ {
location ~ ^/v1(?:beta)?/ {
proxy_pass http://moyi-api:8787;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
+2 -1
View File
@@ -229,7 +229,8 @@ class DeploymentTests(unittest.TestCase):
self.assertEqual(api["SPRING_DATASOURCE_PASSWORD"], "test-db-$value#literal")
self.assertEqual(api["ADMIN_PASSWORD"], "Qa-Test42!")
self.assertNotIn("MOYI_REDIS_PASSWORD", cfg["services"]["frontend"].get("environment", {}))
self.assertNotIn("OSS_ACCESS_KEY_SECRET", api)
self.assertFalse(api.get("OSS_ACCESS_KEY_SECRET"))
self.assertNotIn("OSS_ACCESS_KEY_SECRET", cfg["services"]["frontend"].get("environment", {}))
if mode == "https":
ports = cfg["services"]["frontend"]["ports"]
self.assertEqual({str(p["published"]) for p in ports}, {"80", "443", "8080"})