summaryrefslogtreecommitdiffabout
path: root/include/opkele/util.h
Side-by-side diff
Diffstat (limited to 'include/opkele/util.h') (more/less context) (ignore whitespace changes)
-rw-r--r--include/opkele/util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/opkele/util.h b/include/opkele/util.h
index 719f951..bc1a0ea 100644
--- a/include/opkele/util.h
+++ b/include/opkele/util.h
@@ -124,48 +124,56 @@ namespace opkele {
/**
* Encode binary data using base64.
* @param data pointer to binary data
* @param length length of data
* @return encoded data
*/
string encode_base64(const void *data,size_t length);
/**
* Decode binary data from base64 representation.
* @param data base64-encoded data
* @param rv container for decoded binary
*/
void decode_base64(const string& data,vector<unsigned char>& rv);
/**
* Normalize http(s) URI according to RFC3986, section 6. URI is
* expected to have scheme: in front of it.
* @param uri URI
* @return normalized URI
* @throw not_implemented in case of non-httpi(s) URI
* @throw bad_input in case of malformed URI
*/
string rfc_3986_normalize_uri(const string& uri);
+ /**
+ * Match URI against realm
+ * @param uri URI to match
+ * @param realm realm to match against
+ * @return true if URI matches realm
+ */
+ bool uri_matches_realm(const string& uri,const string& realm);
+
string& strip_uri_fragment_part(string& uri);
string abi_demangle(const char* mn);
string base64_signature(const assoc_t& assoc,const basic_openid_message& om);
class change_mode_message_proxy : public basic_openid_message {
public:
const basic_openid_message& x;
const string& mode;
change_mode_message_proxy(const basic_openid_message& xx,const string& m) : x(xx), mode(m) { }
bool has_field(const string& n) const { return x.has_field(n); }
const string& get_field(const string& n) const {
return (n=="mode")?mode:x.get_field(n); }
bool has_ns(const string& uri) const {return x.has_ns(uri); }
string get_ns(const string& uri) const { return x.get_ns(uri); }
fields_iterator fields_begin() const {
return x.fields_begin(); }
fields_iterator fields_end() const {
return x.fields_end(); }
};