Commit Graph
89 Commits
Author SHA1 Message Date
a4d9019ffc Refactor persistent notification to no longer route all data via a service (#57157)
* Convert persistent notification tests to async

* Create/dismiss persistent notifications in exposed functions, not service calls

* Fix notify persistent_notification

* Remove setting up persistent_notification

* Drop more setups

* Empty methods

* Undeprecate sync methods because too big task

* Fix setup clearing notifications

* Fix a bunch of tests

* Fix more tests

* Uno mas

* Test persistent notification events

* Clean up stale comment

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-07 12:58:00 +02:00
Erik MontnemeryandGitHub f6682ba99d Block tests from opening sockets (#55516) 2021-10-05 14:46:09 -10:00
Ville SkyttäandGitHub 1aa7c87151 Remove redundant aiohttp response status=200 kwargs (#56417)
* Remove redundant aiohttp response status=200 kwargs

* Remove some more in h.c.auth

* Restore explicit status=HTTP_OK for auth and webhook per review request
2021-09-21 10:51:12 -07:00
Erik MontnemeryandGitHub acdddabe1f Use hass_client_no_auth test fixture in integrations h-p (#55583) 2021-09-02 14:49:40 +02:00
Paulus SchoutsenandGitHub 38a7bdbcf3 Do not process forwarded for headers for cloud requests (#54364) 2021-08-10 01:45:56 +02:00
Marc MuellerandGitHub 10bfc78365 Fix missing encoding with open() (#53593)
* Fix missing encoding with open()

* Fix tests

* Improve open - frontend
2021-07-28 09:41:45 +02:00
Joakim PlateandGitHub d339e3bd8c Reject trusted network access from proxies (#52388) 2021-07-02 11:49:42 +02:00
Joakim PlateandGitHub eedf1c3ebe Reject requests from the proxy itself (#52073)
* Reject requests from the proxy itself

* Adjust tests
2021-06-27 19:02:51 +02:00
Franck NijhofandGitHub 33e08f38da Raise bad request when receiving HTTP request from untrusted proxy (#51839)
* Raise bad request when receiving HTTP request from untrusted proxy

* Fix code comment
2021-06-17 04:41:19 +02:00
Franck NijhofandGitHub cdd1f6b2f0 Always load middle to handle forwarded proxy data (#51332) 2021-06-01 09:38:55 -07:00
J. Nick KostonandGitHub a4432557d3 Defer writing http config until after startup has calmed down (#50000) 2021-05-02 19:48:49 -10:00
Bram KragtenandGitHub e3105c7eb1 Revert CORS changes for my home assistant (#47064)
* Revert CORS changes for my home assistant

* Update test_init.py

* Update test_init.py
2021-02-25 15:28:22 -08:00
Franck NijhofandGitHub 22389043eb Remove base_url fallback (#46316) 2021-02-10 14:31:11 +01:00
6f446cf627 Add my component (#46058)
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-02-08 14:44:46 +01:00
gregodandGitHub cf9ea6f82d Sanitize user-agent in wrong_login message (#45251) 2021-01-18 09:21:30 +01:00
Pascal VizeliandGitHub e1427c45f2 Bump aioHTTP 3.7.3 - YARL 1.6.3 (#45180) 2021-01-15 13:19:22 +01:00
Franck NijhofandGitHub dee0f887de Extend filter and filter tests (#45179) 2021-01-15 10:30:29 +01:00
Franck Nijhof f047d04882 Add filtering 2021-01-14 20:02:01 +01:00
Franck NijhofandGitHub 65cf2fcb6f Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Franck NijhofandGitHub 1c2ebdf307 Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Franck NijhofandGitHub 475e70986b Extend IP ban / failed login notification information (#39020) 2020-08-18 23:32:19 +02:00
cc4ebc925c Improve X-Forwarded-* request headers handling (#38696)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2020-08-11 22:57:50 +02:00
Franck NijhofandGitHub 20710d8605 Add current request context to get_url helper (#38602) 2020-08-09 14:07:31 +02:00
J. Nick KostonandGitHub 578d4a9b6a Make the frontend available sooner (Part 1 of 2) (#36263)
* Part 1 of 2 (no breaking changes in part 1).

When integrations configured via the UI block startup or fail to start,
the webserver can remain offline which make it is impossible
to recover without manually changing files in
.storage since the UI is not available.

This change is the foundation that part 2 will build on
and enable a listener to start the webserver when the frontend
is finished loading.

Frontend Changes (home-assistant/frontend#6068)

* Address review comments

* bump timeout to 1800s, adjust comment

* bump timeout to 4h

* remove timeout failsafe

* and the test
2020-06-02 13:54:11 -05:00
Paulus SchoutsenandGitHub acbffb511d Fix base_url extract stack (#36331)
* Fix base_url extract stack

* Fix tests
2020-06-01 11:44:45 -07:00
Pascal VizeliandGitHub ed014e3c96 Revert "Ensure frontend is available if integrations fail to start - Part 1 of 2 (#36093)" (#36251)
This reverts commit fbe7b4ddfa.
2020-05-29 10:18:39 +02:00
fbe7b4ddfa Ensure frontend is available if integrations fail to start - Part 1 of 2 (#36093)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-05-28 21:09:07 -07:00
Franck NijhofandGitHub e3e3a113e9 async_get_url -> get_url (#35382) 2020-05-08 21:53:28 +02:00
Franck NijhofandGitHub e56dd8ed50 Detect use of deprecated base_url (#35353)
* Detect use of deprecated base_url

* Update get_url helper

* Update core migration

* Migrate all tests
2020-05-08 17:52:32 +02:00
Franck NijhofandGitHub 2223592486 Add get_url helper, deprecate base_url (#35224) 2020-05-08 02:29:47 +02:00
Paulus SchoutsenandGitHub 2af984917e Use asynctest-mock in most places (#35109)
* Use asynctest-mock in most places

* Fix broken patch in pilight
2020-05-03 11:27:19 -07:00
Paulus SchoutsenandGitHub 76f392476b Use a future for mock coro (#34989) 2020-04-30 16:31:00 -07:00
Paulus SchoutsenandGitHub ec47216388 Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
springstanandGitHub bc26be3c11 Add and use HTTP_FORBIDDEN constant (#33839) 2020-04-09 17:41:17 +02:00
c3decc6531 Do not ban supervisor ip if set (#33781)
* Use asynctest patch instead of mock_coro

* Add test for supervisor ip ban

* Do not ban supervisor ip if set

* Extract supervisor ip helper

* Check supervisor ip before banning

* Remove added blank line

* Clean up get supervisor ip

Co-Authored-By: Pascal Vizeli <pvizeli@syshack.ch>

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2020-04-08 10:31:44 -07:00
Franck NijhofandGitHub d7e9959442 String formatting improvements for tests (2) (#33666) 2020-04-05 00:33:07 +02:00
Paulus SchoutsenandGitHub 33361f8580 Fix HTTP config serialization (#31319) 2020-01-30 09:47:16 -08:00
Paulus SchoutsenandGitHub 5fdc60e067 Add Safe Mode (#30723)
* Store last working HTTP settings

* Add safe mode

* Fix tests

* Add cloud to safe mode

* Update logging text

* Fix camera tests leaving files behind

* Make emulated_hue tests not leave files behind

* Make logbook tests not leave files behind

* Make tts tests not leave files behind

* Make image_processing tests not leave files behind

* Make manual_mqtt tests not leave files behind
2020-01-14 13:03:02 -08:00
Bas NijholtandFranck Nijhof 3d10bb3647 Sort imports according to PEP8 for http (#29679) 2019-12-09 11:59:38 +01:00
Paulus SchoutsenandGitHub 3231e22ddf Remove direct authentication via trusted networks or API password (#27656)
* Remove direct authentication via trusted networks and API password

* Fix tests
2019-10-14 14:56:45 -07:00
Paulus SchoutsenandPascal Vizeli 57f84cbbaa Update HTTP defaults (#25702)
* Update HTTP defaults

* Fix tests
2019-08-05 08:24:54 +02:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Paulus Schoutsen 0df1bb5029 Fix python 3.5 test 2019-07-26 16:15:46 -07:00
Paulus SchoutsenandPascal Vizeli fae3546910 Allow cors for static files (#25468) 2019-07-25 13:52:27 +02:00
Paulus SchoutsenandGitHub 6f903db8c4 Fix cors on the index view (#24283) 2019-06-03 11:43:13 -07:00
Jason HuandPaulus Schoutsen fe1840f901 Deprecate http.api_password (#21884)
* Deprecated http.api_password

* Deprecated ApiConfig.api_password

GitHub Drafted PR would trigger CI after changed it to normal PR.
I have to commit a comment change to trigger it

* Trigger CI

* Adjust if- elif chain in auth middleware
2019-03-10 19:55:36 -07:00
Paul BotteinandPaulus Schoutsen 4d9cf15c45 Fix authorization header in cors (#21662)
* Fix authorization headers in cors

* Use aiohttp authorization header instead of custom const
2019-03-09 10:00:10 -08:00
Louis MatthijssenandAnders Melchiorsen d39784906b Fix HTTP login attempts check triggering too late (#20431) 2019-01-26 03:13:44 +01:00
Andrew SayreandFabian Affolter bb21cb6c89 Remove trailing slash from base_url and added ability to generate webhook path. (#20295) 2019-01-21 20:50:41 +01:00
Paulus SchoutsenandPascal Vizeli d1a621601d No more opt-out auth (#18854)
* No more opt-out auth

* Fix var
2018-12-02 16:32:53 +01:00