Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
TestWebServerAuth Class Reference

Web server requiring authentication, with the credentials held by the password manager rather than being part of the requested url. More...

Inheritance diagram for TestWebServerAuth:
TestWebServer TestWebServerAuthHelper

Protected Member Functions

void SetUp () override
 
void TearDown () override
 
- Protected Member Functions inherited from TestWebServer
 TestWebServer ()
 
 ~TestWebServer () override=default
 
void SetUp () override
 
void TearDown () override
 
void SetupMediaSources ()
 
void TearDownMediaSources ()
 
std::string GetUrl (const std::string &path)
 
std::string GetUrlOfTestFile (const std::string &testFile)
 
bool GetLastModifiedOfTestFile (const std::string &testFile, CDateTime &lastModified)
 
void CheckHtmlTestFileResponse (const CCurlFile &curl)
 
void CheckRangesTestFileResponse (const CCurlFile &curl, int httpStatus=MHD_HTTP_OK, bool empty=false)
 
void CheckRangesTestFileResponse (const CCurlFile &curl, const std::string &result, const CHttpRanges &ranges)
 
std::string GenerateRangeHeaderValue (unsigned int start, unsigned int end)
 

Static Protected Member Functions

static void SetUpTestSuite ()
 
static void TearDownTestSuite ()
 
- Static Protected Member Functions inherited from TestWebServer
static void StartSuiteServer (std::string_view username, std::string_view password)
 
static void StopSuiteServer ()
 
static void SetUpTestSuite ()
 
static void TearDownTestSuite ()
 

Static Protected Attributes

static constexpr std::string_view SERVER_USERNAME {"kodi"}
 
static constexpr std::string_view SERVER_PASSWORD {"secret"}
 
- Static Protected Attributes inherited from TestWebServer
static constexpr std::string_view SERVER_USERNAME {""}
 
static constexpr std::string_view SERVER_PASSWORD {""}
 
static std::unique_ptr< CWebServers_webserver
 
static std::unique_ptr< CHTTPJsonRpcHandlers_jsonRpcHandler
 
static std::unique_ptr< CHTTPVfsHandlers_vfsHandler
 
static std::string s_baseUrl
 

Additional Inherited Members

- Protected Attributes inherited from TestWebServer
std::string sourcePath
 

Detailed Description

Web server requiring authentication, with the credentials held by the password manager rather than being part of the requested url.

This is what adding a source with a username/password gives us: sources.xml holds the plain url and passwords.xml holds the credentials, so every request has to pick them up from CPasswordManager. Anything talking to the server directly instead of going through CFile has to apply them itself, which is what these tests cover.

Member Function Documentation

◆ SetUp()

void TestWebServerAuth::SetUp ( )
inlineoverrideprotected

◆ SetUpTestSuite()

static void TestWebServerAuth::SetUpTestSuite ( )
inlinestaticprotected

◆ TearDown()

void TestWebServerAuth::TearDown ( )
inlineoverrideprotected

◆ TearDownTestSuite()

static void TestWebServerAuth::TearDownTestSuite ( )
inlinestaticprotected

Member Data Documentation

◆ SERVER_PASSWORD

std::string_view TestWebServerAuth::SERVER_PASSWORD {"secret"}
staticconstexprprotected

◆ SERVER_USERNAME

std::string_view TestWebServerAuth::SERVER_USERNAME {"kodi"}
staticconstexprprotected

The documentation for this class was generated from the following file: