2# +==== BEGIN CatFeeder =================+
5# ...............)..(.')
7# ...............\(__)|
8# Inspired by Joan Stark
9# source https://www.asciiart.eu/
14# CREATION DATE: 04-01-2026
15# LAST Modified: 8:43:1 22-01-2026
17# This is the backend server in charge of making the actual website work.
19# COPYRIGHT: (c) Cat Feeder
20# PURPOSE: The endpoints that are only accessible by the administrators of the server.
22# +==== END CatFeeder =================+
24from typing
import TYPE_CHECKING, Union, List, Dict, Any, Optional
25from display_tty
import Disp, initialise_logger
26from fastapi
import Request, Response
27from ...core
import RuntimeManager, RI
28from ...utils
import constants
as CONST
29from ...http_codes
import HCI, HttpDataTypes, HTTP_DEFAULT_TYPE
30from ...favicon
import FAV_ERR, favicon_constants
as FAV_CONST
31from ..
import endpoint_helpers
as EP_HELPERS, endpoint_constants
as EP_CONST
34 from ...sql
import SQL
35 from ...server_header
import ServerHeaders
36 from ...favicon.favicon_admin
import FaviconAdmin
37 from ...boilerplates
import BoilerplateIncoming, BoilerplateResponses, BoilerplateNonHTTP
41 """Handle user-related HTTP endpoints.
43 The class implements endpoints for authentication, registration,
44 password reset, profile management, email verification and session
45 management used by the CatFeeder backend.
48 disp: Disp = initialise_logger(__qualname__,
False)
50 def __init__(self, error: int = 84, success: int = 0, debug: bool =
False) ->
None:
54 self.
disp.update_disp_debug(debug)
55 self.
disp.log_debug(
"Initialising...")
63 "BoilerplateIncoming")
65 "BoilerplateResponses")
73 self.
disp.log_debug(
"Initialised")
76 """Get the token of the user if they are administrator, otherwise, return the correct http response.
79 title (str): The title of the endpoint calling this function.
80 request (Request): The incoming request parameters
83 Union[Response, str]: The response if an error occurred, the token otherwise.
RuntimeManager server_headers_initialised
RuntimeManager boilerplate_incoming_initialised
None __init__(self, int error=84, int success=0, bool debug=False)
Union[Response, str] _get_admin_token(self, str title, Request request)
RuntimeManager database_link
RuntimeManager boilerplate_non_http_initialised
RuntimeManager runtime_manager
RuntimeManager boilerplate_responses_initialised