-rw-r--r-- | include/opkele/server.h | 2 |
1 files changed, 2 insertions, 0 deletions
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,96 +1,98 @@ | |||
1 | #ifndef __OPKELE_SERVER_H | 1 | #ifndef __OPKELE_SERVER_H |
2 | #define __OPKELE_SERVER_H | 2 | #define __OPKELE_SERVER_H |
3 | 3 | ||
4 | /** | 4 | /** |
5 | * @file | 5 | * @file |
6 | * @brief OpenID server-side functionality | 6 | * @brief OpenID server-side functionality |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <opkele/types.h> | 9 | #include <opkele/types.h> |
10 | #include <opkele/extension.h> | 10 | #include <opkele/extension.h> |
11 | 11 | ||
12 | namespace opkele { | 12 | namespace opkele { |
13 | 13 | ||
14 | /** | 14 | /** |
15 | * implementation of basic server functionality | 15 | * implementation of basic server functionality |
16 | */ | 16 | */ |
17 | class server_t { | 17 | class server_t { |
18 | public: | 18 | public: |
19 | 19 | ||
20 | virtual ~server_t() { } | ||
21 | |||
20 | /** | 22 | /** |
21 | * allocate the new association. The function should be overridden | 23 | * allocate the new association. The function should be overridden |
22 | * in the real implementation to provide persistent assocations | 24 | * in the real implementation to provide persistent assocations |
23 | * store. | 25 | * store. |
24 | * @param mode the mode of request being processed to base the | 26 | * @param mode the mode of request being processed to base the |
25 | * statelessness of the association upon | 27 | * statelessness of the association upon |
26 | * @return the auto_ptr<> for the newly allocated association_t object | 28 | * @return the auto_ptr<> for the newly allocated association_t object |
27 | */ | 29 | */ |
28 | virtual assoc_t alloc_assoc(mode_t mode) = 0; | 30 | virtual assoc_t alloc_assoc(mode_t mode) = 0; |
29 | /** | 31 | /** |
30 | * retrieve the association. The function should be overridden in | 32 | * retrieve the association. The function should be overridden in |
31 | * the reqal implementation to provide persistent assocations | 33 | * the reqal implementation to provide persistent assocations |
32 | * store. | 34 | * store. |
33 | * @param h association handle | 35 | * @param h association handle |
34 | * @return the auto_ptr<> for the newly allocated association_t object | 36 | * @return the auto_ptr<> for the newly allocated association_t object |
35 | * @throw failed_lookup in case of failure | 37 | * @throw failed_lookup in case of failure |
36 | */ | 38 | */ |
37 | virtual assoc_t retrieve_assoc(const string& h) = 0; | 39 | virtual assoc_t retrieve_assoc(const string& h) = 0; |
38 | 40 | ||
39 | /** | 41 | /** |
40 | * validate the identity. | 42 | * validate the identity. |
41 | * @param assoc association object | 43 | * @param assoc association object |
42 | * @param pin incoming request parameters | 44 | * @param pin incoming request parameters |
43 | * @param identity being verified | 45 | * @param identity being verified |
44 | * @param trust_root presented in the request | 46 | * @param trust_root presented in the request |
45 | * @throw exception if identity can not be confirmed | 47 | * @throw exception if identity can not be confirmed |
46 | */ | 48 | */ |
47 | virtual void validate(const association_t& assoc,const params_t& pin,const string& identity,const string& trust_root) = 0; | 49 | virtual void validate(const association_t& assoc,const params_t& pin,const string& identity,const string& trust_root) = 0; |
48 | 50 | ||
49 | 51 | ||
50 | /** | 52 | /** |
51 | * process the associate request. | 53 | * process the associate request. |
52 | * @param pin the incoming request parameters | 54 | * @param pin the incoming request parameters |
53 | * @param pout the store for the response parameters | 55 | * @param pout the store for the response parameters |
54 | */ | 56 | */ |
55 | void associate(const params_t& pin,params_t& pout); | 57 | void associate(const params_t& pin,params_t& pout); |
56 | /** | 58 | /** |
57 | * process the checkid_immediate request. | 59 | * process the checkid_immediate request. |
58 | * @param pin the incoming request parameters | 60 | * @param pin the incoming request parameters |
59 | * @param return_to reference to the object to store return_to url to | 61 | * @param return_to reference to the object to store return_to url to |
60 | * @param pout the response parameters | 62 | * @param pout the response parameters |
61 | * @param ext pointer to the extension hooks object | 63 | * @param ext pointer to the extension hooks object |
62 | * @throw exception in case of errors or negative reply | 64 | * @throw exception in case of errors or negative reply |
63 | */ | 65 | */ |
64 | virtual void checkid_immediate(const params_t& pin,string& return_to,params_t& pout,extension_t *ext=0); | 66 | virtual void checkid_immediate(const params_t& pin,string& return_to,params_t& pout,extension_t *ext=0); |
65 | /** | 67 | /** |
66 | * process the checkid_setup request. | 68 | * process the checkid_setup request. |
67 | * @param pin the incoming request parameters | 69 | * @param pin the incoming request parameters |
68 | * @param return_to reference to the object to store return_to url to | 70 | * @param return_to reference to the object to store return_to url to |
69 | * @param pout the response parameters | 71 | * @param pout the response parameters |
70 | * @param ext pointer to the extension hooks object | 72 | * @param ext pointer to the extension hooks object |
71 | * @throw exception in case of errors or negative reply | 73 | * @throw exception in case of errors or negative reply |
72 | */ | 74 | */ |
73 | virtual void checkid_setup(const params_t& pin,string& return_to,params_t& pout,extension_t *ext=0); | 75 | virtual void checkid_setup(const params_t& pin,string& return_to,params_t& pout,extension_t *ext=0); |
74 | /** | 76 | /** |
75 | * the actual functionality behind checkid_immediate() and | 77 | * the actual functionality behind checkid_immediate() and |
76 | * checkid_setup() | 78 | * checkid_setup() |
77 | * @param mode the request being processed (either | 79 | * @param mode the request being processed (either |
78 | * mode_checkid_immediate or mode_checkid_setup) | 80 | * mode_checkid_immediate or mode_checkid_setup) |
79 | * @param pin the incoming request parameters | 81 | * @param pin the incoming request parameters |
80 | * @param return_to reference to the object to store return_to url to | 82 | * @param return_to reference to the object to store return_to url to |
81 | * @param pout the response parameters | 83 | * @param pout the response parameters |
82 | * @param ext pointer to the extension hooks object | 84 | * @param ext pointer to the extension hooks object |
83 | * @throw exception in case of errors or negative reply | 85 | * @throw exception in case of errors or negative reply |
84 | */ | 86 | */ |
85 | virtual void checkid_(mode_t mode,const params_t& pin,string& return_to,params_t& pout,extension_t *ext=0); | 87 | virtual void checkid_(mode_t mode,const params_t& pin,string& return_to,params_t& pout,extension_t *ext=0); |
86 | /** | 88 | /** |
87 | * process the check_authentication request. | 89 | * process the check_authentication request. |
88 | * @param pin incoming request parameters | 90 | * @param pin incoming request parameters |
89 | * @param pout response parameters | 91 | * @param pout response parameters |
90 | */ | 92 | */ |
91 | void check_authentication(const params_t& pin,params_t& pout); | 93 | void check_authentication(const params_t& pin,params_t& pout); |
92 | }; | 94 | }; |
93 | 95 | ||
94 | } | 96 | } |
95 | 97 | ||
96 | #endif /* __OPKELE_SERVER_H */ | 98 | #endif /* __OPKELE_SERVER_H */ |