140 Commits
Author SHA1 Message Date
Michael Catanzaro 2f92f5fb93 Remove TLS section of SoupSession porting docs
SoupSessionAsync and SoupSessionSync are growing the new behavior, so
there is no longer any difference to document here.
2021-06-24 12:18:31 -05:00
Carlos Garcia Campos 4ec09b214a soup-message: make soup_message_disables_feature_by_type() public
Renamed as soup_message_is_feature_disabled(). We need this in WebKit to
check if cookies are available in an existing SoupMessage.
2020-07-06 11:44:36 +02:00
Patrick Griffis d4f8cff260 Expose support for same-site cookies
This adds API for web browsers to set extra information to support
same-site cookies.

Note that usage of SoupSession alone does not provide enough
information to reasonably use these at the moment and require
manually setting the information with the extra context a browser
may have.
2020-01-21 14:55:54 -08:00
Sonny Piers 5f08aae547 fix typo in client-howto.xml 2019-09-19 23:41:52 +00:00
Claudio Saavedra d0f97bd67f HSTS: Add API to retrieve a list of policies in an enforcer
Add soup_hsts_enforcer_get_policies(). This API is needed for WebKit's
website data manager to handle HSTS policies.
2019-08-05 14:19:10 +00:00
Claudio Saavedra 6c06d60074 HSTS: add API to get domains with policies
Add soup_hsts_enforcer_get_domains() which returns a list of domains
for which there are HSTS policies. This API is needed to allow
WebKit's data manager to handle HSTS policies.
2019-08-05 14:19:10 +00:00
Carlos Garcia Campos 13cea0fdf2 WebSockets: add support for permessage-deflate extension
Add new API to add WebSocket extensions to SoupSession and SoupServer
and include an implementation of permessage-deflate extension (see RFC
7692). In the client side, supported extensions are added to the session
as sub-features of a new session feature, SoupWebsocketExtensionManager.
In the client side, supported extensions are added/removed directly using
the new SoupServer API. All functions to negotiate the handshake
(client_prepare, client_verify, server_check and server_process) have
now a _with_extensions alternative to handle the extensions.
2019-07-31 14:09:00 +02:00
Carlos Garcia Campos 109bb2f692 WebSockets: allow null characters in text messages data
RFC 6455 says that text messages should contains valid UTF-8, and null
characters valid according to RFC 3629. However, we are using
g_utf8_validate(), which considers null characters as errors, to
validate WebSockets text messages. This patch adds an internal
utf8_validate() function based on g_utf8_validate() but allowing null
characters and just returning a gboolean since we are always ignoring
the end parameter in case of errors.
soup_websocket_connection_send_text() assumes the given text is null
terminated, so we need a new public function to allow sending text
messages containing null characters. This patch adds
soup_websocket_connection_send_message() that receives a
SoupWebsocketDataType and GBytes, which is consistent with
SoupWebsocketConnection::message signal.
2019-06-27 16:42:00 +02:00
Yanko Kaneti f6461df769 docs: ignore soap-brotli-decompressor 2019-05-27 13:08:31 +03:00
Claudio Saavedra 986a7ab1e3 Make soup_hsts_enforcer_set_policy() public
I can't see a reason for it to be private, and it's needed for unit
testing.
2019-05-22 14:59:14 +00:00
Claudio Saavedra 08424cf79d HSTS: Rewrite the HSTS feature and add tests
This is a comprehensive rework of the HSTS enforcer and related
classes, based upon Adrien Plazas work. A summary of the most
relevant changes:

SoupHSTSEnforcer:

- The enforcer will listen on headers both on message queueing
  and restarting. This is necessary in order to be able to enforce
  HSTS redirections on messages that are restarted for whatever
  reason.
- Instead of causing a redirection, the URI will be overwritten
  directly on the message before it is sent. Redirections
  are for use on the server side, and the tests added show that
  it is not a reliable way to do HSTS enforcing. Currently,
  the only way to find out that a HSTS policy has been enforced
  is by listening to the SoupMessage:uri property changes, but
  this might be impractical, so this could be revisited in the
  future.
- soup_hsts_enforcer_policy() will not steal the given policy.
  Doing so is prone to leaks and not customary.
- SoupHSTSEnforcerClass now has a has_valid_policy() vfunc.
  It currently works exactly as before, but the idea here is to
  make it possible for subclasses to implement their own check
  for existence of valid policies for domains, instead of all
  subclasses having to add their policies to the base
  SoupHSTSEnforcer class. This will be useful when having a large
  number of pre-loaded HSTS policies (either in SoupHSTSEnforcerDB
  or in an enforcer using libhsts as a backend) to avoid having
  potentially thousands of policies in memory at all times.
- HSTS headers are parsed using soup's available utilities,
  instead of parsing them by hand. The specification is carefully
  followed so as to not accept any header that is not fully
  compliant.

SoupHSTSEnforcerDB:

- Store the max-age attribute in the database. This was done before
  errata 5372 was reported to RFC 6797, and its necessity will
  depend on how the errata is treated.

Other:

- Added tests for both enforcer classes that cover most of the
  specification.
- Added the gtk-doc documentation and update all the documentation
  comments.
- Rename SoupHsts classes to SoupHSTS for consistent naming and
  other minor renaming of parameters and methods.
2019-05-22 14:59:14 +00:00
Patrick Griffis 04d85e1b52 Implement strict secure cookies
This prevents insecure origins from creating or modifying secure cookies.

https://tools.ietf.org/html/draft-ietf-httpbis-cookie-alone-01
2019-05-22 16:55:02 +02:00
Claudio Saavedra 716acf96c8 gtkdoc: set the documentation namespace
This prevents all documentation to be indexed under S in the index.
2019-05-16 18:37:10 +03:00
Claudio Saavedra 760ccac518 meson: fix the documentation src_dir value
Use include_directories() instead of hardcoding it to make sure
that both its source and build directory are included.
2019-05-16 17:49:17 +03:00
Tomas Popela 855f6e274e Remove the Autotools build system files
The main build system of the libsoup project is now Meson. Also remove
the TAP support files.

Closes: #12
2019-01-11 10:49:56 +00:00
Claudio Saavedra a5a03b5699 soup-headers: add strict parameter parsing functions
These functions extend the existing parameter-parsing functions
but differ in that they return NULL if there are any duplicated
parameters. It is noted in their documentation that they
are not recommended to parse header fields that might contain
RFC5987-encoded parameters.

Add tests for the parameter parsing methods that cover the
different cases, including RFC5789-encoded parameters.
2018-10-08 10:52:27 +00:00
Tomas Popela 373dbc81ec meson: Specify the right dependency when building documentation
Closes: #8
2018-08-31 06:59:51 +00:00
Tomas Popela 6d5923cf08 Add support for libpsl
https://bugzilla.gnome.org/show_bug.cgi?id=769650
2018-04-11 12:39:20 +02:00
Tomas Popela af5186fdc1 Add Meson port files to the Autotools EXTRA_DIST
So it's possible to build with the Meson from the tarball that is
produced by Autotools
2018-04-11 12:39:20 +02:00
Tomas Popela 72d25d22d2 Fix the module name for the gnome.gtkdoc() 2018-04-11 12:39:19 +02:00
Tomas Popela f0b481582c Add support for building the documentation 2018-04-11 12:39:19 +02:00
Tomas Popela d6ea55c842 Remove a leftover reference to already removed soup-tld-private.h file
https://bugzilla.gnome.org/show_bug.cgi?id=769650
2018-04-11 12:10:40 +02:00
Carlos Garcia Campos d852881f1a Add new API to create a new connection from a SoupSession
Add soup_session_connect_async() to create a new dedicated connection to
the given SoupURI. The operation finishes when the connection has been
completed, including any TLS handshacking or proxy negotiation,
returning a GIOStream that can be used to communicate with the server.

This is based on a patch by Dirkjan Ochtman <[email protected]>.

https://bugzilla.gnome.org/show_bug.cgi?id=792212
2018-02-01 15:20:51 +01:00
Carlos Garcia Campos c661c44a36 Add API to clear cached credentials from SoupAuthManager
In WebKit, we need to clear the cached credentials. It's mainly used by
tests to ensure that auth tests are independent to each other.

https://bugzilla.gnome.org/show_bug.cgi?id=774031
2016-11-15 12:41:20 +01:00
6a8826f0d2 Bug 587145 - Add GSS-Negotiate support
If a "WWW-Authenticate: Negotiate" HTTP header is spotted libsoup will check if
the host is on blacklist and the authentication fails if so. Otherwise the host
is compared against a trusted URIs (if the trusted URIs list is not set all
the HTTPS requests are trusted by default) and then processed. The trusted URIs
list and blacklist are both created when a SoupNegotiateAuth is created. The
trusted URIs list (blacklist) is parsed from the SOUP_GSSAPI_TRUSTED_URIS (
SOUP_GSSAPI_BLACKLIST_URIS) environment variable that expects the URIs be comma
separated (e.g. "http://www.example.com,https://www.test.com:80"). Then the
request is processed by the GSS library (the SPNEGO mechanism is used) which
produces a token that is send back to the server in the next request. The reply
is then again processed by the GSS library and the authentication succeeds by
receiving the GSS_S_COMPLETE status or we continue negotiating when the
GSS_S_CONTINUE_NEEDED is received.

The SoupAuth object is marked as not authenticated if a user will try to call
the soup_auth_authenticate() with the credentials provided as this is not
supported.

If the libsoup is configured with GSS-Negotiate support, a Kerberos library with
GSSAPI support needs to be available on the system (MIT Kerberos was tested
while working on this). Developers can check whether the libsoup was
compiled with the GSS-Negotiate support enabled by checking the
soup_auth_negotiate_supported() function.

To easily test the GSS-Negotiate functionality a new argument "N" was added to
the examples/get utility.

A support for NTLMSSP is provided by this patch given that a Kerberos library
supports NTLMSSP mechanism via GSSAPI. For MIT Kerberos one can use gss-ntlmssp
module, https://fedorahosted.org/gss-ntlmssp/.

Co-Authored-By: Tomas Popela <[email protected]>
Co-Authored-By: David Woodhouse <[email protected]>
Co-Authored-By: Dan Winship <[email protected]>
2016-03-14 15:04:35 +01:00
Kalev Lember 5df74a141a Support g_autoptr() for all libsoup object types
This allows using e.g. g_autoptr(SoupSession) in other programs, but
does not make libsoup itself use g_autoptr, or require a new enough glib
to support it.

https://bugzilla.gnome.org/show_bug.cgi?id=754721
2015-09-09 16:01:16 +02:00
Xavier Claessens 2215e45813 xmlrpc: Deprecate gvalue API 2015-08-13 11:32:35 -04:00
Xavier Claessens 2dd764906f xmlrpc: Add GVariant (de)serializer
https://bugzilla.gnome.org/show_bug.cgi?id=746495
2015-08-13 11:28:39 -04:00
Xavier Claessens d25450a059 Add SOUP_DEPRECATED_IN_2_52 macro
https://bugzilla.gnome.org/show_bug.cgi?id=746495
2015-08-12 11:06:52 -04:00
Bastien Nocera 94fc7d894a soup-version.h: add 2.52 macros
https://bugzilla.gnome.org/show_bug.cgi?id=637387
2015-06-22 17:26:21 -04:00
Dan Winship 931fd82e1e docs: fix build 2015-03-03 11:04:44 -05:00
Carlos Garcia Campos 29a976932f Add SoupMessage::starting signal
It's similar to the SoupSession::request-started signal, but it's also
emitted for cached resources.

https://bugzilla.gnome.org/show_bug.cgi?id=731153
2015-03-02 09:42:37 +01:00
Dan Winship bad4105543 websockets: add WebSocket support to SoupSession and SoupServer
Add new SoupSession and SoupServer API to use the new WebSocket
support.

Based on code originally from the Cockpit project, and on earlier work
by Lionel Landwerlin to merge that into libsoup.

https://bugzilla.gnome.org/show_bug.cgi?id=627738
2015-03-01 10:36:55 -05:00
Dan Winship dfc36f5fee websockets: add WebSocket support
Add functions to create and parse WebSocket handshakes, and to
communicate on a WebSocket connection.

Based on code originally from the Cockpit project, and on earlier work
by Lionel Landwerlin to merge that into libsoup.

https://bugzilla.gnome.org/show_bug.cgi?id=627738
2015-03-01 10:36:55 -05:00
Lionel Landwerlin cbe988d9df uri: add support for WebSocket schemes 2015-03-01 10:36:27 -05:00
Lionel Landwerlin a3ce28bad9 soup-message-headers: add new APIs
Add soup_message_headers_get_header_type(),
soup_message_headers_header_contains(), and
soup_message_headers_header_equals().
2015-03-01 10:36:27 -05:00
Dan Winship 6a95b6de15 soup-session: add soup_session_steal_connection()
Add a method to allow stealing a connection from a SoupSession.

Includes a new test using both this and
soup_client_context_steal_connection() to perform an upgrade on both
sides of a previously-HTTP connection.

https://bugzilla.gnome.org/show_bug.cgi?id=721343
2015-03-01 10:36:27 -05:00
Dan Winship 17bbf1197b soup-server: add soup_client_context_steal_connection()
Add a method to allow a SoupServer handler to steal the connection
from the server, and use this in simple-proxy to implement CONNECT.

Incorporates a patch from Lionel Landwerlin.
2015-03-01 10:36:27 -05:00
Dan Winship 89d8415020 soup-server: add "early" handlers
Add soup_server_add_early_handler(), for registering handlers to be
run from got-headers rather than got-body.

https://bugzilla.gnome.org/show_bug.cgi?id=625645
2015-03-01 10:19:13 -05:00
Dan Winship d6811baf8a docs: fix some minor docs issues 2015-03-01 10:18:54 -05:00
Marc-André Lureau 50bdc5c2c7 soup-server: add soup_server_accept_iostream()
Allow a GIOStream to be accepted as new client connection by the
SoupServer. This is useful for clients that do not want to rely on
system sockets for example.

https://bugzilla.gnome.org/show_bug.cgi?id=744186
2015-02-21 00:17:27 +01:00
Tristan Van Berkom 7046ce11b4 Added missing symbol soup_server_get_uris() to the documentation. 2014-10-14 20:16:19 +09:00
Evan Nemerson 035842c4f6 docs: ignore soup-socket-private.h
https://bugzilla.gnome.org/show_bug.cgi?id=730779
2014-05-27 07:19:59 -04:00
Dan Winship 1c71cb223b soup-server: add new-and-improved APIs
Add new APIs to SoupServer, allowing multiple listening sockets on a
server, and listening on an existing fd or GSocket, and with better
error handling.

https://bugzilla.gnome.org/show_bug.cgi?id=522519
https://bugzilla.gnome.org/show_bug.cgi?id=561547
https://bugzilla.gnome.org/show_bug.cgi?id=621138
2014-05-02 09:13:14 -04:00
Dan Winship f0f3d6aeeb Misc docs updates 2013-12-11 12:13:52 +01:00
Dan Winship c2d0f8d19e docs: Update client-side tutorial for 2.42, document request APIs 2013-12-11 11:44:31 +01:00
Dan Winship fb09bf930c Use GProxyResolver for all proxy resolving
Finish up the GProxyResolver porting started in 2.42 by removing all
the non-GProxyResolver proxy code from SoupSocket and SoupConnection
and implementing SoupSession:proxy-uri in terms of
GSimpleProxyResolver. If the user adds a SoupProxyResolverDefault to
the session, just use its GProxyResolver directly instead. If the user
adds any other kind of SoupProxyURIResolver to the session, use the
new SoupProxyResolverWrapper, which is a GProxyResolver that
translates from SoupProxyURIResolver.

https://bugzilla.gnome.org/show_bug.cgi?id=680273
2013-07-13 11:19:11 -04:00
Dan Winship 7f9c7c8731 Rename SoupKnownStatusCode to SoupStatus
Rename SoupKnownStatusCode to SoupStatus (so that the type name
matches the enum values), and then, for backward-compatibility, add a
new SoupKnownStatusCode enum with equivalent values so that
introspection-using code that was doing "SoupKnownStatusCode.OK", etc,
will still work.

https://bugzilla.gnome.org/show_bug.cgi?id=684409
2013-07-13 11:09:39 -04:00
Olivier Blin 7539b3c15e use libfffi-based generic marshaller instead of glib-genmarshal
g_cclosure_marshal_generic() is the default signal handler starting
from glib 2.29.12. libsoup already requires glib 2.33.1.

https://bugzilla.gnome.org/show_bug.cgi?id=686042
2013-06-08 20:41:22 -03:00
Sergio Villar Senin c146806dc1 soup-message-queue: add a priority system to the message queue
Clients can specify a priority for each message added to the SoupSession,
which will determine the order in which it is processed by the
session's message processing queue.

https://bugzilla.gnome.org/show_bug.cgi?id=696277
2013-04-17 10:15:59 +02:00