ffddlZddlmZddlmZmZddlmZmZddlm Z m Z m Z m Z m Z mZddlmZddlmZmZmZmZmZmZmZGd d ZeZejZejZejZdS) N)timegm)IterableMapping)datetime timedelta)AnyDictListOptionalTypeUnion)api_jws) DecodeErrorExpiredSignatureErrorImmatureSignatureErrorInvalidAudienceErrorInvalidIssuedAtErrorInvalidIssuerErrorMissingRequiredClaimErrorc reZdZddZedeeeee efffdZ ddeee fdeded e ed e e ejdef d Z dd edede ededeee ff dZ dd edede ededeee ff dZ ddZdZdZdZdZdZdZdS)PyJWTNcH|i}i|||_dSN)_get_default_optionsoptions)selfrs k/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/jwt/api_jwt.py__init__zPyJWT.__init__s- ?GA$3355AA returncddddddgdS)NT)verify_signature verify_exp verify_nbf verify_iat verify_aud verify_issrequirer*r rrzPyJWT._get_default_optionss(!%   r HS256payloadkey algorithmheaders json_encoderct|tstd|}dD]T}t||t r*t ||||<Utj |d| d}tj |||||S)NzJExpecting a mapping object, as JWT only supports JSON objects as payloads.)expiatnbf),:) separatorsclszutf-8) isinstancer TypeErrorcopygetrr utctimetuplejsondumpsencoder)rr,r-r.r/r0 time_claim json_payloads rr@z PyJWT.encode%s'7++ ,  ,,../ Q QJ'++j118<< Q&,WZ-@-M-M-O-O&P&P #z     &// ~lCG\RRRr jwt algorithmsrc |ddi}n|dd|dsn|dd|dd|dd|dd|dd|dr|std tj|f|||d |} t j|d }n$#t $r}td |zd}~wwxYwt|tstd i|j |} |j || fi|||d <|S)Nr#Tr$Fr%r&r'r(z\It is required that you pass in a value for the "algorithms" argument when calling decode().)r-rErr,zInvalid payload string: %sz-Invalid payload string: must be a json object) setdefaultrrdecode_completer>loads ValueErrorr9dictr_validate_claims) rrDr-rErkwargsdecodedr,emerged_optionss rrHzPyJWT.decode_completeAs ?)40GG   14 8 8 8)* 4   |U 3 3 3   |U 3 3 3   |U 3 3 3   |U 3 3 3   |U 3 3 3 % & z n )  !       @j!344GG @ @ @:Q>?? ? @'4(( OMNN N4DL4G4g~@@@@@$ sC D)C;;Dc 4|j||||fi|}|dS)Nr,)rH)rrDr-rErrMrNs rdecodez PyJWT.decodeos/'$&sCWOOOOy!!r rc t|tr|}t|ttt dt fstd|||ttj }d|vr|dr| |||d|vr|dr||||d|vr|dr|||||dr||||d r|||dSdS) Nz,audience must be a string, iterable, or Noner3r&r4r%r2r$r(r')r9r total_secondsbytesstrtyperr:_validate_required_claimsrrutcnowr= _validate_iat _validate_nbf _validate_exp _validate_iss _validate_aud)rr,raudienceissuerleewayrMnows rrLzPyJWT._validate_claimszsl fi ( ( ,))++F(UCdX$FGG LJKK K &&w888X_&&335566 G   5    wV 4 4 4 G   5    wV 4 4 4 G   5    wV 4 4 4 <  0   w / / / <  2   w 1 1 1 1 1 2 2r cd|dD]&}||t|'dS)Nr))r<r)rr,rclaims rrXzPyJWT._validate_required_claimssEY' 7 7E{{5!!)/666* 7 7r cl t|ddS#t$rtdwxYw)Nr3z)Issued At claim (iat) must be an integer.)intrJr)rr,rbras rrZzPyJWT._validate_iatsN T       T T T&'RSS S Ts3c t|d}n#t$rtdwxYw|||zkrtddS)Nr4z*Not Before claim (nbf) must be an integer.z The token is not yet valid (nbf))rfrJrr)rr,rbrar4s rr[zPyJWT._validate_nbfsq Lgen%%CC L L LJKK K L #,  ()KLL L 2c t|d}n#t$rtdwxYw|||z krtddS)Nr2z/Expiration Time claim (exp) must be an integer.zSignature has expired)rfrJrr)rr,rbrar2s rr\zPyJWT._validate_expsq Tgen%%CC T T TRSS S T #,  '(?@@ @ rhc|d|vrdS|d|vrtd|d|vrtd|dttrgttstdt dDrtdt|tr|g}t fd|DstddS)NaudzInvalid audiencezInvalid claim format in tokenc3BK|]}t|t VdSr)r9rV).0cs r z&PyJWT._validate_aud..s/??!:a%%%??????r c3 K|]}|vV dSrr*)rmrkaudience_claimss rroz&PyJWT._validate_aud..s(>>c3/)>>>>>>r )rrr9rVlistany)rr,r_rqs @rr^zPyJWT._validate_auds$  W 4 4 F  E$8$8,E22 2   0 0''9:: :!%. os + + 0./O/400 H&'FGG G ????? ? ? H&'FGG G h $ $ " zH>>>>X>>>>> ;&'9:: : ; ;r cj|dSd|vrtd|d|krtddS)NisszInvalid issuer)rr)rr,r`s rr]zPyJWT._validate_isssK > F   +E22 2 5>V # #$%566 6 $ #r r)r+NN)rCNN)NNr)__name__ __module__ __qualname__r staticmethodr rVr boolr rrr r r> JSONEncoderr@rHrRrLrXrZr[r\r^r]r*r rrrs+BBBB   $sE$S /,B'B"C    \  !"&9= SSc3hSS S $ S tD$456 S SSSS> $ ,, ,,I ,  , c3h,,,,b $ " "  " "I "  " c3h " " " "DE22228777 TTT MMMAAA;;;:77777r r)r>calendarrcollections.abcrrrrtypingrr r r r r rCr exceptionsrrrrrrrr_jwt_global_objr@rHrRr*r rrsF --------((((((((9999999999999999E7E7E7E7E7E7E7E7P%''  !1  r