
    'jU                     f   d dl mZmZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 deedf         defd	Zdeedf         defd
Zg dZdeedf         defdZdeedf         defdZdeedf         defdZdefdZdede
fdZdee         defdZdeedf         dee         dee         defdZdS )    )OptionalUnion)SlackResponse)AuthorizeResult)BoltRequestBoltResponsereqAsyncBoltRequestreturnc                 X    | d uo&| j         d uo| j                             d          dk    S )Ntypeurl_verificationbodygetr
   s    n/usr/local/lib/hermes-agent/venv/lib/python3.11/site-packages/slack_bolt/middleware/authorization/internals.py_is_url_verificationr      s1    d?bsxt3bV8L8LPb8bb    c                 X    | d uo&| j         d uo| j                             d          dk    S )Nr   	ssl_checkr   r   s    r   _is_ssl_checkr      s1    d?[sxt3[V8L8LP[8[[r   )app_uninstalledtokens_revokedteam_access_revokedc                     | d uo[| j         d uoR| j                             d          dk    o4| j                             di                               d          t          v S )Nr   event_callbackevent)r   r   no_auth_test_eventsr   s    r   _is_no_auth_test_eventsr!      sj    4 	IHD 	IHLL  $44	I HLL"%%))&115HH	r   c                 >    t          |           pt          |           S N)r   r   r   s    r   _is_no_auth_requiredr$   &   s    $$:c(:(::r   c                      t          |           S r#   )r!   r   s    r   _is_no_auth_test_call_requiredr&   *   s    "3'''r   c                      	 dS )Nz:warning: We apologize, but for some unknown reason, your installation with this app is no longer available. Please reinstall this app into your workspace :bow: r(   r   r   *_build_user_facing_authorize_error_messager)   .   s    	> r   messagec                 $    t          d|           S )N   )statusr   r   )r*   s    r   !_build_user_facing_error_responser.   5   s       r   tokenc                 4    | d uo|                      d          S )Nzxoxb-)
startswith)r/   s    r   _is_bot_tokenr2   =   s     :!1!1'!:!::r   auth_test_resultAsyncSlackResponserequest_user_idc                    |                      d          }| j                             d          }t          |                      d          |                      d          |                      d          t          |          r|nd t          |          r|nd |pt          |          s|nd t          |          s|nd t          |          r|nd t          |          rd n|	  	        S )Nuser_idzx-oauth-scopesenterprise_idteam_idbot_id)	r8   r9   r:   bot_user_id	bot_tokenr7   
user_token
bot_scopesuser_scopes)r   headersr   r2   )r3   r/   r5   r7   oauth_scopess        r   _to_authorize_resultrB   A   s    
 ""9--G"2":">">?O"P"PL&**?;; $$Y//##H--,U33=GG(//9%%TR=3G3G$QGGT -e 4 4>55$#0#7#7A<<T)%00BDDl
 
 
 
r   N)typingr   r   slack_sdk.webr   slack_bolt.authorizationr   slack_bolt.request.requestr   slack_bolt.responser	   boolr   r   r    r!   r$   r&   strr)   r.   r2   rB   r(   r   r   <module>rJ      s   " " " " " " " " ' ' ' ' ' ' 4 4 4 4 4 4 2 2 2 2 2 2 , , , , , ,ceK1C$CD c c c c c\u[*<<= \$ \ \ \ \ SRR {4F'F!G D    ;eK1C$CD ; ; ; ; ;(k;M.M(N (SW ( ( ( (C    s |    ;# ;4 ; ; ; ;M+??@C= c] 	     r   