
    Wwg                         U d dl Z d dlmZmZmZmZ d dlZd dlmZ d dl	m
Z
 g dZ G d de j                        Zg Zee   ed<   d	Zd
 Zy)    N)ClassVarContextManagerListOptional)
CLIContext)Signer)SigningCommandPluginregister_signing_pluginr   SIGNING_PLUGIN_REGISTRY SIGNING_PLUGIN_ENTRY_POINT_GROUPc                       e Zd ZU dZee   ed<   	 ee   ed<   	 dZeee      ed<   	 de	e
j                     fdZde	e
j                     fdZdefd	Zd
edee   fdZy)r	   a  

    .. versionadded:: 0.18.0

    Interface for integrating custom, user-supplied
    signers into the pyHanko CLI as subcommands of ``addsig``.

    Implementations are discovered through the ``pyhanko.cli_plugin.signing``
    package entry point. Such entry points can be registered in
    ``pyproject.toml`` as follows:

    .. code-block:: toml

       [project.entry-points."pyhanko.cli_plugin.signing"]
       your_plugin = "some_package.path.to.module:SomePluginClass"

    Subclasses exposed as entry points are required to have a no-arguments
    ``__init__`` method.

    .. warning::
        This is an incubating feature. API adjustments are still possible.

    .. warning::
        Plugin support requires Python 3.8 or later.
    subcommand_namehelp_summaryNunavailable_messagereturnc                     t         )zH
        The list of ``click`` options for your custom command.
        NotImplementedErrorselfs    M/var/www/horilla/myenv/lib/python3.12/site-packages/pyhanko/cli/plugin_api.pyclick_optionsz"SigningCommandPlugin.click_options<   s
     "!    c                     g S )zJ
        The list of ``click`` arguments for your custom command.
         r   s    r   click_extra_argumentsz*SigningCommandPlugin.click_extra_argumentsB   s	     	r   c                      y)a  
        A hook to determine whether your plugin is available
        or not (e.g. based on the availability of certain dependencies).
        This should not depend on the pyHanko configuration, but may query
        system information in other ways as appropriate.

        The default is to always report the plugin as available.

        :return:
            return ``True`` if the plugin is available, else ``False``
        Tr   r   s    r   is_availablez!SigningCommandPlugin.is_availableH   s     r   contextc                     t         )a  
        Instantiate a context manager that creates and potentially
        also implements a deallocator for a :class:`.Signer` object.

        :param context:
            The active :class:`.CLIContext`.
        :param kwargs:
            All keyword arguments processed by ``click`` through the CLI,
            resulting from :meth:`click_options` and
            :meth:`click_extra_arguments`.
        :return:
            A context manager that manages the lifecycle for a :class:`.Signer`.
        r   )r   r   kwargss      r   create_signerz"SigningCommandPlugin.create_signerV   s
      "!r   )__name__
__module____qualname____doc__r   str__annotations__r   r   r   clickOptionr   Argumentr   boolr   r   r   r   r"   r   r   r   r	   r	      s    4 c]" 3- 48(3-07"tELL1 "tENN'; d "!"		"r   r	   r   zpyhanko.cli_plugin.signingc                 :    t         j                   |               | S )z
    Manually put a plugin into the signing plugin registry.

    :param cls:
        A plugin class.
    :return:
        The same class.
    )r   append)clss    r   r
   r
   m   s     ""35)Jr   )abctypingr   r   r   r   r)   pyhanko.cli._ctxr   pyhanko.signr   __all__ABCr	   r   r(   r   r
   r   r   r   <module>r6      sO    
 ; ;  ' T"377 T"n 79 23 8#?  
r   