summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-09-03tests/oauth: Use oauthbin.com as the test serverrhel-7.1Christophe Fergeau2-12/+12
The tests used to use term.ie which is gone. There are still some intermittent failures when running the tests, sometimes the test is successful, sometimes it's not :( https://bugzilla.gnome.org/show_bug.cgi?id=735921 (cherry picked from commit 6942de4c813b323a61cfe1414cea3c2a20d6e02b)
2014-09-03Fix URL used for flickr rest callsChristophe Fergeau2-3/+3
https must be used, and the correct URL for uploads is up.flickr.com https://bugzilla.gnome.org/show_bug.cgi?id=735920 (cherry picked from commit 19c5f952e9e30790795f3548c125e53392e8bb14)
2014-09-03oauth: Make sure RestProxyCall::url is set before using itChristophe Fergeau3-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 (cherry picked from commit 55f8e9626a50d81fb893508698205057668bf792)
2014-09-03lastfm: Fix function setting regressionChristophe Fergeau1-2/+3
Since commit c66b6d, RestProxyCall::url is regenerated after calling the RestProxyCall::prepare virtual method. This breaks the lastfm code as it needs to reset RestProxyCall::url in order to remove the function from it. It used to do that by directly accessing RestProxyCall private data. Since c66b6d, this can be solved using only public methods as if the function is reset on the RestProxyCall in ::prepare, ::url will be regenerated to reflect that after ::prepare and ::serialize_params have been called. https://bugzilla.gnome.org/show_bug.cgi?id=708359 (cherry picked from commit 1d71e83ac3ff7baaee43e0e66daaeeecb4ba96b4)
2014-09-03flickr: Fix function setting regressionChristophe Fergeau2-6/+10
Since commit c66b6d, RestProxyCall::url is regenerated after calling the RestProxyCall::prepare virtual method. This breaks the flickr code as it needs to reset RestProxyCall::url in order to remove the function from it. It used to do that by directly accessing RestProxyCall private data. Since c66b6d, this can be solved using only public methods as if the function is reset on the RestProxyCall in ::prepare, ::url will be regenerated to reflect that after ::prepare and ::serialize_params have been called. https://bugzilla.gnome.org/show_bug.cgi?id=708359 (cherry picked from commit fe1a864e4a6739ad07d890cd47f8cf180a3d1cdf)
2014-09-03Add libsoup to gir includesChristophe Fergeau1-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 (cherry picked from commit 0af8d4df4e5abb6ea36c9b3a9f04de03a41b2808)
2014-09-03Add rest_proxy_add_soup_feature()Christophe Fergeau3-0/+41
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 (cherry picked from commit 68d90e9e315d279aebe04d6b1177e57c075b8f72)
2014-09-03Allow to modify REST function in serialize_params vfuncChristophe Fergeau2-14/+49
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 (cherry picked from commit c66b6df501a0b40210ab2f23882ce3f57fdb1f5f)
2014-09-03Add rest_proxy_call_get_function()Christophe Fergeau3-0/+26
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 (cherry picked from commit 3513c3d80c4b5f60ab6531e5514a538f3e93f85e)
2014-08-27Ignore '/' at beginning of REST functionChristophe Fergeau1-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 (cherry picked from commit d54c36cc22c365bd21936365f7c9410899ad3ec1)
2014-08-27Use g_hash_table_replace() in rest_params_add()Christophe Fergeau1-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 (cherry picked from commit de21f49cda5554d1395d315c022c2f28d06ba778)
2014-08-27RestProxyCall: Handle soup_error_new() failuresChristophe Fergeau1-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 (cherry picked from commit 22f044e197cb3c3ce9b1e19972bfd95eb0d53d82)
2014-08-27Attach SoupLogger after SoupCookieJarChristophe Fergeau1-10/+10
The SoupLogger instance needs to be attached last (at least after the SoupCookieJar librest uses), otherwise REST_DEBUG=proxy will not dump the cookie headers added by the SoupCookieJar instance. https://bugzilla.gnome.org/show_bug.cgi?id=712231 (cherry picked from commit 024aecd486b8cd6b520565f15dc8d5f125d09509)
2014-08-27Add RestProxy::ssl-ca-file propertyyChristophe Fergeau1-1/+27
This property maps to the SoupSession::ssl-ca-file property, and allows to specify a file that contains the CAs to use to verify the certificates we'll get during a TLS session. (cherry picked from commit 4d2c76683116156048fa06185ca116bd8458929c) Conflicts: rest/rest-proxy.c
2012-08-14build: minor version bump to .90 to reflect beta status0.7.90Ross Burton1-1/+1
2012-06-28Propagate RestProxyAuth object in ::authenticate signalChristophe Fergeau2-7/+23
This will make it possible to pause/resume the current call during authentication callbacks to be able to get back to the mainloop to get authentication credentials. https://bugzilla.gnome.org/show_bug.cgi?id=658937
2012-06-28Add rest_proxy_auth_[un]pauseChristophe Fergeau3-0/+42
They can be used in RestProxy::authenticate signals to suspend the current authentication attempt. This allows to get back to the mainloop to get the credentials, and to then rerun the call with the correct credentials. https://bugzilla.gnome.org/show_bug.cgi?id=658937
2012-06-28Introduce RestProxyAuth typeChristophe Fergeau4-0/+199
This will be used by the RestProxy authentication code to be able to "pause" the sending of the current message. This will give applications the opportunity to get back to the main loop to do the authentication work before resuming the current request. https://bugzilla.gnome.org/show_bug.cgi?id=658937
2012-06-28Add RestProxy::authenticate signalChristophe Fergeau2-6/+52
If caught by application, this signal can be used to set the credentials to use when authentication is needed. If not caught, librest behaviour will be unchanged (try to use what the username/password properties were set to first, and don't try to reuse them if this fails). https://bugzilla.gnome.org/show_bug.cgi?id=658937
2012-06-28Revert "Use HMAC glib implementation instead of rolling our own"Christophe Fergeau8-5/+140
This reverts commit 2a8dac4cc7aeca25b182bb9806ddb1881f2f4994. Pushed by mistake...
2012-06-17Use HMAC glib implementation instead of rolling our ownChristophe Fergeau8-140/+5
https://bugzilla.gnome.org/show_bug.cgi?id=658725
2012-06-17Accept -1 len in rest_xml_parser_parse_from_dataChristophe Fergeau1-1/+5
This means that the passed in string is nul-terminated and that rest_xml_parser_parse_from_data should get its length with strlen. https://bugzilla.gnome.org/show_bug.cgi?id=657032
2012-06-16introspection: add info about C headers to useChristophe Fergeau2-0/+5
vapigen needs this information to be able to generate correct .vapi files. https://bugzilla.gnome.org/show_bug.cgi?id=678153
2012-06-16Drop obsolete g_thread_init()Martin Pitt18-18/+1
Since version 2.2 g_type_init() initializes also the thread system so g_thread_init() is not required anymore. It is deprecated since glib 2.31. Bump glib requirement accordingly. https://bugzilla.gnome.org/show_bug.cgi?id=650061
2012-06-16autogen.sh: support calling from out of treeChristophe Fergeau1-3/+12
https://bugzilla.gnome.org/show_bug.cgi?id=667572
2012-06-13Don't leak RestProxyCall::urlChristophe Fergeau1-0/+2
It's not freed when the call object is destroyed
2012-06-08Allow to disable libsoup strict SSL checkChristophe Fergeau1-1/+27
This is needed in order to access REST services over https using self-signed certificates. https://bugzilla.gnome.org/show_bug.cgi?id=663786
2012-06-07Avoid infinite loop with wrong HTTP credentialsChristophe Fergeau1-1/+2
When provided with wrong credentials, libsoup will try to connect and emit its 'authenticate' signal as long as its callback calls soup_auth_authenticate. It will fail the request and report to the caller if this function is not called. Since the 'retrying' parameter to the 'authenticate' callback lets us know when the credentials we provided are the wrong ones, this commit makes sure we stop calling soup_auth_authenticate after trying the credentials once. Without this, libsoup will try the same request again and again without ever returning when provided with wrong credentials. https://bugzilla.gnome.org/show_bug.cgi?id=658937
2012-05-28rest-extras: various introspection fixesEvan Nemerson4-6/+28
https://bugzilla.gnome.org/show_bug.cgi?id=676991
2012-05-03assorted introspection fixesEvan Nemerson6-13/+29
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=675213
2012-05-03rest-param: register RestParam as boxed type.Evan Nemerson2-0/+6
2012-03-27rest-xml-node: skip ref/unref() methods in introspectionDanielle Madeley1-2/+2
They're not needed in introspected languages.
2012-03-27rest-proxy-call: enforce one-shot use, clean up memory lifecycleRoss Burton1-36/+15
2012-03-27rest-proxy: add some basic documentationRoss Burton1-0/+9
2012-03-27Rename rest_proxy_call_call_async to rest_proxy_call_invoke_asyncRoss Burton2-18/+18
2012-03-27rest-proxy-call: add rest_proxy_call_call_async()Danielle Madeley3-4/+124
This is a GIO-style async function which is much easier to introspect. Should consider deprecating rest_proxy_call_async() and rest_proxy_call_cancel().
2012-02-24Don't leak ->url in rest_proxy_call_sync (#669764)Ross Burton1-0/+3
2012-02-10build: generate .pc files at build timeRob Staudinger1-0/+2
The pkg-config files for librest would only be generated on install time, which breaks the android port, pulling things from the build tree. Add a dependency for the .pc files on all-local, so they are create already when building. See https://bugs.freedesktop.org/show_bug.cgi?id=45855
2012-01-18autogen.sh: Honor NOCONFIGURE=1Colin Walters1-1/+5
See http://people.gnome.org/~walters/docs/build-api.txt
2011-12-08add username/password supportMarc-André Lureau2-3/+95
https://bugzilla.gnome.org/show_bug.cgi?id=658937
2011-11-10build: Post-release version bumpRob Bradford1-1/+1
2011-11-10proxy: Force all SSL certificates to be trustedlibrest-0.7.12Rob Bradford1-0/+10
By setting the CA file we make it a certificate error if the certificate is self-signed. Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=663783
2011-11-10build: Detect CA file locationRob Bradford1-0/+24
It will autodetect and also allow the setting of the CA file by a configure option. This code was stolen from glib-networking's configure.ac Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=663783
2011-11-04Fix source URL in configure.acRoss Burton1-1/+1
2011-10-27build: Post-release version bumpRob Bradford1-1/+1
2011-10-27misc: Remove NEWS file - we don't use itlibrest-0.7.11Rob Bradford1-6/+0
2011-10-26build: Link examples against gthread explicitlyEmmanuele Bassi1-2/+2
2011-09-05gitignore: Ignore glib-mkenums generated filesDamien Lespiau1-0/+3
2011-09-05build: Make libtool generate DLLs on windowsDamien Lespiau2-0/+2
libtool needs -no-undefined to generate DLLs on windows. As that flag can't hurt (on the contrary) for other platforms, just add it to the LDFLAGS.
2011-09-05build: Make it possible to autogen without gtk-docDamien Lespiau2-1/+14
On Windows, I don't want to go through installing gtk-doc just to get some DLLs compiled.