
    i	                        d Z ddlmZ ddlmZ ddlmZmZ ddlm	Z	m
Z
  G d de	          Z ed	          dd            Z e            ZdS )u  
Nom du script : config.py
Chemin : /gitlab-bridge/app/core/config.py
Description : Configuration centralisée de l'application GitLab Bridge via variables d'environnement.
Options éventuelles : Aucune.
Exemples d'utilisation : Importer `settings` depuis ce module.
Prérequis : Python 3.11+, pydantic-settings.
Auteur : Sylvain SCATTOLINI
Date de création / modification : 2026-03-25
Version : 1.1
    )annotations)	lru_cache)
AnyHttpUrlField)BaseSettingsSettingsConfigDictc                     e Zd ZU dZ edddd          Z edd	          Zd
ed<    edd	          Z	d
ed<    edd	          Z
ded<    edd	          Zd
ed<    edd	          Zded<    ed          Zded<    edd          Zd
ed <    ed!d"d#d$%          Zded&<    ed'd(	          Zded)<    ed*gd+	          Zd,ed-<    ed.          Zd
ed/<    ed0d1	          Zded2<    ed3          Zd
ed4<    ed5          Zd
ed6<    ed7          Zd
ed8<    edd9	          Zded:<   ed>d<            Zd=S )?Settingsu8   Paramètres applicatifs chargés depuis l'environnement.z.envzutf-8Fignore)env_fileenv_file_encodingcase_sensitiveextrazgitlab-bridgeAPP_NAME)defaultaliasstrapp_namedevAPP_ENVapp_env	APP_DEBUGbool	app_debugz0.0.0.0APP_HOSTapp_hosti  APP_PORTintapp_portGITLAB_BASE_URL)r   r   gitlab_base_url   GITLAB_API_TOKEN)
min_lengthr   gitlab_api_token      x   GITLAB_TIMEOUT)r   geler   gitlab_timeoutTGITLAB_VERIFY_SSLgitlab_verify_sslzhttps://ia.tarbouriech.techCORS_ORIGINSz	list[str]cors_originsDB_HOSTdb_hosti  DB_PORTdb_portDB_NAMEdb_nameDB_USERdb_userDB_PASSWORDdb_passwordDB_ECHOdb_echoreturnc                X    d| j          d| j         d| j         d| j         d| j         dS )z+Construit l'URL SQLAlchemy MariaDB/PyMySQL.zmysql+pymysql://:@/z?charset=utf8mb4)r8   r:   r2   r4   r6   )selfs    ./var/www/html/gitlab-bridge/app/core/config.pysqlalchemy_database_urlz Settings.sqlalchemy_database_url6   sg    Lt| L Ld.> L L|L L"lL L-1\L L L	
    N)r=   r   )__name__
__module____qualname____doc__r   model_configr   r   __annotations__r   r   r   r   r!   r%   r,   r.   r0   r2   r4   r6   r8   r:   r<   propertyrD    rE   rC   r
   r
      st        BB%%!	  L E/DDDHDDDD5i888G8888eE===I====E):>>>H>>>>E$j999H9999"'%.?"@"@"@O@@@@!EQ6HIIIIIII%qS@PQQQNQQQQ#eD8KLLLLLLL#e./  L    
 5y)))G))))5Y777G77775y)))G))))5y)))G))))u=111K1111E%y999G9999
 
 
 X
 
 
rE   r
      )maxsizer=   c                     t                      S )u0   Retourne une instance singleton des paramètres.)r
   rM   rE   rC   get_settingsrQ   ?   s     ::rE   N)r=   r
   )rI   
__future__r   	functoolsr   pydanticr   r   pydantic_settingsr   r   r
   rQ   settingsrM   rE   rC   <module>rW      s   
 
 # " " " " "       & & & & & & & & > > > > > > > >'
 '
 '
 '
 '
| '
 '
 '
T 1   
 <>>rE   