ionflux.org | Impressum

AuthFile.hpp

Go to the documentation of this file.
00001 #ifndef IONFLUX_TOOLS_AUTHFILE
00002 #define IONFLUX_TOOLS_AUTHFILE
00003 /* ==========================================================================
00004  * Ionflux Tools
00005  * Copyright (c) 2004 Joern P. Meier
00006  * mail@ionflux.org
00007  * --------------------------------------------------------------------------
00008  * AuthFile.hpp                    File based authentication.
00009  * ==========================================================================
00010  * 
00011  * This file is part of Ionflux Tools.
00012  * 
00013  * Ionflux Tools is free software; you can redistribute it and/or modify it 
00014  * under the terms of the GNU General Public License as published by the Free
00015  * Software Foundation; either version 2 of the License, or (at  your option)
00016  * any later version.
00017  * 
00018  * Ionflux Tools is distributed in the hope that it will be useful, but 
00019  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00020  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00021  * for more details.
00022  * 
00023  * You should have received a copy of the GNU General Public License
00024  * along with Ionflux Tools; if not, write to the Free Software Foundation, 
00025  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00026  * 
00027  * ========================================================================== */
00028 
00029 #include <string>
00030 #include <iostream>
00031 #include <sstream>
00032 #include <vector>
00033 #include "ionflux/Auth.hpp"
00034 #include "ionflux/Reporter.hpp"
00035 #include "ionflux/Tokenizer.hpp"
00036 
00037 namespace Ionflux
00038 {
00039 
00040 namespace Tools
00041 {
00042 
00054 class AuthFile
00055 : public Auth
00056 {
00057     protected:
00059         Ionflux::Tools::Reporter log;
00061         std::string authFile;
00063         std::vector<AuthData> authData;
00064         
00069         void parse();
00070         
00071     public:
00073         static const TokenType TT_USER_PASS_SEP;
00074         
00079         AuthFile();
00080         
00087         AuthFile(const std::string &initAuthFile);
00088         
00093         virtual ~AuthFile();
00094         
00101         virtual void setAuthFile(const std::string &newAuthFile);
00102         
00113         virtual bool auth(const std::string &username, 
00114             const std::string &password);
00115         
00126         virtual void getSecret(const std::string &username, 
00127             std::string &secret);
00128         
00133         virtual Reporter &getLog();
00134         
00136         virtual void printDebugInfo();
00137 };
00138 
00139 }
00140 
00141 }
00142 
00146 #endif

Generated on Tue Mar 14 20:58:29 2006 for Ionflux Tools Class Library (iftools) by  doxygen 1.4.6