LCOV - code coverage report
Current view: top level - OdbDesignLib/App - RequestAuthenticationBase.cpp (source / functions) Coverage Total Hit
Test: OdbDesign Test Coverage Lines: 0.0 % 9 0
Test Date: 2026-11-21 03:51:50 Functions: 0.0 % 2 0
Legend: Lines: hit not hit

            Line data    Source code
       1              : #include "RequestAuthenticationBase.h"
       2              : #include "macros.h"
       3              : 
       4              : using namespace Utils;
       5              : 
       6              : namespace Odb::Lib::App
       7              : {       
       8            0 :         RequestAuthenticationBase::RequestAuthenticationBase(bool disableAuthentication)
       9            0 :                 : m_disableAuthentication(disableAuthentication)
      10              :         {
      11            0 :         }       
      12              : 
      13            0 :         crow::response RequestAuthenticationBase::AuthenticateRequest(const crow::request& req)
      14              :         {
      15              :                 // if running debug build AND in Local environment, bypass authentication
      16            0 :                 if (IsDebug() && IsLocal())
      17              :                 {
      18              :                         // 200 Authorized!
      19            0 :                         return crow::response(crow::status::OK, "Authorized");
      20              :                 }
      21            0 :                 else if (m_disableAuthentication)
      22              :                 {
      23              :                         // 200 Authorized!
      24            0 :                         return crow::response(crow::status::OK, "Authorized");
      25              :                 }
      26              :                 else
      27              :                 {
      28            0 :                         return crow::response(crow::status::UNAUTHORIZED, "Unauthorized");
      29              :                 }
      30              :         }
      31              : }
        

Generated by: LCOV version 2.0-1