PIHTTPServer basic auth works
This commit is contained in:
@@ -32,15 +32,25 @@ public:
|
||||
bool isListen() const;
|
||||
void stop();
|
||||
|
||||
void enableBasicAuth() { setBasicAuthEnabled(true); }
|
||||
void disableBasicAuth() { setBasicAuthEnabled(false); }
|
||||
void setBasicAuthEnabled(bool yes) { use_basic_auth = yes; }
|
||||
bool isBasicAuthEnabled() const { return use_basic_auth; }
|
||||
void setBasicAuthRealm(const PIString & r) { realm = r; }
|
||||
|
||||
void setRequestCallback(std::function<PIHTTP::MessageMutable(const PIHTTP::MessageConst &)> c) { callback = c; }
|
||||
void setBasicAuthCallback(std::function<bool(const PIString &, const PIString &)> c) { callback_auth = c; }
|
||||
|
||||
private:
|
||||
static void addFixedHeaders(PIHTTP::MessageMutable & msg);
|
||||
PRIVATE_DECLARATION(PIP_HTTP_SERVER_EXPORT)
|
||||
|
||||
PIByteArray favicon;
|
||||
PIString realm;
|
||||
PIMap<Option, PIVariant> opts;
|
||||
std::function<PIHTTP::MessageMutable(const PIHTTP::MessageConst &)> callback;
|
||||
std::function<bool(const PIString &, const PIString &)> callback_auth;
|
||||
std::atomic_bool use_basic_auth = {false};
|
||||
PIByteArray mem_key, mem_cert, key_pass;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user