core/tests/components/telegram_bot
Zehuan Li 41cb8526d1
Add secret_token support to telegram_bot component (#100869)
* Support secret_token for setWebHook api

* Revert configuration YAML changes; generate and store secret token instead

* Reformat codes

* Revert storage of secret token; use ephemeral secret token instead

* Reformat

* Update homeassistant/components/telegram_bot/webhooks.py

* Fix when header is not present

* Check for non-empty token

* Fix tests to support secret token

* Add tests for invalid secret token

* Minor: remove comment

* Revert back to 401

* ... and for tests

* Change patching method for the generation of secret tokens

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-10-02 11:44:15 +02:00
..
__init__.py
conftest.py
test_broadcast.py
test_telegram_bot.py