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 
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 
virtual std::string secret(const std::string &mechanism) const
Final override from GAuth::SaslClient::Secrets.
virtual std::string id(const std::string &mechanism) const
Final override from GAuth::SaslClient::Secrets.
Secrets()
Default constructor for an in-valid(), empty-path object.
virtual bool valid() const
Final override from GAuth::Valid virtual base.
A implementation class used by GAuth::Secrets.
Definition: gsecretsfile.h:42
A simple interface to a store of secrets as used in authentication.
Definition: gsecrets.h:44
An interface used by GAuth::SaslClient to obtain authentication secrets.
Definition: gsaslclient.h:52
virtual ~Secrets()
Destructor.
virtual std::string source() const
Final override from GAuth::SaslServer::Secrets.
#define G_EXCEPTION(class_name, description)
define as a function rather than a type if optimising for size
Definition: gexception.h:93
An interface used by GAuth::SaslServer to obtain authentication secrets.
Definition: gsaslserver.h:81
SASL authentication classes.
virtual bool contains(const std::string &mechanism) const
Final override from GAuth::SaslServer::Secrets.