
    Xh]                     b    d Z ddlZddlmZ ddlmZ ddlmZ dZ G d d	e      Z	d
Z
de
z  e	fgZy)z-Tornado handlers for frontend config storage.    N)web)
authorized   )
APIHandlerconfigc                       e Zd ZdZeZej                  ed               Z	ej                  ed               Z
ej                  ed               Zy)ConfigHandlerzA config API handler.c                     | j                  dd       | j                  t        j                  | j                  j                  |                   y)zGet config by section name.zContent-Typezapplication/jsonN)
set_headerfinishjsondumpsconfig_managerget)selfsection_names     [/var/www/html/myenv/lib/python3.12/site-packages/jupyter_server/services/config/handlers.pyr   zConfigHandler.get   s9     	(:;DJJt2266|DEF    c                 ~    | j                         }| j                  j                  ||       | j                  d       y)zSet a config section by name.   N)get_json_bodyr   set
set_status)r   r   datas      r   putzConfigHandler.put   s4     !!#d3r   c                     | j                         }| j                  j                  ||      }| j                  t	        j
                  |             y)z Update a config section by name.N)r   r   updater   r   r   )r   r   new_datasections       r   patchzConfigHandler.patch$   s?     %%'%%,,\8DDJJw'(r   N)__name__
__module____qualname____doc__AUTH_RESOURCEauth_resourcer   authenticatedr   r   r   r     r   r   r	   r	      sp    !MG  G
 	   	)  )r   r	   z(?P<section_name>\w+)z/api/config/%s)r$   r   tornador   jupyter_server.auth.decoratorr   base.handlersr   r%   r	   section_name_regexdefault_handlersr(   r   r   <module>r.      sG    3   4 ')J )> .  ++]; r   