E-MailRelay

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Member Functions | List of all members
GAuth::SecretsFile Class Reference

A class to read authentication secrets from file, used by GAuth::Secrets. More...

`#include <gsecretsfile.h>`

## Public Member Functions
| SecretsFile (const G::Path &path, bool auto_reread, const std::string &debug_name, const std::string &server_type=std::string())
| Constructor to read "client" and "<server-type>" records from the named file. More...
| ~SecretsFile ()
| Destructor.
bool | valid () const
| Returns true if the file path was supplied in the ctor.
Secret | clientSecret (const std::string &encoding_type) const
| Returns the client id and secret for the given encoding-type. More...
Secret | serverSecret (const std::string &encoding_type, const std::string &id) const
| Returns the server secret for the given id and encoding-type. More...
std::pair< std::string, std::string > | serverTrust (const std::string &address_range) const
| Returns a non-empty trustee name if the server trusts clients in the given address range, together with context information. More...
std::string | path () const
| Returns the file path, as supplied to the ctor.
bool | contains (const std::string &server_encoding_type) const
| Returns true if the given server encoding-type is represented.

## Detailed Description

A class to read authentication secrets from file, used by GAuth::Secrets.

Updates to the file are detected automatically.

Definition at line 44 of file gsecretsfile.h.

## Constructor & Destructor Documentation

GAuth::SecretsFile::SecretsFile | ( | const G::Path & | path,
|  | bool | auto_reread,
|  | const std::string & | debug_name,
|  | const std::string & | server_type = `std::string()`
| ) |  |

Constructor to read "client" and "<server-type>" records from the named file.

The server type defaults to "server". The filename path is optional; see valid().

Definition at line 38 of file gsecretsfile.cpp.

## Member Function Documentation

GAuth::Secret GAuth::SecretsFile::clientSecret | ( | const std::string & | encoding_type | ) | const

Returns the client id and secret for the given encoding-type.

Returns the empty string if none.

Definition at line 225 of file gsecretsfile.cpp.

GAuth::Secret GAuth::SecretsFile::serverSecret | ( | const std::string & | encoding_type,
|  | const std::string & | id
| ) |  | const

Returns the server secret for the given id and encoding-type.

Returns the empty string if none.

Definition at line 242 of file gsecretsfile.cpp.

std::pair< std::string, std::string > GAuth::SecretsFile::serverTrust | ( | const std::string & | address_range | ) | const

Returns a non-empty trustee name if the server trusts clients in the given address range, together with context information.

Definition at line 260 of file gsecretsfile.cpp.

The documentation for this class was generated from the following files:

- /tmp/slackrepo/SBo/slackrepo.S3SYfd/build_emailrelay/emailrelay-2.0.1/src/gauth/gsecretsfile.h
- /tmp/slackrepo/SBo/slackrepo.S3SYfd/build_emailrelay/emailrelay-2.0.1/src/gauth/gsecretsfile.cpp