newsAdvanced Gtk+ Sequencer - News

 
 

GSequencer v3.0.0 has got support for libsoup2.4 XMLRPC

Item posted by Joël Krähemann <jkraehemann> on Thu 12 Dec 2019 06:28:37 PM UTC.

Few days ago, I have closed the task "Implement AgsServer and related controllers". I decided to strip the code to very basic implementation. AgsFrontController is all you got with authentication and session support. Read more here:

https://savannah.nongnu.org/task/index.php?14177

Advanced Gtk+ Sequencer dropped native sockets support in favor of GIO's implementation. The XMLRPC server is implemented using libsoup2.4:

https://wiki.gnome.org/Projects/libsoup

The following cookies are responsible for session tracking:


The AgsPluginController interface


Extending AgsServer is done by implementing AgsPluginController interface. Additionally, you should derive your object from AgsController in order to match :context-path property.

The AgsPluginController::do_request() function is invoked as the context matches to the XMLRPC request's path.


gpointer ags_plugin_controller_do_request(AgsPluginController *plugin_controller,
                                          SoupMessage *msg,
                                          GHashTable *query,
                                          SoupClientContext *client,
                                          GObject *security_context,
                                          gchar *path,
                                          gchar *login,
                                          gchar *security_token);


You might want to set the response of @msg using following function:


void soup_message_set_response(SoupMessage *msg,
                               const char *content_type,
                               SoupMemoryUse resp_use,
                               const char *resp_body,
                               gsize resp_length);


Authentication and session modules


GSequencer provides autentication and session abstraction. These are the provided interfaces:


The following singletons match the configured module:


libags library provides ready to use implementation using XML backend.


Hands on: ags_functional_server_test.c


If you want to see GSequencer's XMLRPC in action, checkout the integration test:

http://git.savannah.nongnu.org/cgit/gsequencer.git/tree/ags/test/server/ags_functional_server_test.c?h=3.0.x

Or just invoke: `./configure --enable-run-functional-tests && make check`

Default configuration directory missing


I consider to require a system configuration directory:

    /etc/gsequencer

This would provide:

  1. ags_authentication.xml
  2. ags_password_store.xml


For its valid content please check:

http://git.savannah.nongnu.org/cgit/gsequencer.git/tree/ags/server/security/ags_authentication.dtd?h=3.0.x
http://git.savannah.nongnu.org/cgit/gsequencer.git/tree/ags/server/security/ags_password_store.dtd?h=3.0.x

Thought, I have to solve howto store realm and salt ...

A possibility would be to put it into AgsConfig.


[server]
realm=ags-test-realm
auto-start=true
any-address=false
enable-ip4=true
ip4-address=127.0.0.1
enable-ip6=false
ip6-address=::1
server-port=8080




by Joël

Back to the top

Powered by Savane 3.13-ec04.
Corresponding source code