remove Hub, Proxy from database

These are in-memory-only objects, no need for a table with one row
This commit is contained in:
Min RK
2017-04-20 15:18:30 +02:00
parent a98bab8b5e
commit acc31b8441
15 changed files with 178 additions and 327 deletions

View File

@@ -83,7 +83,7 @@ def auth_header(db, name):
@check_db_locks
def api_request(app, *api_path, **kwargs):
"""Make an API request"""
base_url = app.hub.server.url
base_url = app.hub.url
headers = kwargs.setdefault('headers', {})
if 'Authorization' not in headers:
@@ -94,7 +94,7 @@ def api_request(app, *api_path, **kwargs):
f = getattr(requests, method)
resp = f(url, **kwargs)
assert "frame-ancestors 'self'" in resp.headers['Content-Security-Policy']
assert ujoin(app.hub.server.base_url, "security/csp-report") in resp.headers['Content-Security-Policy']
assert ujoin(app.hub.base_url, "security/csp-report") in resp.headers['Content-Security-Policy']
assert 'http' not in resp.headers['Content-Security-Policy']
return resp
@@ -132,7 +132,7 @@ def test_auth_api(app):
def test_referer_check(app, io_loop):
url = ujoin(public_host(app), app.hub.server.base_url)
url = ujoin(public_host(app), app.hub.base_url)
host = urlparse(url).netloc
user = find_user(app.db, 'admin')
if user is None:
@@ -779,7 +779,7 @@ def test_get_service(app, mockservice_url):
def test_root_api(app):
base_url = app.hub.server.url
base_url = app.hub.url
url = ujoin(base_url, 'api')
r = requests.get(url)
r.raise_for_status()