diff options
Diffstat (limited to 'src/Common/AuthBackend.h')
-rw-r--r-- | src/Common/AuthBackend.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/Common/AuthBackend.h b/src/Common/AuthBackend.h new file mode 100644 index 0000000..e933856 --- /dev/null +++ b/src/Common/AuthBackend.h @@ -0,0 +1,53 @@ +/* + * AuthBackend.h + * + * Copyright (C) 2009 Matthias Schiffer <matthias@gamezock.de> + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef MAD_COMMON_AUTHBACKEND_H_ +#define MAD_COMMON_AUTHBACKEND_H_ + +#include <Core/Exception.h> + +#include <vector> + +#include <boost/cstdint.hpp> +#include <boost/shared_ptr.hpp> + +namespace Mad { +namespace Common { + +class AuthContext; +class AuthManager; + +class AuthBackend { + protected: + friend class AuthManager; + + virtual const std::vector<std::string>& getMethods() const = 0; + + virtual boost::shared_ptr<AuthContext> authenticate(const std::string& /*method*/, const std::string& /*user*/, + const std::vector<boost::uint8_t>& /*challenge*/, std::vector<boost::uint8_t>& /*response*/, + boost::shared_ptr<AuthContext> /*context*/) throw(Core::Exception) = 0; + + public: + virtual ~AuthBackend() {} +}; + +} +} + +#endif /* MAD_COMMON_AUTHBACKEND_H_ */ |