Rename strict connection static page to guard page (#116085)
This commit is contained in:
parent
07d68eacfa
commit
bcc2dd99b2
7 changed files with 35 additions and 35 deletions
|
@ -30,7 +30,7 @@ from homeassistant.components.http.auth import (
|
|||
DATA_SIGN_SECRET,
|
||||
SIGN_QUERY_PARAM,
|
||||
STORAGE_KEY,
|
||||
STRICT_CONNECTION_STATIC_PAGE,
|
||||
STRICT_CONNECTION_GUARD_PAGE,
|
||||
async_setup_auth,
|
||||
async_sign_path,
|
||||
async_user_not_allowed_do_auth,
|
||||
|
@ -879,17 +879,17 @@ async def _drop_connection_unauthorized_request(
|
|||
await client.get("/")
|
||||
|
||||
|
||||
async def _static_page_unauthorized_request(
|
||||
async def _guard_page_unauthorized_request(
|
||||
hass: HomeAssistant, client: TestClient
|
||||
) -> None:
|
||||
req = await client.get("/")
|
||||
assert req.status == HTTPStatus.IM_A_TEAPOT
|
||||
|
||||
def read_static_page() -> str:
|
||||
with open(STRICT_CONNECTION_STATIC_PAGE, encoding="utf-8") as file:
|
||||
def read_guard_page() -> str:
|
||||
with open(STRICT_CONNECTION_GUARD_PAGE, encoding="utf-8") as file:
|
||||
return file.read()
|
||||
|
||||
assert await req.text() == await hass.async_add_executor_job(read_static_page)
|
||||
assert await req.text() == await hass.async_add_executor_job(read_guard_page)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
@ -909,7 +909,7 @@ async def _static_page_unauthorized_request(
|
|||
("strict_connection_mode", "request_func"),
|
||||
[
|
||||
(StrictConnectionMode.DROP_CONNECTION, _drop_connection_unauthorized_request),
|
||||
(StrictConnectionMode.STATIC_PAGE, _static_page_unauthorized_request),
|
||||
(StrictConnectionMode.GUARD_PAGE, _guard_page_unauthorized_request),
|
||||
],
|
||||
ids=["drop connection", "static page"],
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue