1+ from typing import Any , Dict , Optional , Tuple
2+
3+ # Algorithm constants
4+ HS256 : str
5+ HS384 : str
6+ HS512 : str
7+ RS256 : str
8+ RS384 : str
9+ RS512 : str
10+ ES256 : str
11+ ES384 : str
12+ PS256 : str
13+ PS384 : str
14+ PS512 : str
15+ EDDSA : str
16+
17+ # JWT module constants
18+ JWT_TOKEN_ACCESS : str
19+ JWT_TOKEN_REFRESH : str
20+
21+ # JWT functions
22+ def access (token_instance : Any , payload : Optional [Dict [str , Any ]] = None ) -> str : ...
23+ def refresh (token_instance : Any , payload : Optional [Dict [str , Any ]] = None ) -> str : ...
24+ def rotation (token_instance : Any , refresh_token : str , payload : Optional [Dict [str , Any ]] = None ) -> Tuple [str , str ]: ...
25+ async def access_async (token_instance : Any , payload : Optional [Dict [str , Any ]] = None ) -> str : ...
26+ async def refresh_async (token_instance : Any , payload : Optional [Dict [str , Any ]] = None ) -> str : ...
27+ async def rotation_async (token_instance : Any , refresh_token : str , payload : Optional [Dict [str , Any ]] = None ) -> Tuple [str , str ]: ...
28+
29+ # Secret functions
30+ def secret_key () -> str : ...
31+ def secret_key_with_size (size : int ) -> str : ...
32+ def generate_hmac_secret (size : int ) -> str : ...
33+ async def generate_hmac_secret_async (size : int ) -> str : ...
34+ def generate_rsa_keypair (bits : Optional [int ] = None ) -> Tuple [str , str ]: ...
35+
36+ # Time functions
37+ def now () -> int : ...
38+ def seconds (n : int ) -> int : ...
39+ def minutes (n : int ) -> int : ...
40+ def hours (n : int ) -> int : ...
41+ def days (n : int ) -> int : ...
42+ def weeks (n : int ) -> int : ...
43+
44+ # Utils constants
45+ DEFAULT_SECRET_SIZE : int
46+ MIN_SECRET_SIZE : int
47+ TOKEN_ACCESS : str
48+ TOKEN_REFRESH : str
49+
50+ # JWT format functions
51+ def is_jwt_format (token : str ) -> bool : ...
52+ def validate_jwt_format (token : str ) -> bool : ...
53+
54+ # CipherToken class with full autocomplete support
55+ class CipherToken :
56+ def __init__ (self , secret : str , algorithm : str , access_ttl : int , refresh_ttl : int ) -> None : ...
57+
58+ # Token creation
59+ def create_token (self ,ttl_time : int , token_type : str , payload : Optional [Dict [str , Any ]] = None ) -> str : ...
60+ def access (self ,payload : Optional [Dict [str , Any ]] = None ) -> str : ...
61+ def refresh (self ,payload : Optional [Dict [str , Any ]] = None ) -> str : ...
62+
63+ # Token inspection/decoding
64+ def decode (self ,token : str ) -> Dict [str , Any ]: ...
65+ def verify (self ,token : str ) -> bool : ...
66+ def inspect (self ,token : str ) -> Dict [str , Any ]: ...
67+
68+ # Token rotation
69+ def rotation (self ,refresh_token : str , payload : Optional [Dict [str , Any ]] = None ) -> Tuple [str , str ]: ...
70+
71+ # Utility methods
72+ def remaining_time (self ,token : str ) -> Optional [int ]: ...
73+ def algorithm_name (self ,) -> str : ...
74+
75+ # Properties
76+ @property
77+ def secret (self ) -> str : ...
78+ @property
79+ def access_ttl (self ) -> int : ...
80+ @property
81+ def refresh_ttl (self ) -> int : ...
82+
83+ # Async methods
84+ async def access_async (self ,payload : Optional [Dict [str , Any ]] = None ) -> str : ...
85+ async def refresh_async (self ,payload : Optional [Dict [str , Any ]] = None ) -> str : ...
86+ async def decode_async (self ,token : str ) -> Dict [str , Any ]: ...
87+ async def verify_async (self ,token : str ) -> bool : ...
88+ async def rotation_async (self ,refresh_token : str , payload : Optional [Dict [str , Any ]] = None ) -> Tuple [str , str ]: ...
0 commit comments