1
0
mirror of https://github.com/home-assistant/core.git synced 2025-07-23 05:07:41 +00:00

69 Commits

Author SHA1 Message Date
Joost Lekkerkerker
6bb4e7d62c
Bump ruff to 0.3.4 ()
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
19ab3d6daf
Add empty line after module docstring [helpers + other] () 2024-03-08 10:36:11 -05:00
Marc Mueller
8ca127df2a
Use KEY_HASS [h-z] () 2024-03-07 18:03:44 +01:00
Erik Montnemery
a0e558c457
Add generic classes BaseFlowHandler and BaseFlowManager ()
* Add generic classes BaseFlowHandler and BaseFlowManager

* Migrate zwave_js

* Update tests

* Update tests

* Address review comments
2024-02-29 16:52:39 +01:00
deosrc
e38cb01d81
Add missing log message for error resolving OAuth token () 2024-02-11 13:07:54 +00:00
Joost Lekkerkerker
59e9010b65
Show domain in oauth2 error log ()
* Show token url in oauth2 error log

* Fix tests

* Use domain
2024-02-06 23:03:35 +01:00
Marc Mueller
cd0ee98dba
Use builtin TimeoutError [core + helpers] () 2024-02-05 12:09:54 +01:00
Allen Porter
787fb3b954
Improve OAuth error handling in configuration flows ()
* Improve OAuth error handling in configuration flows

* Update strings for all integrations that use oauth2 config flow

* Remove invalid_auth strings

* Revert change to release

* Revert close change in aiohttp mock
2023-11-11 11:02:51 +01:00
Joost Lekkerkerker
faea3b1634
Abort config flow when invalid token is received () 2023-10-08 13:32:35 +02:00
Dave T
99a76ef4e6
Fix most sphinx documentation warnings () 2023-10-02 09:01:41 +02:00
Marc Mueller
a9ade1f84d
Use asyncio.timeout [core] () 2023-08-15 08:36:05 -05:00
J. Nick Koston
32b70ea133
Bump PyJWT to 2.7.0 () 2023-05-16 10:26:04 +02:00
Franck Nijhof
fcb612cd6f
Collection of code styling tweaks () 2023-02-03 23:51:27 +01:00
Marc Mueller
07a3046d11
Update pylint to 2.16.0 () 2023-02-02 12:49:01 +01:00
Paulus Schoutsen
df0fc30695
Fix oauth2 error () 2023-01-25 20:50:16 +01:00
Allen Porter
1afb4897a8
Add a timeout during OAuth token exchange and additional debug logging () 2023-01-16 19:52:43 +01:00
Franck Nijhof
d4f69a3652
String formatting and max line length - Part 7 ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-12-27 11:18:56 +01:00
Allen Porter
b014d558ff
Add application credentials platform for nest and deprecate yaml for SDM API ()
* Update the nest integration to be useable fully from the config flow

* Support discovery in nest config flow

* Remove configuration entries

* Remove unused import

* Remove dead code

* Update homeassistant/components/nest/strings.json

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

* Remove commented out code

* Use config flow for app auth reauthentication path

* Improves for re-auth for upgrading existing project and creds

* More dead code removal

* Apply suggestions from code review

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

* Remove outdated code

* Update homeassistant/components/nest/config_flow.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-06-15 07:15:53 -07:00
Joakim Plate
84779482b8
Don't set headers kwargs multiple times () 2022-05-31 13:08:50 -07:00
Paulus Schoutsen
6a3d2e54a2
Handle OAuth2 rejection () 2022-05-28 20:23:16 -07:00
Franck Nijhof
38ad1ef233
Use My Home Assistant for OAuth2 redirect callbacks ()
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-05-24 19:00:36 -07:00
Allen Porter
26ee289be3
Add return code to integration application credentials in config flow ()
* Add return code to integration application credentials in config flow

* Update google tests to use new return code

* Update spotify test for no auth configured

* Add translation for oauth2_missing_credentials

* Add new return code to yolink

* Update homeassistant/strings.json

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

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-05-18 06:30:57 -07:00
Allen Porter
00b5d30e24
Add application credentials platform ()
* Initial developer credentials scaffolding
- Support websocket list/add/delete
- Add developer credentials protocol from yaml config
- Handle OAuth credential registration and de-registration
- Tests for websocket and integration based registration

* Fix pydoc text

* Remove translations and update owners

* Update homeassistant/components/developer_credentials/__init__.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/developer_credentials/__init__.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Remove _async_get_developer_credential

* Rename to application credentials platform

* Fix race condition and add import support

* Increase code coverage (92%)

* Increase test coverage 93%

* Increase test coverage (94%)

* Increase test coverage (97%)

* Increase test covearge (98%)

* Increase test coverage (99%)

* Increase test coverage (100%)

* Remove http router frozen comment

* Remove auth domain override on import

* Remove debug statement

* Don't import the same client id multiple times

* Add auth dependency for local oauth implementation

* Revert older oauth2 changes from merge

* Update homeassistant/components/application_credentials/__init__.py

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

* Move config credential import to its own fixture

* Override the mock_application_credentials_integration fixture instead per test

* Update application credentials

* Add dictionary typing

* Use f-strings as per feedback

* Add additional structure needed for an MVP application credential

Add additional structure needed for an MVP, including a target
component Xbox

* Add websocket to list supported integrations for frontend selector

* Application credentials config

* Import xbox credentials

* Remove unnecessary async calls

* Update script/hassfest/application_credentials.py

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

* Update script/hassfest/application_credentials.py

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

* Update script/hassfest/application_credentials.py

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

* Update script/hassfest/application_credentials.py

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

* Import credentials with a fixed auth domain

Resolve an issue with compatibility of exisiting config entries when importing
client credentials

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-04-30 08:06:43 -07:00
Marc Mueller
9b9b553521
Disable no-self-use [pylint] ()
* Disable no-self-use

* Remove disable comments
2022-04-25 07:41:01 -07:00
Allen Porter
c07100e519
Move Local OAuth http endpoint registration to auth component () 2022-04-06 22:34:31 -07:00
Marc Mueller
bfb1abd3a2
Add type ignore error codes [helpers] () 2022-02-18 11:31:37 +01:00
Marc Mueller
d3b7bd25ef
Update typing (1) () 2022-01-11 21:26:03 +01:00
Ruslan Sayfutdinov
55f4962c06
Fix pylint plugin which checks relative imports () 2021-12-23 11:14:47 -08:00
J. Nick Koston
10d6247fee
Bump to aiohttp 3.8.0 () 2021-11-04 10:07:50 -05:00
Marc Mueller
3f1b4906bf
Use assignment expressions 35 () 2021-10-31 18:32:17 +01:00
Marc Mueller
238b488642
Use assignment expressions 03 () 2021-10-17 20:08:11 +02:00
Marc Mueller
77ee72cbb9
Import Callable from collections.abc (1) () 2021-09-29 16:32:11 +02:00
Marc Mueller
48bada5a18
Update pylint to 2.11.1 () 2021-09-18 13:52:59 +02:00
Ruslan Sayfutdinov
7195b8222b
Bump PyJWT to 2.1.0 () 2021-09-07 20:59:02 -07:00
Ruslan Sayfutdinov
391b2f8ccd
Add missing return type in Core constructors () 2021-05-20 18:53:29 +03:00
Martin Hjelmare
e32dc306e1
Fix oauth2 helper user step typing () 2021-05-14 23:39:14 +02:00
Ruslan Sayfutdinov
ce15f28642
Add missing type hints in http component () 2021-05-10 14:30:47 -07:00
Franck Nijhof
96f69fb9fb
Finalize clean up connection classes () 2021-05-04 20:08:51 +02:00
Ruslan Sayfutdinov
183220008d
Rename FlowResultDict to FlowResult () 2021-04-29 13:40:51 +02:00
Marc Mueller
c07646db5d
Update typing syntax ()
* Update typing syntax

* Replace typing imports with ones from collections where possible

* Changes after review
2021-04-20 17:40:41 +02:00
Ruslan Sayfutdinov
80f66f301b
Define data flow result type ()
* Define data flow result type

* Revert explicit definitions

* Fix tests

* Specific mypy ignore
2021-04-15 07:17:07 -10:00
Franck Nijhof
f0e5e616a7
Fix device discovery of OAuth2 config flows () 2021-03-25 10:35:01 -07:00
Marc Mueller
6fb2e63e49
Update typing 02 () 2021-03-17 18:34:19 +01:00
Franck Nijhof
5d5a110a20
None optional hass typing in base entity and notify () 2021-03-15 15:11:41 +01:00
J. Nick Koston
da677f7d5a
Add support for discovery via DHCP ()
* Add support for discovery via DHCP

* additional tesla ouis

* merge tests

* dhcp test

* merge requirements test

* dhcp test

* dhcp discovery

* dhcp discovery

* pylint

* pylint

* pylint

* fix

* Add matching tests

* 100% cover

* cleanup

* fix codespell

* Update exception handling

* remove unneeded comment

* fix options handling exception

* fix options handling exception
2021-01-14 09:09:08 +01:00
Allen Porter
eb07282e9b
Add debug logging for failed OAuth token refreshes to help users diagnose () 2020-12-30 10:03:27 +01:00
Paulus Schoutsen
f9fa24950b
OAuth2 to use current request header () 2020-11-27 08:55:34 +01:00
springstan
92379ad8d2
Use list literal without using dict.keys() () 2020-10-30 09:19:13 -05:00
J. Nick Koston
94219c2266
Ensure the oauth2 token is refreshed before it is expired ()
The current implementation assumed clocks were in sync and did
not account for the time it took to refresh the token.  A 20
second buffer has been added to ensure that the token is refreshed
before it expires as OAuth2Session.valid_token would assume the
token was still good even though the remote would reject it
and would not refresh because it was not time yet.
2020-10-28 07:47:54 -05:00
Erik Montnemery
343e5d64b8
Add MQTT integration discovery ()
* Add MQTT integration discovery

* Add script/hassfest/mqtt.py

* Unsubscribe if config entry exists

* Add homeassistant/generated/mqtt.py

* Fix bad loop

* Improve tests

* Improve tests

* Apply suggestions from code review

Co-authored-by: Fabian Affolter <mail@fabian-affolter.ch>

* Prevent initiating multiple config flows

Co-authored-by: Fabian Affolter <mail@fabian-affolter.ch>
2020-10-07 18:30:51 +02:00