Fix panel URL authentication for Hass.io (#15024)

* Update http.py

* Update http.py

* fix tests

* Update test_http.py
This commit is contained in:
Pascal Vizeli 2018-06-17 20:34:47 +02:00 committed by GitHub
parent 3ceee66e1b
commit 40c8f5f70e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -36,7 +36,7 @@ NO_TIMEOUT = {
}
NO_AUTH = {
re.compile(r'^app-(es5|latest)/.+$'),
re.compile(r'^app/.*$'),
re.compile(r'^addons/[^/]*/logo$')
}

View File

@ -47,8 +47,8 @@ def test_auth_required_forward_request(hassio_client):
@asyncio.coroutine
@pytest.mark.parametrize(
'build_type', [
'es5/index.html', 'es5/hassio-app.html', 'latest/index.html',
'latest/hassio-app.html', 'es5/some-chunk.js', 'es5/app.js',
'app/index.html', 'app/hassio-app.html', 'app/index.html',
'app/hassio-app.html', 'app/some-chunk.js', 'app/app.js',
])
def test_forward_request_no_auth_for_panel(hassio_client, build_type):
"""Test no auth needed for ."""
@ -61,7 +61,7 @@ def test_forward_request_no_auth_for_panel(hassio_client, build_type):
'_create_response') as mresp:
mresp.return_value = 'response'
resp = yield from hassio_client.get(
'/api/hassio/app-{}'.format(build_type))
'/api/hassio/{}'.format(build_type))
# Check we got right response
assert resp.status == 200