From 1a0b00e989d942f128bfeafa69c5834457e16060 Mon Sep 17 00:00:00 2001 From: stephb9959 Date: Tue, 16 Aug 2022 09:02:59 -0700 Subject: [PATCH] https://telecominfraproject.atlassian.net/browse/WIFI-10577 Signed-off-by: stephb9959 --- build | 2 +- src/RESTAPI/RESTAPI_db_helpers.h | 4 +++- src/framework/MicroService.h | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build b/build index e440e5c..7813681 100644 --- a/build +++ b/build @@ -1 +1 @@ -3 \ No newline at end of file +5 \ No newline at end of file diff --git a/src/RESTAPI/RESTAPI_db_helpers.h b/src/RESTAPI/RESTAPI_db_helpers.h index 2061e45..638d2be 100644 --- a/src/RESTAPI/RESTAPI_db_helpers.h +++ b/src/RESTAPI/RESTAPI_db_helpers.h @@ -405,7 +405,9 @@ namespace OpenWifi { } inline bool ValidateConfigBlock(const ProvObjects::DeviceConfiguration &Config, RESTAPI::Errors::msg & Error) { - static const std::vector SectionNames{ "globals", "interfaces", "metrics", "radios", "services", "unit" }; + static const std::vector SectionNames{ "globals", "interfaces", "metrics", "radios", "services", + "unit", "definitions", "ethernet", "switch", "config-raw", + "third-party" }; for(const auto &i:Config.configuration) { Poco::JSON::Parser P; diff --git a/src/framework/MicroService.h b/src/framework/MicroService.h index dc95ff3..ae1a608 100644 --- a/src/framework/MicroService.h +++ b/src/framework/MicroService.h @@ -2446,6 +2446,7 @@ namespace OpenWifi { Poco::Net::HTTPServerResponse *Response= nullptr; SecurityObjects::UserInfoAndPolicy UserInfo_; QueryBlock QB_; + const std::string & Requester() const { return REST_Requester_; } protected: BindingMap Bindings_; Poco::URI::QueryParameters Parameters_; @@ -2462,6 +2463,7 @@ namespace OpenWifi { RateLimit MyRates_; uint64_t TransactionId_; Poco::JSON::Object::Ptr ParsedBody_; + std::string REST_Requester_; }; class RESTAPI_UnknownRequestHandler : public RESTAPIHandler { @@ -4754,6 +4756,7 @@ namespace OpenWifi { } } else { auto Id = Request->get("X-INTERNAL-NAME", "unknown"); + REST_Requester_ = Id; if(Server_.LogIt(Request->getMethod(),true)) { Logger_.debug(fmt::format("I-REQ-ALLOWED({}): User='{}' Method={} Path={}", Utils::FormatIPv6(Request->clientAddress().toString()), Id, @@ -4777,6 +4780,7 @@ namespace OpenWifi { #else if (AuthClient()->IsAuthorized( SessionToken_, UserInfo_, Expired, Contacted, Sub)) { #endif + REST_Requester_ = UserInfo_.userinfo.email; if(Server_.LogIt(Request->getMethod(),true)) { Logger_.debug(fmt::format("X-REQ-ALLOWED({}): User='{}@{}' Method={} Path={}", UserInfo_.userinfo.email,