From 053843f893dd5c96a88e285cf2a5b35419f7dfca Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 31 Aug 2009 18:11:46 +0200 Subject: Immer Authentifizierung fordern --- src/Common/ClientConnection.h | 5 +++++ src/Common/Connection.h | 3 +++ src/Common/RequestHandlers/FSInfoRequestHandler.cpp | 3 ++- src/Common/RequestHandlers/SimpleRequestHandler.cpp | 2 -- src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp | 2 -- src/Common/RequestHandlers/StatusRequestHandler.cpp | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) (limited to 'src/Common') diff --git a/src/Common/ClientConnection.h b/src/Common/ClientConnection.h index a02c461..7bdceba 100644 --- a/src/Common/ClientConnection.h +++ b/src/Common/ClientConnection.h @@ -54,6 +54,11 @@ class MAD_COMMON_EXPORT ClientConnection : public Connection { void waitWhileConnected() const; virtual bool disconnect(); + + virtual bool isAuthenticated() const { + return true; + } + //virtual void* getCertificate(size_t *size) const; //virtual void* getPeerCertificate(size_t *size) const; }; diff --git a/src/Common/Connection.h b/src/Common/Connection.h index bcf6c44..2a04de0 100644 --- a/src/Common/Connection.h +++ b/src/Common/Connection.h @@ -62,6 +62,9 @@ class MAD_COMMON_EXPORT Connection : private boost::noncopyable { virtual bool disconnect() = 0; + + virtual bool isAuthenticated() const = 0; + //virtual void* getCertificate(size_t *size) const = 0; //virtual void* getPeerCertificate(size_t *size) const = 0; }; diff --git a/src/Common/RequestHandlers/FSInfoRequestHandler.cpp b/src/Common/RequestHandlers/FSInfoRequestHandler.cpp index 8af1ed3..a416af4 100644 --- a/src/Common/RequestHandlers/FSInfoRequestHandler.cpp +++ b/src/Common/RequestHandlers/FSInfoRequestHandler.cpp @@ -25,7 +25,8 @@ namespace Common { namespace RequestHandlers { void FSInfoRequestHandler::handleRequest(boost::shared_ptr /*packet*/, Common::XmlPacket *ret) { - // TODO Require authentication + if(!getConnection()->isAuthenticated()) + throw(Core::Exception(Core::Exception::PERMISSION)); std::vector fsInfo; getApplication()->getSystemManager()->getFSInfo(&fsInfo); diff --git a/src/Common/RequestHandlers/SimpleRequestHandler.cpp b/src/Common/RequestHandlers/SimpleRequestHandler.cpp index 84258a6..789db9e 100644 --- a/src/Common/RequestHandlers/SimpleRequestHandler.cpp +++ b/src/Common/RequestHandlers/SimpleRequestHandler.cpp @@ -39,8 +39,6 @@ void SimpleRequestHandler::handlePacket(boost::shared_ptr packe return; } - // TODO Require authentication - XmlPacket ret; try { diff --git a/src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp b/src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp index f084ac1..261950d 100644 --- a/src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp +++ b/src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp @@ -40,8 +40,6 @@ void SimpleRequestHandlerGroup::GroupRequestHandler::handlePacket(boost::shared_ return; } - // TODO Require authentication - XmlPacket ret; try { diff --git a/src/Common/RequestHandlers/StatusRequestHandler.cpp b/src/Common/RequestHandlers/StatusRequestHandler.cpp index 18b8868..e5d87da 100644 --- a/src/Common/RequestHandlers/StatusRequestHandler.cpp +++ b/src/Common/RequestHandlers/StatusRequestHandler.cpp @@ -25,7 +25,8 @@ namespace Common { namespace RequestHandlers { void StatusRequestHandler::handleRequest(boost::shared_ptr /*packet*/, Common::XmlPacket *ret) { - // TODO Require authentication + if(!getConnection()->isAuthenticated()) + throw(Core::Exception(Core::Exception::PERMISSION)); ret->setType("OK"); -- cgit v1.2.3