mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
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:
parent
3ceee66e1b
commit
40c8f5f70e
@ -36,7 +36,7 @@ NO_TIMEOUT = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
NO_AUTH = {
|
NO_AUTH = {
|
||||||
re.compile(r'^app-(es5|latest)/.+$'),
|
re.compile(r'^app/.*$'),
|
||||||
re.compile(r'^addons/[^/]*/logo$')
|
re.compile(r'^addons/[^/]*/logo$')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,8 +47,8 @@ def test_auth_required_forward_request(hassio_client):
|
|||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
'build_type', [
|
'build_type', [
|
||||||
'es5/index.html', 'es5/hassio-app.html', 'latest/index.html',
|
'app/index.html', 'app/hassio-app.html', 'app/index.html',
|
||||||
'latest/hassio-app.html', 'es5/some-chunk.js', 'es5/app.js',
|
'app/hassio-app.html', 'app/some-chunk.js', 'app/app.js',
|
||||||
])
|
])
|
||||||
def test_forward_request_no_auth_for_panel(hassio_client, build_type):
|
def test_forward_request_no_auth_for_panel(hassio_client, build_type):
|
||||||
"""Test no auth needed for ."""
|
"""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:
|
'_create_response') as mresp:
|
||||||
mresp.return_value = 'response'
|
mresp.return_value = 'response'
|
||||||
resp = yield from hassio_client.get(
|
resp = yield from hassio_client.get(
|
||||||
'/api/hassio/app-{}'.format(build_type))
|
'/api/hassio/{}'.format(build_type))
|
||||||
|
|
||||||
# Check we got right response
|
# Check we got right response
|
||||||
assert resp.status == 200
|
assert resp.status == 200
|
||||||
|
Loading…
x
Reference in New Issue
Block a user