update proxy_pass regex

pull/38/head
Max Erenberg 1 year ago
parent 1e30efda24
commit 3f7901d2db
  1. 2
      ceod/model/VHostManager.py
  2. 11
      tests/ceod/model/test_vhosts.py

@ -16,7 +16,7 @@ from ceo_common.logger_factory import logger_factory
from ceo_common.interfaces import IVHostManager, IConfig
PROXY_PASS_IP_RE = re.compile(
r'^\s+proxy_pass\s+http://(?P<ip_address>[\d.]+(:\d{2,5})?);$'
r'^\s+proxy_pass\s+http://(?P<ip_address>[\w.:-]+);$'
)
VHOST_FILENAME_RE = re.compile(r'^(?P<username>[0-9a-z-]+)_(?P<domain>[0-9a-z.-]+)$')
VALID_DOMAIN_RE = re.compile(r'^(?:[0-9a-z-]+\.)+[a-z]+$')

@ -36,6 +36,17 @@ def test_vhost_mgr(vhost_mgr):
assert vhost_mgr.get_num_vhosts(username) == 0
os.unlink(rate_limit_file)
vhost_mgr.create_vhost(username, domain, ip_address + ':8000')
os.unlink(rate_limit_file)
domain3 = username + '.k8s.csclub.cloud'
vhost_mgr.create_vhost(username, domain3, 'k8s')
assert vhost_mgr.get_vhosts(username) == [
{'domain': domain, 'ip_address': ip_address + ':8000'},
{'domain': domain3, 'ip_address': 'k8s'},
]
vhost_mgr.delete_all_vhosts_for_user(username)
os.unlink(rate_limit_file)
@pytest.mark.parametrize('suffix', ['csclub.cloud', 'k8s.csclub.cloud'])

Loading…
Cancel
Save