diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2009-08-31 18:11:46 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2009-08-31 18:11:46 +0200 |
commit | 053843f893dd5c96a88e285cf2a5b35419f7dfca (patch) | |
tree | 532fbd3d8fb4c86b00427a07907a89f6ef8512a1 /src/Common | |
parent | bbb8e9176ced8b4079fcbb208137042ec56c1433 (diff) | |
download | mad-053843f893dd5c96a88e285cf2a5b35419f7dfca.tar mad-053843f893dd5c96a88e285cf2a5b35419f7dfca.zip |
Immer Authentifizierung fordern
Diffstat (limited to 'src/Common')
-rw-r--r-- | src/Common/ClientConnection.h | 5 | ||||
-rw-r--r-- | src/Common/Connection.h | 3 | ||||
-rw-r--r-- | src/Common/RequestHandlers/FSInfoRequestHandler.cpp | 3 | ||||
-rw-r--r-- | src/Common/RequestHandlers/SimpleRequestHandler.cpp | 2 | ||||
-rw-r--r-- | src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp | 2 | ||||
-rw-r--r-- | src/Common/RequestHandlers/StatusRequestHandler.cpp | 3 |
6 files changed, 12 insertions, 6 deletions
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<const Common::XmlPacket> /*packet*/, Common::XmlPacket *ret) { - // TODO Require authentication + if(!getConnection()->isAuthenticated()) + throw(Core::Exception(Core::Exception::PERMISSION)); std::vector<SystemManager::FSInfo> 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<const XmlPacket> 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<const Common::XmlPacket> /*packet*/, Common::XmlPacket *ret) { - // TODO Require authentication + if(!getConnection()->isAuthenticated()) + throw(Core::Exception(Core::Exception::PERMISSION)); ret->setType("OK"); |