Commit Graph

433 Commits (81036967f04b47e75cf861aa821515e2de6e812f)

Author SHA1 Message Date
J. Nick Koston a6a47c0b44
Make aiohttp_cors a top level import (#115563)
* Make aiohttp_cors a top level import

This was moved to a late import in #27935 but there is no
longer any need to import it late in the event loop as aiohttp_cors
is listed in pyproject.toml so it will always be available

* drop requirements as they are all top level now

* drop requirements as they are all top level now

* adjust
2024-04-15 21:06:59 +02:00
Bram Kragten f16ee2ded9
Update strict connection static page (#115473) 2024-04-12 23:35:59 +02:00
Robert Resch 348e1df949
Add strict connection (#112387)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-04-12 14:47:46 +02:00
Sid 0d66d298ec
Enable Ruff RET504 (#114528)
* Enable Ruff RET504

* fix test

* Use noqa instead of cast

* fix sonos RET504

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-04-06 11:07:37 +02:00
J. Nick Koston 7a2e529bb7
Avoid executor job to start http if server_host is unspecified (#114609)
* Avoid executor job to start http if server_host is unspecified

Same as #112522 for http

* adjust test

* CONF_SERVER_HOST is always set now
2024-04-04 07:51:18 +02:00
Sid a5b609f081
Enable ruff TRY401 (#114395)
* Enable ruff TRY401

* fix tests
2024-03-29 07:20:36 +01:00
Sid f7b7f74d10
Enable Ruff TRY201 (#114269)
* Enable Ruff TRY201

* remove redundant rules
2024-03-28 10:18:07 +01:00
Joost Lekkerkerker 6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Marc Mueller d779333bef
Use TypeVarTuple for add_job and run_job methods (#114122) 2024-03-24 18:52:39 +01:00
J. Nick Koston c615b52840
Refactor integration startup time to show wall clock time (#113707)
* Refactor setup time tracking to exclude time waiting on other operations

We now exclude the import time and th time waiting on
base platforms to setup from the setup times

* tweak

* tweak

* tweak

* tweak

* adjust

* fixes

* fixes

* preen

* preen

* tweak

* tweak

* adjust

* tweak

* reduce

* do not count integrtion platforms against their parent integration

* handle legacy tts platforms

* stt as well

* one more wait

* use the same pattern in all the legacy

* fix tts and stt legacy

* fix

* fix

* reduce

* preen

* entity comp does not wait for platforms

* scene blocks as well

* fix test

* test fixes

* coverage

* coverage

* coverage

* fix test

* Update tests/test_setup.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update tests/test_setup.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/setup.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* strip

* strip WAIT_PLATFORM_INTEGRATION

* strip WAIT_PLATFORM_INTEGRATION

* strip WAIT_PLATFORM_INTEGRATION

* strip WAIT_PLATFORM_INTEGRATION

* remove complexity

* Apply suggestions from code review

* no longer works that way

* fixes

* fixes

* fixes

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-03-18 21:45:34 -04:00
Sid 82a60fe8ad
Enable Ruff RSE (#113695) 2024-03-18 00:40:38 +01:00
Marc Mueller 8809d3aa88
Add empty line after module docstring [g-i] (#112699) 2024-03-08 08:52:48 -05:00
Marc Mueller 2d701d5a7d
Use aiohttp.AppKey for http cors keys (#112658) 2024-03-08 11:51:59 +01:00
Marc Mueller eb8f8e1ae4
Use aiohttp.AppKey for http ban keys (#112657) 2024-03-08 11:13:24 +01:00
Erik Montnemery 49d20eedd4
Remove local imports of hass-nabucasa (#112634) 2024-03-07 20:37:35 +01:00
Marc Mueller 531e25cbc6
Change KEY_HASS to be an aiohttp AppKey (#111954) 2024-03-07 13:37:48 +01:00
J. Nick Koston 9be4fb0574
Start fetching the source ip sooner in http to reduce setup time (#112461) 2024-03-05 21:32:02 -05:00
J. Nick Koston c1750f7c3a
Fix circular imports in core integrations (#111875)
* Fix circular imports in core integrations

* fix circular import

* fix more circular imports

* fix more circular imports

* fix more circular imports

* fix more circular imports

* fix more circular imports

* fix more circular imports

* fix more circular imports

* adjust

* fix

* increase timeout

* remove unused logger

* keep up to date

* make sure its reprod
2024-02-29 21:04:41 -05:00
J. Nick Koston b54e282801
Remove follow symlinks support from CachingStaticResource (#109015) 2024-01-28 10:07:12 -10:00
J. Nick Koston 9de8409f48
Speed up security filter middleware (#108703)
* Speed up security filter middleware

Check the path and query string with the filter expression once instead
of checking the path and query string seperately. If we get a hit than
we check the query string to ensure we give a more verbose error about
where the filter hit.

Additionally since we see the same urls over and over, cache the unquote

* request.url is to expensive, cheaper to join

* aiohttp has a path_qs fast path

* construct the string outselves so it functions exactly as before
2024-01-26 00:17:18 -05:00
J. Nick Koston c01e8288c1
Convert http auth internals to normal functions (#108815)
Nothing was being awaited here anymore, these can be normal functions
2024-01-24 22:34:52 -05:00
J. Nick Koston 2eea658fd8
Convert getting and removing access tokens to normal functions (#108670) 2024-01-22 20:51:33 -10:00
Marc Mueller 25b7bb4a4f
Adjust require_admin decorator typing (#108306)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-01-18 14:12:14 -10:00
J. Nick Koston 86603b332a
Bump aiohttp-zlib-ng to 0.3.1 (#107595) 2024-01-08 13:24:57 -10:00
J. Nick Koston 8645d9c717
Bump aiohttp-zlib-ng to 0.3.0 (#107184) 2024-01-05 14:28:29 +01:00
J. Nick Koston 40d034cd8c
Revert "Bump aiohttp-zlib-ng to 0.2.0 (#106691)" (#107109) 2024-01-04 15:34:43 +01:00
J. Nick Koston e1f078b70a
Bump aiohttp-zlib-ng to 0.2.0 (#106691) 2024-01-02 20:50:26 +01:00
J. Nick Koston 093c952c38
Bump aiohttp-zlib-ng to 0.1.3 (#106489)
Reverts the workaround that was created for #105254 since the original
issue is fixed in zlib_ng 0.3.0+ which the lib now requires as a minimum
version
2023-12-27 08:04:07 -10:00
J. Nick Koston e75357980a
Bump aiohttp-zlib-ng to 0.1.2 (#106193)
fixes #105254
2023-12-22 00:03:42 +01:00
Ville Skyttä 24b1e01d71
Update Ruff to 0.1.8, avoid linter/formatter conflicts (#106080)
* Disable Ruff rules that may conflict with the formatter

* Upgrade Ruff to 0.1.8

- https://github.com/astral-sh/ruff/releases/tag/v0.1.7
- https://github.com/astral-sh/ruff/releases/tag/v0.1.8

* Format with Ruff 0.1.8
2023-12-20 23:55:09 +01:00
Marc Mueller 446f560b59
Set aiohttp shutdown_timeout on AppRunner instead of TCPSite (#105973) 2023-12-18 10:59:23 -10:00
J. Nick Koston 5c503683b7
Bump lru-dict to 1.3.0 (#105914)
* Bump lru-dict to 1.3.0

changelog: https://github.com/amitdev/lru-dict/compare/v1.2.0...v1.3.0

* fix typing

* quote types

* quote types
2023-12-18 00:16:31 +01:00
J. Nick Koston 1522118453
Remove aiohttp cancel on disconnect workaround (#104175) 2023-11-29 11:20:36 -07:00
J. Nick Koston 1b048ff388
Remove HomeAssistantAccessLogger (#104173) 2023-11-29 10:40:19 -07:00
J. Nick Koston dfed10420c
Remove aiohttp enable_compression helper (#104174) 2023-11-29 10:24:34 -07:00
J. Nick Koston 74d7d02833
Bump aiohttp-fast-url-dispatcher to 0.3.0 (#104592) 2023-11-27 09:04:04 -06:00
Robert Resch 852fb58ca8
Extend `auth/providers` endpoint and add `/api/person/list` endpoint for local ip requests (#103906)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-11-24 17:11:54 +01:00
Chuck Foster aca48b5e45
Fix duplicate Ban file entries (#103953) 2023-11-14 17:13:14 +01:00
J. Nick Koston d1f1bbe304
Migrate to using aiohttp-fast-url-dispatcher (#103656) 2023-11-09 17:23:33 +01:00
J. Nick Koston 0d63e2f9b5
Ensure large payloads are compressed in the executor with aiohttp 3.9.0 (#103592) 2023-11-07 12:37:54 -06:00
J. Nick Koston da1780f9ec
Small cleanups to process_success_login (#103282) 2023-11-07 10:48:34 +01:00
J. Nick Koston 062b510ec0
Cache the mime type of static files (#103281) 2023-11-03 12:37:29 -05:00
J. Nick Koston 45f5c21402
Speed up websocket and ingress with aiohttp-zlib-ng (#103247) 2023-11-02 15:18:12 -05:00
J. Nick Koston 8eb7766f30
Avoid path construction for static files cache hit (#102882) 2023-10-31 14:31:58 -05:00
Erik Montnemery c481fdb7d0
Rename safe mode to recovery mode (#102580) 2023-10-23 20:33:08 +02:00
Robert Resch e4742c04f2
Fix missspelled package names (#100670) 2023-09-21 10:57:23 +02:00
Ville Skyttä c287bd1a3b
Remove pylint configs flagged by useless-suppression (#99081) 2023-08-26 17:46:03 +03:00
Ville Skyttä 9da192c752
Avoid use of `datetime.utc*` methods deprecated in Python 3.12 (#93684)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2023-08-24 16:38:22 +02:00
Franck Nijhof 85c2216cd7
Ensure headers middleware handles errors too (#98397) 2023-08-14 17:48:11 +02:00
Robert Resch b0f68f1ef3
Use @require_admin decorator (#98061)
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2023-08-14 15:07:20 +02:00