summaryrefslogtreecommitdiffstats
path: root/src/modules/AuthBackendFile/AuthBackendFile.h
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-08-24 04:47:54 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-08-24 04:47:54 +0200
commitc964aa2708ed2839ded3c35eed7338f3e81f568f (patch)
tree21f17452e648cd25c7cdf80d844b1a366767f14b /src/modules/AuthBackendFile/AuthBackendFile.h
parent84a5ceeb7db03d75425d72e8a23a0bb0f267bc01 (diff)
downloadmad-c964aa2708ed2839ded3c35eed7338f3e81f568f.tar
mad-c964aa2708ed2839ded3c35eed7338f3e81f568f.zip
Authentifikation: Übertrage Passwörter gehasht
Diffstat (limited to 'src/modules/AuthBackendFile/AuthBackendFile.h')
-rw-r--r--src/modules/AuthBackendFile/AuthBackendFile.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/modules/AuthBackendFile/AuthBackendFile.h b/src/modules/AuthBackendFile/AuthBackendFile.h
index 90f572c..5f13b51 100644
--- a/src/modules/AuthBackendFile/AuthBackendFile.h
+++ b/src/modules/AuthBackendFile/AuthBackendFile.h
@@ -25,6 +25,7 @@
#include <Common/AuthBackend.h>
#include <Common/AuthContext.h>
#include <Common/Application.h>
+#include <Common/Hash.h>
#include <Core/Configurable.h>
#include <Core/ConfigManager.h>
@@ -44,10 +45,11 @@ class MAD_MODULE_EXPORT AuthBackendFile : public Common::AuthBackend, private Co
void readFile(const std::string &name);
- std::vector<std::string> methods;
-
Common::Application *application;
+ std::vector<std::string> methods;
+ std::vector<std::string> subMethods;
+
std::map<std::string, std::string> userMap;
protected:
@@ -57,13 +59,21 @@ class MAD_MODULE_EXPORT AuthBackendFile : public Common::AuthBackend, private Co
return methods;
}
- virtual boost::shared_ptr<Common::AuthContext> authenticate(const std::string &method, const std::string &user,
- const std::vector<boost::uint8_t> &data, std::vector<boost::uint8_t> &response,
+ virtual const std::vector<std::string>& getSubMethods(const std::string &method) const throw(Core::Exception) {
+ if(method != "Password")
+ throw(Core::Exception(Core::Exception::NOT_IMPLEMENTED));
+
+ return subMethods;
+ }
+
+ virtual boost::shared_ptr<Common::AuthContext> authenticate(const std::string &method, const std::string &subMethod,
+ const std::string &user, const std::vector<boost::uint8_t> &data, std::vector<boost::uint8_t> &response,
boost::shared_ptr<Common::AuthContext> context) throw(Core::Exception);
public:
- AuthBackendFile(Common::Application *application0) : application(application0) {
+ AuthBackendFile(Common::Application *application0) : application(application0), subMethods(Common::Hash::getHashList()) {
methods.push_back("Password");
+ subMethods.push_back("Clear");
application->getConfigManager()->registerConfigurable(this);
}