chore: pre-migration snapshot
Layer0, MCP servers, Terraform consolidation
This commit is contained in:
22
tests/test_mcp_cloudflare_safe_ingress.py
Normal file
22
tests/test_mcp_cloudflare_safe_ingress.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from mcp.cloudflare_safe.cloudflare_api import parse_cloudflared_config_ingress
|
||||
|
||||
|
||||
def test_parse_cloudflared_config_ingress_extracts_hostnames_and_services():
|
||||
sample = """\
|
||||
tunnel: 00000000-0000-0000-0000-000000000000
|
||||
credentials-file: /etc/cloudflared/0000.json
|
||||
|
||||
ingress:
|
||||
- hostname: "api.example.com"
|
||||
service: http://127.0.0.1:8080
|
||||
- hostname: app.example.com
|
||||
service: "http://127.0.0.1:3000"
|
||||
- service: http_status:404
|
||||
"""
|
||||
|
||||
rules = parse_cloudflared_config_ingress(sample)
|
||||
|
||||
assert rules == [
|
||||
{"hostname": "api.example.com", "service": "http://127.0.0.1:8080"},
|
||||
{"hostname": "app.example.com", "service": "http://127.0.0.1:3000"},
|
||||
]
|
||||
Reference in New Issue
Block a user