18 lines
742 B
Python
18 lines
742 B
Python
|
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: ...
|