
    ([f                     N    d dl mZ d dlmZ d dlmZmZmZ  G d de          ZdS )   )
BaseServer)OAuth1Request)MissingRequiredParameterErrorInvalidClientErrorInvalidTokenErrorc                       e Zd Zd Zd ZdS )ResourceProtectorc                    t          ||||          }|j        st          d          |                     |j                  }|st	                      ||_        |j        st          d          |                     |          }|st                      ||_	        | 
                    |           |                     |           |S )Noauth_consumer_keyoauth_token)r   	client_idr   get_client_by_idr   clienttokenget_token_credentialr   
credentialvalidate_timestamp_and_noncevalidate_oauth_signature)selfmethoduribodyheadersrequestr   r   s           ]/var/www/piapp/venv/lib/python3.11/site-packages/authlib/oauth1/rfc5849/resource_protector.pyvalidate_requestz"ResourceProtector.validate_request   s    T7;;  	F/0DEEE&&w'899 	'$&&&} 	?/>>>))'22 	&#%%%"))'222%%g...    c                     t                      )zFetch the token credential from data store like a database,
        framework should implement this function.

        :param request: OAuth1Request instance
        :return: Token model instance
        )NotImplementedError)r   r   s     r   r   z&ResourceProtector.get_token_credential"   s     "###r   N)__name__
__module____qualname__r   r    r   r   r	   r	   
   s2          .$ $ $ $ $r   r	   N)	base_serverr   wrapperr   errorsr   r   r   r	   r#   r   r   <module>r'      s    # # # # # # " " " " " "         $ $ $ $ $
 $ $ $ $ $r   