
    -&iB                     $    S SK Jr   " S S5      rg)    )JsonResponsec                   (    \ rS rSrSrSrS rS rSrg)RequireAuthHeaderMiddleware   z
Temporary middleware to require Authorization header for API endpoints
except for explicitly whitelisted public endpoints.
This does not validate JWTs, it only enforces presence while proper
auth integration is finalized.
)z/api/companies/search/z/api/companies/login/z/api/auth/login/z/api/auth/refresh/z/api/employeetypes/z/api/supervisors/z/api/supervisorgroups/z/api/users/z/api/configurations/z/api/stamps/z"/api/stamps/worktime-report/excel/z /api/stamps/worktime-report/pdf/z/api/clients/report/excel/z/api/clients/report/pdf/z/api/projects/report/excel/z/api/projects/report/pdf/z/api/paycodes/z/api/shifts/z/api/projects/z/api/tasks/z/api/clients/z/api/questionconfigurations/z/api/payroll/c                     Xl         g Nget_response)selfr
   s     ,D:\TimeStamps\worktimeapp\auth_middleware.py__init__$RequireAuthHeaderMiddleware.__init__&   s    (    c                   ^ UR                   mTR                  S5      (       aR  [        U4S jU R                   5       5      (       d.  UR                  R                  S5      nU(       d  [        SS0SS9$ U R                  U5      $ )Nz/api/c              3   F   >#    U  H  nTR                  U5      v   M     g 7fr   )
startswith).0ppaths     r   	<genexpr>7RequireAuthHeaderMiddleware.__call__.<locals>.<genexpr>+   s     /^L]q0B0BL]s   !AuthorizationerrorzAuthorization header requiredi  )status)r   r   anyPUBLIC_PATHSheadersgetr   r
   )r   requestauthr   s      @r   __call__$RequireAuthHeaderMiddleware.__call__)   sm    ||??7##C/^DL]L]/^,^,^??&&7D#W.M$NWZ[[  ))r   r	   N)	__name__
__module____qualname____firstlineno____doc__r   r   r!   __static_attributes__ r   r   r   r      s    L4)*r   r   N)django.httpr   r   r)   r   r   <module>r+      s    $+* +*r   