summaryrefslogtreecommitdiffabout
path: root/include
authorMichael Krelin <hacker@klever.net>2007-11-22 23:00:32 (UTC)
committer Michael Krelin <hacker@klever.net>2007-11-22 23:00:32 (UTC)
commit2589c69c4a909563098365fba141082db4657353 (patch) (side-by-side diff)
treee42018dd7d2ed1bbdee90155d3c99bbaf0011bc0 /include
parente6b62b080eae38a7c62be1148cf794085e9065c3 (diff)
downloadlibopkele-2589c69c4a909563098365fba141082db4657353.zip
libopkele-2589c69c4a909563098365fba141082db4657353.tar.gz
libopkele-2589c69c4a909563098365fba141082db4657353.tar.bz2
added virtual destructors to base classes
and bumped version to 0.4 Signed-off-by: Michael Krelin <hacker@klever.net>
Diffstat (limited to 'include') (more/less context) (ignore whitespace changes)
-rw-r--r--include/opkele/consumer.h2
-rw-r--r--include/opkele/extension.h2
-rw-r--r--include/opkele/server.h2
-rw-r--r--include/opkele/types.h2
4 files changed, 8 insertions, 0 deletions
diff --git a/include/opkele/consumer.h b/include/opkele/consumer.h
index b9d1e54..50ff692 100644
--- a/include/opkele/consumer.h
+++ b/include/opkele/consumer.h
@@ -1,48 +1,50 @@
#ifndef __OPKELE_CONSUMER_H
#define __OPKELE_CONSUMER_H
#include <opkele/types.h>
#include <opkele/extension.h>
/**
* @file
* @brief OpenID consumer-side functionality
*/
namespace opkele {
/**
* implementation of basic consumer functionality
*
* @note
* The consumer uses libcurl internally, which means that if you're using
* libopkele in multithreaded environment you should call curl_global_init
* yourself before spawning any threads.
*/
class consumer_t {
public:
+ virtual ~consumer_t() { }
+
/**
* store association. The function should be overridden in the real
* implementation to provide persistent associations store.
* @param server the OpenID server
* @param handle association handle
* @param secret the secret associated with the server and handle
* @param expires_in the number of seconds until the handle is expired
* @return the auto_ptr<> for the newly allocated association_t object
*/
virtual assoc_t store_assoc(const string& server,const string& handle,const secret_t& secret,int expires_in) = 0;
/**
* retrieve stored association. The function should be overridden
* in the real implementation to provide persistent assocations
* store.
*
* @note
* The user is responsible for handling associations expiry and
* this function should never return an expired or invalidated
* association.
*
* @param server the OpenID server
* @param handle association handle
* @return the autho_ptr<> for the newly allocated association_t object
* @throw failed_lookup if no unexpired association found
diff --git a/include/opkele/extension.h b/include/opkele/extension.h
index ea0c74c..513672f 100644
--- a/include/opkele/extension.h
+++ b/include/opkele/extension.h
@@ -1,41 +1,43 @@
#ifndef __OPKELE_EXTENSION_H
#define __OPKELE_EXTENSION_H
/**
* @file
* @brief extensions framework basics
*/
#include <opkele/types.h>
namespace opkele {
/**
* OpenID extension hooks base class
*/
class extension_t {
public:
+
+ virtual ~extension_t() { }
/**
* hook called by consumer before submitting data to OpenID server.
* It is supposed to manipulate parameters list.
* @param p parameters about to be submitted to server
* @param identity identity being verified. It may differ from the
* one available in parameters list in case of delegation
* @see consumer_t::checkid_
* @see consumer_t::checkid_immediate
* @see consumer_t::checkid_setup
*/
virtual void checkid_hook(params_t& p,const string& identity);
/**
* hook called by consumer after identity information received from
* OpenID server is verified.
* @param p parameters received from server
* @param sp signed parameters received from server with 'openid.'
* leader stripped
* @param identity identity confirmed. May differ from the one
* available in parameters list in case of delegation. May also be
* empty which means - extract one from parameters
* @see consumer_t::id_res
*/
virtual void id_res_hook(const params_t& p,const params_t& sp,const string& identity);
diff --git a/include/opkele/server.h b/include/opkele/server.h
index e7e5bb3..dd7fc41 100644
--- a/include/opkele/server.h
+++ b/include/opkele/server.h
@@ -1,43 +1,45 @@
#ifndef __OPKELE_SERVER_H
#define __OPKELE_SERVER_H
/**
* @file
* @brief OpenID server-side functionality
*/
#include <opkele/types.h>
#include <opkele/extension.h>
namespace opkele {
/**
* implementation of basic server functionality
*/
class server_t {
public:
+ virtual ~server_t() { }
+
/**
* allocate the new association. The function should be overridden
* in the real implementation to provide persistent assocations
* store.
* @param mode the mode of request being processed to base the
* statelessness of the association upon
* @return the auto_ptr<> for the newly allocated association_t object
*/
virtual assoc_t alloc_assoc(mode_t mode) = 0;
/**
* retrieve the association. The function should be overridden in
* the reqal implementation to provide persistent assocations
* store.
* @param h association handle
* @return the auto_ptr<> for the newly allocated association_t object
* @throw failed_lookup in case of failure
*/
virtual assoc_t retrieve_assoc(const string& h) = 0;
/**
* validate the identity.
* @param assoc association object
* @param pin incoming request parameters
* @param identity being verified
diff --git a/include/opkele/types.h b/include/opkele/types.h
index 8f4bf73..f732a1e 100644
--- a/include/opkele/types.h
+++ b/include/opkele/types.h
@@ -44,48 +44,50 @@ namespace opkele {
/**
* decode base64-encoded secret and xor it with the sha1 digest
* @param key_sha1 pointer to the message digest
* @param b64 base64-encoded secret value
*/
void enxor_from_base64(const unsigned char *key_sha1,const string& b64);
/**
* plainly encode to base64 representation
* @param rv reference to the return value
*/
void to_base64(string& rv) const;
/**
* decode cleartext secret from base64
* @param b64 base64-encoded representation of the secret value
*/
void from_base64(const string& b64);
};
/**
* Interface to the association.
*/
class association_t {
public:
+ virtual ~association_t() { }
+
/**
* retrieve the server with which association was established.
* @return server name
*/
virtual string server() const = 0;
/**
* retrieve the association handle.
* @return handle
*/
virtual string handle() const = 0;
/**
* retrieve the association type.
* @return association type
*/
virtual string assoc_type() const = 0;
/**
* retrieve the association secret.
* @return association secret
*/
virtual secret_t secret() const = 0;
/**
* retrieve the number of seconds the association expires in.
* @return seconds till expiration
*/