aiohttp-security/aiohttp_security/jwt_identity.pyi

18 lines
742 B
Python
Raw Normal View History

2021-01-14 13:47:56 +00:00
from typing import Any, Optional, Union
import aiohttp.web
from cryptography.hazmat.primitives.asymmetric import rsa
from .abc import AbstractIdentityPolicy, Identity
AUTH_HEADER_NAME: str
AUTH_SCHEME: str
class JWTIdentityPolicy(AbstractIdentityPolicy):
secret: Union[str, bytes, rsa.RSAPublicKey, rsa.RSAPrivateKey] = ...
algorithm: str = ...
def __init__(self, secret: Union[str, bytes, rsa.RSAPublicKey, rsa.RSAPrivateKey], algorithm: str = ...) -> None: ...
async def identify(self, request: aiohttp.web.Request) -> Optional[Identity]: ...
async def remember(self, *args: Any, **kwargs: Any) -> None: ...
async def forget(self, request: aiohttp.web.Request, response: aiohttp.web.StreamResponse) -> None: ...