Format: application/x-python-code
1 o
2
3 G'hs] � @ s d dl Z d dlmZ d dlmZ d dlmZ d dlZd dlmZ d dlmZ d dlm Z d dlm
4 Z
5 d d lmZ d d
6 lmZ d dlm
7 Z
8 d dlmZ d d
9 lmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlm Z d dlm!Z! d dlm"Z" d dlm#Z# d dlm$Z$ d d lm%Z% d d!lm&Z& d d"lm'Z' d d#lm(Z( d d$lm)Z) d d%l*m+Z+ d d&l*m,Z, d d'l-m.Z. d d(l-m/Z/ d d)l0m1Z1 G d*d+� d+e2�Z3dS ),� N)�Any)�Callable)�Optional)�Flask)�DecodeError)�ExpiredSignatureError)�InvalidAudienceError)�InvalidIssuerError)�InvalidTokenError)�MissingRequiredClaimError)�config)�"default_additional_claims_callback)�default_blocklist_callback)�default_decode_key_callback)�default_encode_key_callback)�default_expired_token_callback)�default_invalid_token_callback)�default_jwt_headers_callback)�"default_needs_fresh_token_callback)�default_revoked_token_callback)�#default_token_verification_callback)�*default_token_verification_failed_callback)�default_unauthorized_callback)�default_user_identity_callback)�"default_user_lookup_error_callback)� CSRFError)�FreshTokenRequired)�InvalidHeaderError)�InvalidQueryParamError)�JWTDecodeError)�NoAuthorizationError)�RevokedTokenError)�UserClaimsVerificationError)�UserLookupError)�WrongTokenError)�_decode_jwt)�_encode_jwt)�ExpiresDelta)�Fresh)�current_user_context_processorc @ s� e Zd ZdZ d8dee deddfdd�Zd9dededdfd d
10 �Zdeddfdd�Z e
11 deddfd
12 d��Zdedefdd�Z
13 dedefdd�Zdedefdd�Zdedefdd�Zdedefdd�Zdedefdd�Zdedefdd�Zdedefdd�Zdedefd d!�Zdedefd"d#�Zdedefd$d%�Zdedefd&d'�Zdedefd(d)�Zdedefd*d+�Zdedefd,d-�Z d:d.ed/ed0ed1ee def
14 d2d3�Z d8d4ed5ede!fd6d7�Z"dS );�
15 JWTManagera&
16 An object used to hold JWT settings and callback functions for the
17 Flask-JWT-Extended extension.
18
19 Instances of :class:`JWTManager` are *not* bound to specific apps, so
20 you can create one in the main body of your code and then bind it
21 to your app in a factory function.
22 NF�app�add_context_processor�returnc C sv t | _t| _t| _t| _t| _ t
23 | _t| _
24 t| _t| _t| _t| _t| _d| _t| _t| _|dur9| �||� dS dS )a
25 Create the JWTManager instance. You can either pass a flask application
26 in directly here to register this extension with the flask app, or
27 call init_app after creating this object (in a factory pattern).
28
29 :param app:
30 The Flask Application object
31 :param add_context_processor:
32 Controls if `current_user` is should be added to flasks template
33 context (and thus be available for use in Jinja templates). Defaults
34 to ``False``.
35 N)r �_decode_key_callbackr �_encode_key_callbackr �_expired_token_callbackr �_invalid_token_callbackr �_jwt_additional_header_callbackr �_needs_fresh_token_callbackr �_revoked_token_callbackr �_token_in_blocklist_callbackr �_token_verification_callbackr �_unauthorized_callbackr
36 �_user_claims_callbackr �_user_identity_callback�_user_lookup_callbackr �_user_lookup_error_callbackr �#_token_verification_failed_callback�init_app��selfr+ r, � r@ �TC:\Users\shubh\Videos\agent\nova\Lib\site-packages\flask_jwt_extended/jwt_manager.py�__init__; s&