supla-device
Loading...
Searching...
No Matches
Supla::WebServer Class Referenceabstract
Inheritance diagram for Supla::WebServer:
Collaboration diagram for Supla::WebServer:

Public Types

enum class  WebServerMode { HttpOnly , HttpsOnly , Auto }

Public Member Functions

 WebServer (Supla::HtmlGenerator *)
virtual void start ()=0
virtual void stop ()=0
virtual void setWebServerMode (WebServerMode mode)
virtual WebServerMode getWebServerMode () const
virtual WebServerMode resolveWebServerMode () const
void setSuplaDeviceClass (SuplaDeviceClass *)
void notifyClientConnected (bool isPost=false)
virtual void parsePost (const char *postContent, int size, bool lastChunk=true)
virtual void resetParser ()
const char * getCsrfToken ()
bool isCsrfTokenValid (const char *token)
void setBetaProcessing ()
void setCsrfFirstFieldRequired (bool required)
virtual bool verifyEmbeddedHttpsCertificates ()

Static Public Member Functions

static WebServer * Instance ()

Public Attributes

Supla::HtmlGeneratorhtmlGenerator = nullptr

Protected Member Functions

void addSecurityLog (Supla::SecurityLogSource source, const char *log) const
void addSecurityLog (uint32_t source, const char *log) const
bool isSectionAllowed (Supla::HtmlSection section) const
 Check if section is allowed in current POST request.
void cleanupParser ()

Protected Attributes

bool destroyGenerator = false
SuplaDeviceClasssdc = nullptr
bool keyFound = false
int partialSize = 0
char key [HTML_KEY_LENGTH] = {}
char * value = nullptr
bool betaProcessing = false
bool csrfFirstFieldRequired = true
bool csrfValidated = false
bool csrfRejected = false
uint8_t csrfSecret [16] = {}
char csrfToken [33] = {}

Static Protected Attributes

static WebServer * webServerInstance = nullptr

Member Function Documentation

◆ isSectionAllowed()

bool Supla::WebServer::isSectionAllowed ( Supla::HtmlSection section) const
protected

Check if section is allowed in current POST request.

It excludes html elements in /beta page POST, and vice versa

Parameters
section
Returns
true if section is allowed to be processed

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