Public Types | Public Member Functions | Protected Member Functions

sbuild::auth_pam_conv Class Reference

Authentication conversation handler interface. More...

#include <sbuild-auth-pam-conv.h>

Inheritance diagram for sbuild::auth_pam_conv:
Inheritance graph
[legend]

List of all members.

Public Types

typedef std::vector
< auth_pam_message
message_list
 A list of messages.
typedef std::tr1::shared_ptr
< auth_pam
auth_ptr
typedef std::tr1::weak_ptr
< auth_pam
weak_auth_ptr
typedef std::tr1::shared_ptr
< auth_pam_conv
ptr
 A shared_ptr to an auth_pam_conv object.

Public Member Functions

virtual ~auth_pam_conv ()
 The destructor.
virtual auth_ptr get_auth ()=0
 Get the auth object.
virtual void set_auth (auth_ptr auth)=0
 Set the auth object.
virtual time_t get_warning_timeout ()=0
 Get the time at which the user will be warned.
virtual void set_warning_timeout (time_t timeout)=0
 Set the time at which the user will be warned.
virtual time_t get_fatal_timeout ()=0
 Get the time at which the conversation will be terminated with an error.
virtual void set_fatal_timeout (time_t timeout)=0
 Set the time at which the conversation will be terminated with an error.
virtual void conversation (message_list &messages)=0
 Hold a conversation with the user.

Protected Member Functions

 auth_pam_conv ()
 The constructor.

Detailed Description

Authentication conversation handler interface.

This interface should be implemented by objects which handle interaction with the user during authentication.

This is a wrapper around the struct pam_conv PAM conversation interface, and is used by auth when interacting with the user during authentication.

A simple implementation is provided in the form of auth_pam_conv_tty. However, more complex implementations might hook into the event loop of a GUI widget system, for example.

The interface allows the setting of optional warning timeout and fatal timeout values, which should default to 0 (not enabled). This is an absolute time after which a warning is displayed or the conversation ends with an error.

Note that the auth object must be specified, and must never be void while the conversation is in progress.


Member Typedef Documentation

typedef std::tr1::shared_ptr<auth_pam> sbuild::auth_pam_conv::auth_ptr

A list of messages.

typedef std::tr1::shared_ptr<auth_pam_conv> sbuild::auth_pam_conv::ptr

A shared_ptr to an auth_pam_conv object.

typedef std::tr1::weak_ptr<auth_pam> sbuild::auth_pam_conv::weak_auth_ptr

Constructor & Destructor Documentation

auth_pam_conv::auth_pam_conv (  )  [protected]

The constructor.

auth_pam_conv::~auth_pam_conv (  )  [virtual]

The destructor.


Member Function Documentation

virtual void sbuild::auth_pam_conv::conversation ( message_list messages  )  [pure virtual]

Hold a conversation with the user.

Each of the messages detailed in messages should be displayed to the user, asking for input where required. The type of message is indicated in the auth_pam_message::type field of the auth_pam_message. The auth_pam_message::response field of the auth_pam_message should be filled in if input is required.

On error, an exception will be thrown.

Parameters:
messages the messages to display to the user, and responses to return to the caller.

Implemented in sbuild::auth_pam_conv_tty.

virtual auth_ptr sbuild::auth_pam_conv::get_auth (  )  [pure virtual]

Get the auth object.

Returns:
the auth object.

Implemented in sbuild::auth_pam_conv_tty.

virtual time_t sbuild::auth_pam_conv::get_fatal_timeout (  )  [pure virtual]

Get the time at which the conversation will be terminated with an error.

Returns:
the time.

Implemented in sbuild::auth_pam_conv_tty.

virtual time_t sbuild::auth_pam_conv::get_warning_timeout (  )  [pure virtual]

Get the time at which the user will be warned.

Returns:
the time.

Implemented in sbuild::auth_pam_conv_tty.

virtual void sbuild::auth_pam_conv::set_auth ( auth_ptr  auth  )  [pure virtual]

Set the auth object.

Parameters:
auth the auth object.

Implemented in sbuild::auth_pam_conv_tty.

virtual void sbuild::auth_pam_conv::set_fatal_timeout ( time_t  timeout  )  [pure virtual]

Set the time at which the conversation will be terminated with an error.

Parameters:
timeout the time to set.

Implemented in sbuild::auth_pam_conv_tty.

virtual void sbuild::auth_pam_conv::set_warning_timeout ( time_t  timeout  )  [pure virtual]

Set the time at which the user will be warned.

Parameters:
timeout the time to set.

Implemented in sbuild::auth_pam_conv_tty.


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