author | Michael Krelin <hacker@klever.net> | 2008-02-08 21:18:43 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2008-02-08 21:18:43 (UTC) |
commit | 6c82575a47283fcd7fdd0cf42b96e90a0888c58c (patch) (unidiff) | |
tree | 22f2b1018db45c3561ed099a676c7f4314b7dcb4 /include | |
parent | 9e902e373ba72fd8725c5a1ffdfdc0447b664369 (diff) | |
download | libopkele-6c82575a47283fcd7fdd0cf42b96e90a0888c58c.zip libopkele-6c82575a47283fcd7fdd0cf42b96e90a0888c58c.tar.gz libopkele-6c82575a47283fcd7fdd0cf42b96e90a0888c58c.tar.bz2 |
further doxygenation of basic_OP
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | include/opkele/basic_op.h | 77 |
1 files changed, 75 insertions, 2 deletions
diff --git a/include/opkele/basic_op.h b/include/opkele/basic_op.h index 4daed02..a0f0af0 100644 --- a/include/opkele/basic_op.h +++ b/include/opkele/basic_op.h | |||
@@ -1,84 +1,157 @@ | |||
1 | #ifndef __OPKELE_BASIC_OP_H | 1 | #ifndef __OPKELE_BASIC_OP_H |
2 | #define __OPKELE_BASIC_OP_H | 2 | #define __OPKELE_BASIC_OP_H |
3 | 3 | ||
4 | #include <string> | 4 | #include <string> |
5 | #include <opkele/types.h> | 5 | #include <opkele/types.h> |
6 | #include <opkele/extension.h> | 6 | #include <opkele/extension.h> |
7 | 7 | ||
8 | namespace opkele { | 8 | namespace opkele { |
9 | using std::string; | 9 | using std::string; |
10 | 10 | ||
11 | class basic_OP { | 11 | class basic_OP { |
12 | public: | 12 | public: |
13 | /** | ||
14 | * The request mode for the request being processed | ||
15 | */ | ||
13 | mode_t mode; | 16 | mode_t mode; |
17 | /** | ||
18 | * association used in transaction. reset in case of dumb operation | ||
19 | */ | ||
14 | assoc_t assoc; | 20 | assoc_t assoc; |
21 | /** | ||
22 | * true if the request is openid2 request | ||
23 | */ | ||
15 | bool openid2; | 24 | bool openid2; |
25 | /** | ||
26 | * The return_to RP endpoint | ||
27 | */ | ||
16 | string return_to; | 28 | string return_to; |
29 | /** | ||
30 | * The realm we authenticate for | ||
31 | */ | ||
17 | string realm; | 32 | string realm; |
33 | /** | ||
34 | * Claimed identifier | ||
35 | */ | ||
18 | string claimed_id; | 36 | string claimed_id; |
37 | /** | ||
38 | * The OP-Local identifier | ||
39 | */ | ||
19 | string identity; | 40 | string identity; |
41 | /** | ||
42 | * The invalidate handle for the reply request | ||
43 | */ | ||
20 | string invalidate_handle; | 44 | string invalidate_handle; |
21 | 45 | ||
22 | void reset_vars(); | 46 | void reset_vars(); |
23 | 47 | ||
48 | /** | ||
49 | * @name Request information access | ||
50 | * Setting and retrieval of the information pertaining to the request being processed | ||
51 | * @{ | ||
52 | */ | ||
53 | /** | ||
54 | * Check if the RP expects us to get back to them. | ||
55 | * @return true if RP supplied return_to URL | ||
56 | */ | ||
24 | bool has_return_to() const; | 57 | bool has_return_to() const; |
58 | /** | ||
59 | * Find out where the RP is waiting for us. | ||
60 | * @return the return_to URL supplied | ||
61 | * @throw no_return_to if no return_to is supplied with the request | ||
62 | */ | ||
25 | const string& get_return_to() const; | 63 | const string& get_return_to() const; |
26 | 64 | ||
65 | /** | ||
66 | * Find out what realm we are authenticating user for | ||
67 | * @return the realm | ||
68 | */ | ||
27 | const string& get_realm() const; | 69 | const string& get_realm() const; |
28 | 70 | ||
71 | /** | ||
72 | * Check if request is about identity | ||
73 | * @return true if so | ||
74 | */ | ||
29 | bool has_identity() const; | 75 | bool has_identity() const; |
76 | /** | ||
77 | * Get claimed identifier supplied with the request | ||
78 | * @return claimed identifier | ||
79 | * @throw non_identity if request is not about identity | ||
80 | */ | ||
30 | const string& get_claimed_id() const; | 81 | const string& get_claimed_id() const; |
82 | /** | ||
83 | * Get the identity (OP-Local identifier) being confirmed | ||
84 | * @return identity | ||
85 | * @throw non_identity if request is not about identity | ||
86 | */ | ||
31 | const string& get_identity() const; | 87 | const string& get_identity() const; |
32 | 88 | ||
89 | /** | ||
90 | * Is identifier supposed to be selected on our side? | ||
91 | * @return true if identity is a special identifier select URI | ||
92 | */ | ||
33 | bool is_id_select() const; | 93 | bool is_id_select() const; |
34 | 94 | ||
35 | void select_identity(const string& c,const string& i); | 95 | /** |
36 | void set_claimed_id(const string& c); | 96 | * Select the identity for identifier select request |
97 | * @param cid claimed identifier | ||
98 | * @param lid local identifier | ||
99 | */ | ||
100 | void select_identity(const string& cid,const string& lid); | ||
101 | /** | ||
102 | * Set claimed identifier (for instance if it's supposed to have | ||
103 | * fragment part) | ||
104 | * @param cid claimed identifier | ||
105 | */ | ||
106 | void set_claimed_id(const string& cid); | ||
107 | /** | ||
108 | * @} | ||
109 | */ | ||
37 | 110 | ||
38 | /** @name OpenID operations | 111 | /** @name OpenID operations |
39 | * @{ | 112 | * @{ |
40 | */ | 113 | */ |
41 | /** | 114 | /** |
42 | * Establish association with RP | 115 | * Establish association with RP |
43 | * @param oum reply message | 116 | * @param oum reply message |
44 | * @param inm request message | 117 | * @param inm request message |
45 | */ | 118 | */ |
46 | basic_openid_message& associate( | 119 | basic_openid_message& associate( |
47 | basic_openid_message& oum, | 120 | basic_openid_message& oum, |
48 | const basic_openid_message& inm); | 121 | const basic_openid_message& inm); |
49 | 122 | ||
50 | /** | 123 | /** |
51 | * Parse the checkid_* request. The function parses input message, | 124 | * Parse the checkid_* request. The function parses input message, |
52 | * retrieves the information needed for further processing, | 125 | * retrieves the information needed for further processing, |
53 | * verifies what can be verified at this stage. | 126 | * verifies what can be verified at this stage. |
54 | * @param inm incoming OpenID message | 127 | * @param inm incoming OpenID message |
55 | * @param ext extension/chain of extensions supported | 128 | * @param ext extension/chain of extensions supported |
56 | */ | 129 | */ |
57 | void checkid_(const basic_openid_message& inm,extension_t *ext=0); | 130 | void checkid_(const basic_openid_message& inm,extension_t *ext=0); |
58 | /** | 131 | /** |
59 | * Build and sign a positive assertion message | 132 | * Build and sign a positive assertion message |
60 | * @param om outpu OpenID message | 133 | * @param om outpu OpenID message |
61 | * @param ext extension/chain of extensions supported | 134 | * @param ext extension/chain of extensions supported |
62 | * @return reference to om | 135 | * @return reference to om |
63 | */ | 136 | */ |
64 | basic_openid_message& id_res(basic_openid_message& om, | 137 | basic_openid_message& id_res(basic_openid_message& om, |
65 | extension_t *ext=0); | 138 | extension_t *ext=0); |
66 | /** | 139 | /** |
67 | * Build a 'cancel' negative assertion | 140 | * Build a 'cancel' negative assertion |
68 | * @param om output OpenID message | 141 | * @param om output OpenID message |
69 | * @return reference to om | 142 | * @return reference to om |
70 | */ | 143 | */ |
71 | basic_openid_message& cancel(basic_openid_message& om); | 144 | basic_openid_message& cancel(basic_openid_message& om); |
72 | /** | 145 | /** |
73 | * Build an 'error' reply | 146 | * Build an 'error' reply |
74 | * @param om output OpenID message | 147 | * @param om output OpenID message |
75 | * @param error a human-readable message indicating the cause | 148 | * @param error a human-readable message indicating the cause |
76 | * @param contact contact address for the server administrator (can be empty) | 149 | * @param contact contact address for the server administrator (can be empty) |
77 | * @param reference a reference token (can be empty) | 150 | * @param reference a reference token (can be empty) |
78 | * @return reference to om | 151 | * @return reference to om |
79 | */ | 152 | */ |
80 | basic_openid_message& error(basic_openid_message& om, | 153 | basic_openid_message& error(basic_openid_message& om, |
81 | const string& error,const string& contact, | 154 | const string& error,const string& contact, |
82 | const string& reference ); | 155 | const string& reference ); |
83 | /** | 156 | /** |
84 | * Build a setup_needed reply to checkid_immediate request | 157 | * Build a setup_needed reply to checkid_immediate request |