From e0451ef59a69eda29efa6bc22294b2bcf8b8b600 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Fri, 29 May 2020 11:31:40 +0200 Subject: Authentication infrastructure --- plugins/cgi/cgi.cpp | 4 ++++ plugins/cgi/cgi.h | 6 ++++-- plugins/fcgi/fcgi.cpp | 5 +++++ plugins/fcgi/fcgi.h | 6 ++++-- plugins/redirect/redirect.cpp | 5 +++++ plugins/redirect/redirect.h | 7 ++++--- plugins/static-files/static-files.cpp | 5 +++++ plugins/static-files/static-files.h | 5 +++-- plugins/statistics/statistics.cpp | 5 +++++ plugins/statistics/statistics.h | 5 +++-- plugins/webbox/webbox.cpp | 4 ++++ plugins/webbox/webbox.h | 8 ++++++-- plugins/weblog/weblog.cpp | 4 ++++ plugins/weblog/weblog.h | 6 ++++-- 14 files changed, 60 insertions(+), 15 deletions(-) (limited to 'plugins') diff --git a/plugins/cgi/cgi.cpp b/plugins/cgi/cgi.cpp index 480ae9e..131855e 100644 --- a/plugins/cgi/cgi.cpp +++ b/plugins/cgi/cgi.cpp @@ -290,3 +290,7 @@ std::string cgi_plugin::generate_page( } } +bool cgi_plugin::has_own_authentication() +{ + return false; +} diff --git a/plugins/cgi/cgi.h b/plugins/cgi/cgi.h index 467a6c4..5093901 100644 --- a/plugins/cgi/cgi.h +++ b/plugins/cgi/cgi.h @@ -8,12 +8,14 @@ public: cgi_plugin(); ~cgi_plugin(); - std::string name(); + std::string name() override; std::string generate_page( std::function& GetServerParam, std::function& GetRequestParam, // request including body (POST...) std::function& SetResponseHeader // to be added to result string - ); + ) override; + + bool has_own_authentication() override; }; diff --git a/plugins/fcgi/fcgi.cpp b/plugins/fcgi/fcgi.cpp index 6f4ad1f..22a4d40 100644 --- a/plugins/fcgi/fcgi.cpp +++ b/plugins/fcgi/fcgi.cpp @@ -538,3 +538,8 @@ std::string fcgi_plugin::generate_page( } } +bool fcgi_plugin::has_own_authentication() +{ + return false; +} + diff --git a/plugins/fcgi/fcgi.h b/plugins/fcgi/fcgi.h index 289c4d6..167a356 100644 --- a/plugins/fcgi/fcgi.h +++ b/plugins/fcgi/fcgi.h @@ -41,12 +41,14 @@ public: fcgi_plugin(); ~fcgi_plugin(); - std::string name(); + std::string name() override; std::string generate_page( std::function& GetServerParam, std::function& GetRequestParam, // request including body (POST...) std::function& SetResponseHeader // to be added to result string - ); + ) override; + + bool has_own_authentication() override; std::string fcgiQuery(FCGIContext& context); }; diff --git a/plugins/redirect/redirect.cpp b/plugins/redirect/redirect.cpp index 91d5f64..796926d 100644 --- a/plugins/redirect/redirect.cpp +++ b/plugins/redirect/redirect.cpp @@ -62,3 +62,8 @@ std::string redirect_plugin::generate_page( } } +bool redirect_plugin::has_own_authentication() +{ + return false; +} + diff --git a/plugins/redirect/redirect.h b/plugins/redirect/redirect.h index 403cc16..472f9f2 100644 --- a/plugins/redirect/redirect.h +++ b/plugins/redirect/redirect.h @@ -8,13 +8,14 @@ public: redirect_plugin(); ~redirect_plugin(); - std::string name(); + std::string name() override; std::string generate_page( std::function& GetServerParam, std::function& GetRequestParam, // request including body (POST...) std::function& SetResponseHeader // to be added to result string - ); - + ) override; + + bool has_own_authentication() override; }; extern "C" BOOST_SYMBOL_EXPORT redirect_plugin webserver_plugin; diff --git a/plugins/static-files/static-files.cpp b/plugins/static-files/static-files.cpp index 345cf56..b2dcdca 100644 --- a/plugins/static-files/static-files.cpp +++ b/plugins/static-files/static-files.cpp @@ -115,3 +115,8 @@ std::string static_files_plugin::generate_page( } } +bool static_files_plugin::has_own_authentication() +{ + return false; +} + diff --git a/plugins/static-files/static-files.h b/plugins/static-files/static-files.h index ff35e92..a119387 100644 --- a/plugins/static-files/static-files.h +++ b/plugins/static-files/static-files.h @@ -8,13 +8,14 @@ public: static_files_plugin(); ~static_files_plugin(); - std::string name(); + std::string name() override; std::string generate_page( std::function& GetServerParam, std::function& GetRequestParam, // request including body (POST...) std::function& SetResponseHeader // to be added to result string - ); + ) override; + bool has_own_authentication() override; }; extern "C" BOOST_SYMBOL_EXPORT static_files_plugin webserver_plugin; diff --git a/plugins/statistics/statistics.cpp b/plugins/statistics/statistics.cpp index 6d3899e..3ebd301 100644 --- a/plugins/statistics/statistics.cpp +++ b/plugins/statistics/statistics.cpp @@ -132,3 +132,8 @@ std::string statistics_plugin::generate_page( } } +bool statistics_plugin::has_own_authentication() +{ + return false; +} + diff --git a/plugins/statistics/statistics.h b/plugins/statistics/statistics.h index 5db309b..e998643 100644 --- a/plugins/statistics/statistics.h +++ b/plugins/statistics/statistics.h @@ -8,13 +8,14 @@ public: statistics_plugin(); ~statistics_plugin(); - std::string name(); + std::string name() override; std::string generate_page( std::function& GetServerParam, std::function& GetRequestParam, // request including body (POST...) std::function& SetResponseHeader // to be added to result string - ); + ) override; + bool has_own_authentication() override; }; extern "C" BOOST_SYMBOL_EXPORT statistics_plugin webserver_plugin; diff --git a/plugins/webbox/webbox.cpp b/plugins/webbox/webbox.cpp index 09ac7c5..de8df85 100644 --- a/plugins/webbox/webbox.cpp +++ b/plugins/webbox/webbox.cpp @@ -943,3 +943,7 @@ void webbox_plugin::registerCommand(std::shared_ptr command) m_commands[command->getCommandName()] = command; }; +bool webbox_plugin::has_own_authentication() +{ + return true; +} diff --git a/plugins/webbox/webbox.h b/plugins/webbox/webbox.h index dd2fb93..cd4e21d 100644 --- a/plugins/webbox/webbox.h +++ b/plugins/webbox/webbox.h @@ -18,12 +18,16 @@ private: public: webbox_plugin(); ~webbox_plugin(); - std::string name(); + + std::string name() override; + std::string generate_page( std::function& GetServerParam, std::function& GetRequestParam, // request including body (POST...) std::function& SetResponseHeader // to be added to result string - ); + ) override; + + bool has_own_authentication() override; }; extern "C" BOOST_SYMBOL_EXPORT webbox_plugin webserver_plugin; diff --git a/plugins/weblog/weblog.cpp b/plugins/weblog/weblog.cpp index c18f120..1e1b6b2 100644 --- a/plugins/weblog/weblog.cpp +++ b/plugins/weblog/weblog.cpp @@ -441,3 +441,7 @@ std::string weblog_plugin::generate_page( } } +bool weblog_plugin::has_own_authentication() +{ + return false; +} diff --git a/plugins/weblog/weblog.h b/plugins/weblog/weblog.h index 28b4ab3..0994b91 100644 --- a/plugins/weblog/weblog.h +++ b/plugins/weblog/weblog.h @@ -8,13 +8,15 @@ public: weblog_plugin(); ~weblog_plugin(); - std::string name(); + std::string name() override; + std::string generate_page( std::function& GetServerParam, std::function& GetRequestParam, // request including body (POST...) std::function& SetResponseHeader // to be added to result string - ); + ) override; + bool has_own_authentication() override; }; extern "C" BOOST_SYMBOL_EXPORT weblog_plugin webserver_plugin; -- cgit v1.2.3