pyc • Lines: 130�
���j� � � � d Z ddlZddlZddlZddlmZ ddlmZ ddlmZ ddl
mZ ddlm
Z
d� Zd � Zd
� Zd� Zdd�Zd
� Zd� Zd� Zy)u� Per-user context files and HTTP identity resolution.
Identity comes from :mod:`server.auth` — Authentik is the single identity
provider (there is no users.json anymore). This module keeps the names the
chat engine calls: password lookup is gone, context paths are derived from the
username, and ``get_current_user``/``get_current_identity`` resolve the
request's identity through the shared auth layer.
� N)�datetime)�get_current_user)�get_identity)�CONTEXTS_DIR)�Mc �D � t j dd| xs d� }|xs dS )Nz[^A-Za-z0-9_-]�_� �unknown)�re�sub)�user�safes �2/home/palash/git/local-ai/server/features/users.py�_safe_usernamer s$ � �
�6�6�#�S�$�*�"�5�D���9�� c � � | syt j 5 t j � t j | <