E-MailRelay
Public Types | Public Member Functions | Protected Member Functions | List of all members
GAuth::PamImp Class Reference

A private implementation of the G::Pam interface used by GAuth::SaslServerPamImp, which is itself a private implementation class used by GAuth::SaslServerPam. More...

+ Inheritance diagram for GAuth::PamImp:

Public Types

using ItemArray = GAuth::PamImp::ItemArray
 
- Public Types inherited from G::Pam
using ItemArray = std::vector< Item >
 

Public Member Functions

 PamImp (const std::string &app, const std::string &id)
 
void fail ()
 
void apply (const std::string &)
 
std::string id () const
 
 PamImp (const PamImp &)=delete
 
 PamImp (PamImp &&)=delete
 
void operator= (const PamImp &)=delete
 
void operator= (PamImp &&)=delete
 
- Public Member Functions inherited from G::Pam
 Pam (const std::string &app, const std::string &user, bool silent)
 Constructor. More...
 
virtual ~Pam ()
 Destructor.
 
bool authenticate (bool require_token)
 Authenticates the user. More...
 
std::string name () const
 Returns the authenticated user name. More...
 
void checkAccount (bool require_token)
 Does "account management", checking that the authenticated user is currently allowed to use the system. More...
 
void establishCredentials ()
 Embues the authenticated user with their credentials, such as "tickets" in the form of environment variables etc. More...
 
void openSession ()
 Starts a session. More...
 
void closeSession ()
 Closes a session. More...
 
void deleteCredentials ()
 Deletes credentials. More...
 
void reinitialiseCredentials ()
 Reinitialises credentials. More...
 
void refreshCredentials ()
 Refreshes credentials. More...
 
virtual void converse (ItemArray &)=0
 Called to pass a message to the user, or request a password etc. More...
 
virtual void delay (unsigned int usec)=0
 Called when the pam library wants the application to introduce a delay to prevent brute-force attacks. More...
 
 Pam (const Pam &)=delete
 
 Pam (Pam &&)=delete
 
void operator= (const Pam &)=delete
 
void operator= (Pam &&)=delete
 

Protected Member Functions

void converse (ItemArray &) override
 Called to pass a message to the user, or request a password etc. More...
 
void delay (unsigned int usec) override
 Called when the pam library wants the application to introduce a delay to prevent brute-force attacks. More...
 

Detailed Description

A private implementation of the G::Pam interface used by GAuth::SaslServerPamImp, which is itself a private implementation class used by GAuth::SaslServerPam.

Definition at line 65 of file gsaslserverpam.cpp.

Member Typedef Documentation

◆ ItemArray

using GAuth::PamImp::ItemArray = GAuth::PamImp::ItemArray

Definition at line 68 of file gsaslserverpam.cpp.

Constructor & Destructor Documentation

◆ PamImp()

GAuth::PamImp::PamImp ( const std::string &  app,
const std::string &  id 
)

Definition at line 93 of file gsaslserverpam.cpp.

Member Function Documentation

◆ apply()

void GAuth::PamImp::apply ( const std::string &  pwd)

Definition at line 127 of file gsaslserverpam.cpp.

◆ converse()

void GAuth::PamImp::converse ( ItemArray &  )
overrideprotectedvirtual

Called to pass a message to the user, or request a password etc.

Typically the array is a single password prompt. The password should then be put into the 'out' string and the boolean flag set.

For each item in the array which is a prompt the implementation is required to supply a response value.

In an event-driven environment the response values can be left unassigned, in which case the outer authenticate() call will return false. The authenticate() can then be called a second time once the requested information is available.

Implements G::Pam.

Definition at line 109 of file gsaslserverpam.cpp.

◆ delay()

void GAuth::PamImp::delay ( unsigned int  usec)
overrideprotectedvirtual

Called when the pam library wants the application to introduce a delay to prevent brute-force attacks.

The parameter may be zero.

Typically called from within authenticate(), ie. before authenticate returns.

A default implementation is provided (sic) that does a sleep.

In an event-driven application the implementation of this method should start a timer and avoid initiating any new authentication while the timer is running.

Implements G::Pam.

Definition at line 133 of file gsaslserverpam.cpp.

◆ id()

std::string GAuth::PamImp::id ( ) const

Definition at line 104 of file gsaslserverpam.cpp.


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