mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 01:38:02 +00:00

* Bump PyJWT to 2.10.0 changelog: https://github.com/jpadilla/pyjwt/compare/2.9.0...2.10.0 * handle new keys * add test to verify all default options are checked for merge
19 lines
625 B
Python
19 lines
625 B
Python
"""Tests for the Home Assistant auth jwt_wrapper module."""
|
|
|
|
import jwt
|
|
import pytest
|
|
|
|
from homeassistant.auth import jwt_wrapper
|
|
|
|
|
|
async def test_all_default_options_are_in_verify_options() -> None:
|
|
"""Test that all default options in _VERIFY_OPTIONS."""
|
|
for option in jwt_wrapper._PyJWTWithVerify._get_default_options():
|
|
assert option in jwt_wrapper._VERIFY_OPTIONS
|
|
|
|
|
|
async def test_reject_access_token_with_impossible_large_size() -> None:
|
|
"""Test rejecting access tokens with impossible sizes."""
|
|
with pytest.raises(jwt.DecodeError):
|
|
jwt_wrapper.unverified_hs256_token_decode("a" * 10000)
|