author | Michael Krelin <hacker@klever.net> | 2008-02-16 17:49:22 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2008-02-16 17:49:22 (UTC) |
commit | 21bddce2d98394865cf2ed0b144f92bbb6993bc9 (patch) (unidiff) | |
tree | e30194fab08a704885ae00c711e1707dc73bed83 /lib/basic_op.cc | |
parent | ccdfc6eacec435a59d773127762ad0b6bce07149 (diff) | |
download | libopkele-21bddce2d98394865cf2ed0b144f92bbb6993bc9.zip libopkele-21bddce2d98394865cf2ed0b144f92bbb6993bc9.tar.gz libopkele-21bddce2d98394865cf2ed0b144f92bbb6993bc9.tar.bz2 |
moved some stuff out of the now installed util.h header
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | lib/basic_op.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/basic_op.cc b/lib/basic_op.cc index c247493..fa659ac 100644 --- a/lib/basic_op.cc +++ b/lib/basic_op.cc | |||
@@ -1,56 +1,57 @@ | |||
1 | #include <time.h> | 1 | #include <time.h> |
2 | #include <cassert> | 2 | #include <cassert> |
3 | #include <openssl/sha.h> | 3 | #include <openssl/sha.h> |
4 | #include <openssl/hmac.h> | 4 | #include <openssl/hmac.h> |
5 | #include <opkele/data.h> | 5 | #include <opkele/data.h> |
6 | #include <opkele/basic_op.h> | 6 | #include <opkele/basic_op.h> |
7 | #include <opkele/exception.h> | 7 | #include <opkele/exception.h> |
8 | #include <opkele/util.h> | 8 | #include <opkele/util.h> |
9 | #include <opkele/util-internal.h> | ||
9 | #include <opkele/uris.h> | 10 | #include <opkele/uris.h> |
10 | 11 | ||
11 | namespace opkele { | 12 | namespace opkele { |
12 | 13 | ||
13 | void basic_OP::reset_vars() { | 14 | void basic_OP::reset_vars() { |
14 | assoc.reset(); | 15 | assoc.reset(); |
15 | return_to.clear(); realm.clear(); | 16 | return_to.clear(); realm.clear(); |
16 | claimed_id.clear(); identity.clear(); | 17 | claimed_id.clear(); identity.clear(); |
17 | invalidate_handle.clear(); | 18 | invalidate_handle.clear(); |
18 | } | 19 | } |
19 | 20 | ||
20 | bool basic_OP::has_return_to() const { | 21 | bool basic_OP::has_return_to() const { |
21 | return !return_to.empty(); | 22 | return !return_to.empty(); |
22 | } | 23 | } |
23 | const string& basic_OP::get_return_to() const { | 24 | const string& basic_OP::get_return_to() const { |
24 | if(return_to.empty()) | 25 | if(return_to.empty()) |
25 | throw no_return_to(OPKELE_CP_ "No return_to URL provided with request"); | 26 | throw no_return_to(OPKELE_CP_ "No return_to URL provided with request"); |
26 | return return_to; | 27 | return return_to; |
27 | } | 28 | } |
28 | 29 | ||
29 | const string& basic_OP::get_realm() const { | 30 | const string& basic_OP::get_realm() const { |
30 | assert(!realm.empty()); | 31 | assert(!realm.empty()); |
31 | return realm; | 32 | return realm; |
32 | } | 33 | } |
33 | 34 | ||
34 | bool basic_OP::has_identity() const { | 35 | bool basic_OP::has_identity() const { |
35 | return !identity.empty(); | 36 | return !identity.empty(); |
36 | } | 37 | } |
37 | const string& basic_OP::get_claimed_id() const { | 38 | const string& basic_OP::get_claimed_id() const { |
38 | if(claimed_id.empty()) | 39 | if(claimed_id.empty()) |
39 | throw non_identity(OPKELE_CP_ "attempting to retrieve claimed_id of non-identity related request"); | 40 | throw non_identity(OPKELE_CP_ "attempting to retrieve claimed_id of non-identity related request"); |
40 | assert(!identity.empty()); | 41 | assert(!identity.empty()); |
41 | return claimed_id; | 42 | return claimed_id; |
42 | } | 43 | } |
43 | const string& basic_OP::get_identity() const { | 44 | const string& basic_OP::get_identity() const { |
44 | if(identity.empty()) | 45 | if(identity.empty()) |
45 | throw non_identity(OPKELE_CP_ "attempting to retrieve identity of non-identity related request"); | 46 | throw non_identity(OPKELE_CP_ "attempting to retrieve identity of non-identity related request"); |
46 | assert(!claimed_id.empty()); | 47 | assert(!claimed_id.empty()); |
47 | return identity; | 48 | return identity; |
48 | } | 49 | } |
49 | 50 | ||
50 | bool basic_OP::is_id_select() const { | 51 | bool basic_OP::is_id_select() const { |
51 | return identity==IDURI_SELECT20; | 52 | return identity==IDURI_SELECT20; |
52 | } | 53 | } |
53 | 54 | ||
54 | void basic_OP::select_identity(const string& c,const string& i) { | 55 | void basic_OP::select_identity(const string& c,const string& i) { |
55 | claimed_id = c; identity = i; | 56 | claimed_id = c; identity = i; |
56 | } | 57 | } |