OdbDesign
OdbDesign ODB++ Parser - C++ library, gRPC/REST server, CLI, tests
Loading...
Searching...
No Matches
RequestAuthenticationBase.cpp
Go to the documentation of this file.
1
#include "
RequestAuthenticationBase.h
"
2
#include "
macros.h
"
3
4
using namespace
Utils
;
5
6
namespace
Odb::Lib::App
7
{
8
RequestAuthenticationBase::RequestAuthenticationBase
(
bool
disableAuthentication)
9
: m_disableAuthentication(disableAuthentication)
10
{
11
}
12
13
crow::response
RequestAuthenticationBase::AuthenticateRequest
(
const
crow::request& req)
14
{
15
// if running debug build AND in Local environment, bypass authentication
16
if
(IsDebug() && IsLocal())
17
{
18
// 200 Authorized!
19
return
crow::response(crow::status::OK,
"Authorized"
);
20
}
21
else
if
(
m_disableAuthentication
)
22
{
23
// 200 Authorized!
24
return
crow::response(crow::status::OK,
"Authorized"
);
25
}
26
else
27
{
28
return
crow::response(crow::status::UNAUTHORIZED,
"Unauthorized"
);
29
}
30
}
31
}
RequestAuthenticationBase.h
Odb::Lib::App::RequestAuthenticationBase::AuthenticateRequest
virtual crow::response AuthenticateRequest(const crow::request &req)
Definition
RequestAuthenticationBase.cpp:13
Odb::Lib::App::RequestAuthenticationBase::m_disableAuthentication
bool m_disableAuthentication
Definition
RequestAuthenticationBase.h:19
Odb::Lib::App::RequestAuthenticationBase::RequestAuthenticationBase
RequestAuthenticationBase()=default
macros.h
Odb::Lib::App
Definition
BasicRequestAuthentication.cpp:7
Utils
Definition
ArchiveExtractor.cpp:15
OdbDesignLib
App
RequestAuthenticationBase.cpp
Generated by
1.9.8