o
    ^[2h                     @   sB   d dl mZ d dlmZ d dlmZ d dlmZ G dd dZdS )    )Optional)add_params_to_uri)	deprecate)	BaseGrantc                   @   s.   e Zd Zdd Zdd Zdee fddZdS )	IssuerParameterc                 C   s:   t |trtddd |d| j d S |d| j d S )NzIssueParameter should be used as an authorization server extension with 'authorization_server.register_extension(IssueParameter())'.z1.8)versionafter_authorization_response#after_create_authorization_response)
isinstancer   r   register_hookadd_issuer_parameter)selfauthorization_server r   q/home/skpark/git/infrasmart_work/infrasmart/venv/lib/python3.10/site-packages/authlib/oauth2/rfc9207/parameter.py__call__	   s   
zIssuerParameter.__call__c                 C   s4   |   r|jrt|jd|   i}||_d S d S d S )Niss)
get_issuerlocationr   )r   r   responsenew_locationr   r   r   r      s   
z$IssuerParameter.add_issuer_parameterreturnc                 C   s   dS )zReturn the issuer URL.
        Developers MAY implement this method if they want to support :rfc:`RFC9207 <9207>`::

            def get_issuer(self) -> str:
                return "https://auth.example.org"
        Nr   )r   r   r   r   r   &   s   zIssuerParameter.get_issuerN)__name__
__module____qualname__r   r   r   strr   r   r   r   r   r      s    r   N)	typingr   authlib.common.urlsr   authlib.deprecater   authlib.oauth2.rfc6749.grantsr   r   r   r   r   r   <module>   s
    