summaryrefslogtreecommitdiff
path: root/rest
Commit message (Collapse)AuthorAgeFilesLines
...
* RestProxyCall: Remove unused structTimm Bäder2016-07-191-6/+0
|
* proxy: Remove use of libsoup-gnomeChristophe Fergeau2016-07-191-8/+0
| | | | | | | It has been deprecated for a long while, and we were only using it for proxy support. However, now that we switched to using SoupSession rather than SoupSession{Sync,Async}, a default proxy resolver will be used, so we don't need to set it explicitly.
* oauth-proxy: Add docs for request_token_finishwip/baedert/gtask2Timm Bäder2016-07-141-0/+11
|
* Add more missing precondition checksTimm Bäder2016-07-143-2/+14
|
* rest-param: Add missing preconditionsTimm Bäder2016-07-141-2/+22
|
* oauth-proxy: Fix some gtkdoc errorsTimm Bäder2016-07-141-8/+0
|
* oauth-proxy-call: Remove an unnecessary castTimm Bäder2016-07-141-1/+1
|
* rest-proxy: Fix precondition in new_callTimm Bäder2016-07-141-1/+5
|
* rest-proxy: Add some missing preconditionsTimm Bäder2016-07-141-2/+9
|
* oauth2: Fix SoupUri leak in oauth2_proxy_extract_access_token()wip/teuf/gtaskChristophe Fergeau2016-06-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes: ==16342== 93 (64 direct, 29 indirect) bytes in 1 blocks are definitely lost in loss record 211 of 278 ==16342== at 0x4C2BBAD: malloc (vg_replace_malloc.c:299) ==16342== by 0x5F5CE58: g_malloc (gmem.c:94) ==16342== by 0x5F73D42: g_slice_alloc (gslice.c:1025) ==16342== by 0x5F7436D: g_slice_alloc0 (gslice.c:1051) ==16342== by 0x56DA77A: soup_uri_new_with_base (soup-uri.c:283) ==16342== by 0x56DAA42: soup_uri_new (soup-uri.c:519) ==16342== by 0x4E48BB5: oauth2_proxy_extract_access_token (oauth2-proxy.c:384) ==16342== by 0x4009E6: test_url_fragment_no_access_token (oauth2.c:36) ==16342== by 0x5F7C983: test_case_run (gtestutils.c:2158) ==16342== by 0x5F7C983: g_test_run_suite_internal (gtestutils.c:2241) ==16342== by 0x5F7CB4E: g_test_run_suite_internal (gtestutils.c:2253) ==16342== by 0x5F7CD5D: g_test_run_suite (gtestutils.c:2328) ==16342== by 0x5F7CD80: g_test_run (gtestutils.c:1596) ==16342== by 0x400B64: main (oauth2.c:65) ==16342== ==16342== 133 (64 direct, 69 indirect) bytes in 1 blocks are definitely lost in loss record 262 of 278 ==16342== at 0x4C2BBAD: malloc (vg_replace_malloc.c:299) ==16342== by 0x5F5CE58: g_malloc (gmem.c:94) ==16342== by 0x5F73D42: g_slice_alloc (gslice.c:1025) ==16342== by 0x5F7436D: g_slice_alloc0 (gslice.c:1051) ==16342== by 0x56DA77A: soup_uri_new_with_base (soup-uri.c:283) ==16342== by 0x56DAA42: soup_uri_new (soup-uri.c:519) ==16342== by 0x4E48BB5: oauth2_proxy_extract_access_token (oauth2-proxy.c:384) ==16342== by 0x400A25: test_access_token_simple (oauth2.c:44) ==16342== by 0x5F7C983: test_case_run (gtestutils.c:2158) ==16342== by 0x5F7C983: g_test_run_suite_internal (gtestutils.c:2241) ==16342== by 0x5F7CB4E: g_test_run_suite_internal (gtestutils.c:2253) ==16342== by 0x5F7CD5D: g_test_run_suite (gtestutils.c:2328) ==16342== by 0x5F7CD80: g_test_run (gtestutils.c:1596) ==16342== by 0x400B64: main (oauth2.c:65) ==16342== ==16342== 137 (64 direct, 73 indirect) bytes in 1 blocks are definitely lost in loss record 263 of 278 ==16342== at 0x4C2BBAD: malloc (vg_replace_malloc.c:299) ==16342== by 0x5F5CE58: g_malloc (gmem.c:94) ==16342== by 0x5F73D42: g_slice_alloc (gslice.c:1025) ==16342== by 0x5F7436D: g_slice_alloc0 (gslice.c:1051) ==16342== by 0x56DA77A: soup_uri_new_with_base (soup-uri.c:283) ==16342== by 0x56DAA42: soup_uri_new (soup-uri.c:519) ==16342== by 0x4E48BB5: oauth2_proxy_extract_access_token (oauth2-proxy.c:384) ==16342== by 0x400A97: test_url_encoding_access_token (oauth2.c:51) ==16342== by 0x5F7C983: test_case_run (gtestutils.c:2158) ==16342== by 0x5F7C983: g_test_run_suite_internal (gtestutils.c:2241) ==16342== by 0x5F7CB4E: g_test_run_suite_internal (gtestutils.c:2253) ==16342== by 0x5F7CD5D: g_test_run_suite (gtestutils.c:2328) ==16342== by 0x5F7CD80: g_test_run (gtestutils.c:1596) ==16342== by 0x400B64: main (oauth2.c:65)
* xml-node: Use GString in rest_xml_node_print()Christophe Fergeau2016-06-201-9/+12
| | | | | | | | | | | | | | | | | | The current code is using xml = g_strconcat (xml, ...) which is causing some leaks as g_strconcat returns a newly allocated string. Using GString avoids this issue without constantly freeing the intermediate strings. This fixes multiple leaks like: ==16611== 18 bytes in 1 blocks are definitely lost in loss record 124 of 301 ==16611== at 0x4C2BBAD: malloc (vg_replace_malloc.c:299) ==16611== by 0x5F5CE58: g_malloc (gmem.c:94) ==16611== by 0x5F75B8E: g_strconcat (gstrfuncs.c:585) ==16611== by 0x4E450CF: rest_xml_node_print (rest-xml-node.c:287) ==16611== by 0x4E451DA: rest_xml_node_print (rest-xml-node.c:305) ==16611== by 0x4E450F8: rest_xml_node_print (rest-xml-node.c:292) ==16611== by 0x4009A0: main (xml.c:40)
* build: Fix "intospection" typoChristophe Fergeau2016-06-201-1/+1
|
* OAuthProxy: g_free is NULL-safeTimm Bäder2016-06-201-3/+1
|
* RestProxy(Call): Simplify _disposeTimm Bäder2016-06-202-28/+5
|
* RestProxyCall: Use G_DEFINE_TYPE_WITH_PRIVATETimm Bäder2016-06-202-97/+30
|
* rest-proxy: Use G_DEFINE_TYPE_WITH_PRIVATETimm Bäder2016-06-202-29/+16
|
* RestProxyCall: Prevent segfault in prepare_messageTimm Bäder2016-06-201-0/+4
| | | | | soup_form_request_new_from_hash can return NULL, e.g. if the given url is malformed.
* RestProxy: Remove SoupSession[A]sync usageTimm Bäder2016-06-201-29/+2
| | | | | priv->session was a SoupSession since the last commit, which also removed every practical usage or priv->session_sync.
* RestProxyCall: Use GTaskTimm Bäder2016-06-204-228/+37
|
* OAuthProxy: Use GTaskChristophe Fergeau2016-06-202-74/+82
| | | | Based on initial work from Timm Bäder <mail@baedert.org>
* rest-proxy: Port _invoke_async to GTaskTimm Bäder2016-06-202-32/+19
|
* Remove glib-compat.{c,h}Timm Bäder2016-06-164-161/+0
|
* Remove all GLIB_CHECK_VERSION usesTimm Bäder2016-06-162-4/+1
| | | | Where the checked version is < 2.36, which we now require
* oauth-proxy: Remove deprecated APITimm Bäder2016-06-162-118/+0
|
* xml-node: Remove deprecated APITimm Bäder2016-06-162-8/+0
|
* oauth-proxy-call: Remove _parse_token_reponseTimm Bäder2016-06-162-12/+0
| | | | An equivalent _parse_token_response exists that does not contain a typo.
* sha: Use GHmacTimm Bäder2015-10-051-63/+7
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=658725
* oauth: Don't leak temp data in steal_oauth_paramsChristophe Fergeau2015-07-301-0/+1
| | | | | | | | steal_oauth_params() creates a list of strdup'ed strings containing the name of the ouath parameters which should be stolen from the call arguments. However, the code makes sure to free the list, but never frees its content, causing a leak. This commit makes sure the dup'ed strings are freed.
* rest-xml-parser: Ignore text content at the top-level of a documentPhilip Withnall2015-04-141-3/+9
| | | | | | | | This prevents a crash due to cur_node being NULL. Found by scan-build. https://bugzilla.gnome.org/show_bug.cgi?id=719550
* rest-proxy-auth: Add rest_proxy_auth_cancel for cancelling authenticationPavel Grunt2015-04-082-0/+18
| | | | | It can be helpful when handling the "authenticate" signal to allow to cancel the authentication instead of failing with an error.
* Don't dump XML parsing errors to stderr/stdout by defaultChristophe Fergeau2015-03-161-0/+10
| | | | These errors should only be shown if REST_DEBUG=xml-parser is set.
* xml-parser: Add missing break in switch statementRob Bradford2014-09-191-0/+1
| | | | | This would result in an inappropriate debug message appearing on valid text data.
* oauth: Add missing includeChristophe Fergeau2014-09-031-0/+1
| | | | This fixes a compilation warning about a missing prototype.
* oauth: Don't leak RestProxyCall::token{_secret}Christophe Fergeau2014-09-031-0/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=735922
* tests: Don't call g_type_init() on newer glibChristophe Fergeau2014-09-031-0/+2
| | | | | | This is deprecated and causes a compile warning https://bugzilla.gnome.org/show_bug.cgi?id=735921
* Move RestProxyCallPrivate to rest-proxy-call.cChristophe Fergeau2014-09-033-32/+32
| | | | | | | | It was in a separate rest-proxy-call.h header which allowed derived classes to access RestProxyCall private data without any control. Better to go through explicit methods to do that. https://bugzilla.gnome.org/show_bug.cgi?id=735919
* oauth: Remove direct access to RestProxyCallPrivateChristophe Fergeau2014-09-031-6/+6
| | | | | | | | OAuthProxyCall was directly accessing private RestProxyCall data. The same functionality can be achieved using only librest public API, so let's use that instead. https://bugzilla.gnome.org/show_bug.cgi?id=735919
* oauth: Make sure RestProxyCall::url is set before using itChristophe Fergeau2014-09-033-2/+17
| | | | | | | | | | | | The oauth "prepare" step needs RestProxyCall::url to be set, but since commit c66b6d this is only set after the "prepare" and "serialize_headers" methods have been called. As it's better if OAuthProxyCall do not directly access RestProxyCall private data, this commit adds a getter to RestProxyCall which will be used to make sure RestProxyCall::url is set when OAuthProxyCall::prepare needs it. https://bugzilla.gnome.org/show_bug.cgi?id=708359
* More improvements to rest_proxy_call_get_params API docChristophe Fergeau2014-09-021-2/+2
|
* Add libsoup to gir includesChristophe Fergeau2014-09-021-1/+1
| | | | | | | Since the public API now references a type from libsoup, we need to add Soup-2.4.gir to Rest_@API_VERSION_AM@_gir_INCLUDES. https://bugzilla.gnome.org/show_bug.cgi?id=728340
* Add rest_proxy_add_soup_feature()Christophe Fergeau2014-08-252-0/+40
| | | | | | | | | | | | | | | | | | | This function can be helpful if one wants more control over libsoup features than what librest simple API provide. For example, to get full access to libsoup cookie API (say to be able to add arbitrary cookies to the soup session), one can do: RestProxy *proxy = g_object_new(REST_TYPE_PROXY, "url-format", url, "disable-cookies", TRUE, NULL); SoupSessionFeature *cookie_jar = SOUP_SESSION_FEATURE(soup_cookie_jar_new ()); rest_proxy_add_soup_feature(proxy, cookie_jar); It's then possible to use all the soup_cookie_* methods to deal with cookies. https://bugzilla.gnome.org/show_bug.cgi?id=728340
* Allow to modify REST function in serialize_params vfuncChristophe Fergeau2014-08-251-13/+47
| | | | | | | | | | | | | | | | | RestProxyCall::prepare_message() calls the serialize_params vfunc so that child classes can serialize the call parameters in whichever way they want. One way of doing that could be to append the parameters to the URI that is called (http://example.com?param1=value1;param2=value2). However, the URI to call is determined at the beginning of prepare_message(), and is not refreshed after calling RestProxyCall::serialize_params(), so it's not possible to append parameters to the URI that is going to be called. This commit rebuilds the URI to call after calling serialize_params() in case it has changed. https://bugzilla.gnome.org/show_bug.cgi?id=708359
* Add rest_proxy_call_get_function()Christophe Fergeau2014-08-252-0/+25
| | | | | | | | There are rest_proxy_call_[gs]et_method() methods, a rest_proxy_call_set_function() method, but no corresponding getter. Adding it makes the API more consistent. https://bugzilla.gnome.org/show_bug.cgi?id=708358
* Fix rest_xml_node_print name in gtk-doc annotationChristophe Fergeau2014-08-251-1/+1
|
* Ignore '/' at beginning of REST functionChristophe Fergeau2014-08-251-1/+2
| | | | | | | | | | | | | When building the HTTP URL to access for a REST operation, RestProxyCall::prepare_message, a '/' at the end of the base URL is ignored, but a '/' at the beginning of the REST function is not. When interacting with the oVirt REST API, I often end up building calls with for example 'https://ovirt.example.com' as the base URI, and '/api/vms/' as the function, which then leads to an URI with 2 '/': 'https://ovirt.example.com//api/vms' https://bugzilla.gnome.org/show_bug.cgi?id=728952
* Use g_hash_table_replace() in rest_params_add()Christophe Fergeau2014-08-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | rest_params_add() is currently using g_hash_table_insert() to add the passed in parameter in the parameter hash table. The key which is used is owned by the associated value. When using rest_params_add to replace an already existing parameter, the existing value will be freed with rest_param_unref(). However, g_hash_table_insert() does not replace the key when it already exists in the hash table: "If the key already exists in the GHashTable its current value is replaced with the new value... If you supplied a key_destroy_func when creating the GHashTable, the passed key is freed using that function." This means that after replacing an already existing parameter, the corresponding key will still be the old one, which is now pointing at freed memory as the old value was freed. g_hash_table_replace() ensures that the key will still be valid, even when replacing existing parameters: "Inserts a new key and value into a GHashTable similar to g_hash_table_insert(). The difference is that if the key already exists in the GHashTable, it gets replaced by the new key." https://bugzilla.gnome.org/show_bug.cgi?id=665716
* RestProxyCall: Handle soup_error_new() failuresChristophe Fergeau2014-08-251-0/+9
| | | | | | If given a URI it can't parse, soup_error_new() will return NULL. https://bugzilla.gnome.org/show_bug.cgi?id=728953
* docs: Add annotations to RestProxyAuth pausing methodsEmmanuele Bassi2014-03-101-0/+15
| | | | | | | Both pause() and unpause() are referenced elsewhere in the API reference, but have no formal documentation annotations. https://bugzilla.gnome.org/show_bug.cgi?id=712747
* docs: Add missing gtk-doc annotationsEmmanuele Bassi2014-03-102-2/+41
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=712747
* Further annotation fixesEmmanuele Bassi2014-03-102-8/+8
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=712747