- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

gsecrets.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2001-2013 Graeme Walker <graeme_walker@users.sourceforge.net>
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 // ===
20
21 #ifndef G_AUTH_SECRETS_H
22 #define G_AUTH_SECRETS_H
23
24 #include "gdef.h"
25 #include "gauth.h"
26 #include "gpath.h"
27 #include "gexception.h"
28 #include "gsaslserver.h"
29 #include "gsaslclient.h"
30
32 namespace GAuth
33 {
34 class Secrets ;
35 class SecretsFile ;
36 }
37
44 class GAuth::Secrets : public GAuth::SaslClient::Secrets , public GAuth::SaslServer::Secrets
45 {
46 public:
47 G_EXCEPTION( OpenError , "cannot read secrets file" ) ;
48
49 Secrets( const std::string & source_storage_path ,
50 const std::string & debug_name ,
51 const std::string & server_type = std::string() ) ;
65
66 Secrets() ;
68
69 virtual ~Secrets() ;
71
72 virtual std::string source() const ;
77
78 virtual bool valid() const ;
82
83 virtual std::string id( const std::string & mechanism ) const ;
88
89 virtual std::string secret( const std::string & mechanism ) const ;
94
95 virtual std::string secret( const std::string & mechanism , const std::string & id ) const ;
101
102 virtual bool contains( const std::string & mechanism ) const ;
109
110 private:
111 Secrets( const Secrets & ) ; // not implemented
112 void operator=( const Secrets & ) ; // not implemented
113
114 private:
115 std::string m_source ;
116 SecretsFile * m_imp ;
117 } ;
118
119 #endif
120
gsaslclient.h
gsaslserver.h
GAuth::Secrets::secret
virtual std::string secret(const std::string &mechanism) const
Final override from GAuth::SaslClient::Secrets.
Definition: gsecrets_full.cpp:57
GAuth::Secrets::id
virtual std::string id(const std::string &mechanism) const
Final override from GAuth::SaslClient::Secrets.
Definition: gsecrets_full.cpp:52
GAuth::Secrets::Secrets
Secrets()
Default constructor for an in-valid(), empty-path object.
Definition: gsecrets_full.cpp:32
GAuth::Secrets::valid
virtual bool valid() const
Final override from GAuth::Valid virtual base.
Definition: gsecrets_full.cpp:47
GAuth::SecretsFile
A implementation class used by GAuth::Secrets.
Definition: gsecretsfile.h:42
gauth.h
GAuth::Secrets
A simple interface to a store of secrets as used in authentication.
Definition: gsecrets.h:44
GAuth::SaslClient::Secrets
An interface used by GAuth::SaslClient to obtain authentication secrets.
Definition: gsaslclient.h:52
GAuth::Secrets::~Secrets
virtual ~Secrets()
Destructor.
Definition: gsecrets_full.cpp:37
GAuth::Secrets::source
virtual std::string source() const
Final override from GAuth::SaslServer::Secrets.
Definition: gsecrets_full.cpp:42
gexception.h
G_EXCEPTION
#define G_EXCEPTION(class_name, description)
define as a function rather than a type if optimising for size
Definition: gexception.h:93
gpath.h
GAuth::SaslServer::Secrets
An interface used by GAuth::SaslServer to obtain authentication secrets.
Definition: gsaslserver.h:81
GAuth
SASL authentication classes.
GAuth::Secrets::contains
virtual bool contains(const std::string &mechanism) const
Final override from GAuth::SaslServer::Secrets.
Definition: gsecrets_full.cpp:67