cubicweb-rqlcontroller


Namecubicweb-rqlcontroller JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://forge.extranet.logilab.fr/cubicweb/cubes/cubicweb-rqlcontroller
Summaryrestfull RQL edition capabilities for CubicWeb
upload_time2025-08-01 09:22:31
maintainerNone
docs_urlNone
authorLOGILAB S.A. (Paris, FRANCE)
requires_python>=3.9.2
licenseLGPL
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Summary
-------

Controller that gives users rql read/ write capabilities. To have token
authentication, install `cubicweb_signedrequest <https://forge.extranet.logilab.fr/cubicweb/cubes/signedrequest>`_.


Sample usage
------------

Users of this service must perform a HTTP POST request to its endpoint,
that is the base url of the CubicWeb application instance appended with
the "rqlio/1.0" url path.

The posted data must use the `application/json` or `multipart/form-data`.
For the `application/json` MIME type, the posted data must contain a list of
pairs of the form `(rql_string, rql_args)`, where:

* `rql_string` is any valid RQL query that may contain mapping keys with
  their usual form

* `rql_args` is a dictionary, whose keys are the mapping keys from
  `rql_string`, and the values can be:

  - actual values

  - string references to a previous RQL query's result, with the
    assumption that the referenced RQL query returns a single line and
    single column rset; under such conditions, a string reference
    must be "__rXXX" where `XXX` is the (0-based) index of the RQL query in
    the json-encoded list of queries.

The HTTP request's response (in case where there is no error), is a
json-encoded list.  Its length is the number of RQL queries in the request,
and each element contains the json-encoded result set rows from the
corresponding query.

In case of an error, a json object with a `reason` key will explain the
problem.

Python client example using python-requests::

    import requests
    import json

    args = [('INSERT CWUser U: U login %(l)s, U upassword %(p)s',
            {'l': 'Babar', 'p': 'cubicweb rulez & 42'}),

           ('INSERT CWGroup G: G name "pachyderms"', {}),

           ('SET U in_group G WHERE U eid %(u)s, G eid %(g)s',
            {'u': '__r0', 'g': '__r1'})
           ]

    resp = requests.post('https://myinstance.example.com/rqlio/1.0'),
                         data=json.dumps(args),
                         headers={'Content-Type': 'application/json'})
    assert resp.status_code == 200

            

Raw data

            {
    "_id": null,
    "home_page": "https://forge.extranet.logilab.fr/cubicweb/cubes/cubicweb-rqlcontroller",
    "name": "cubicweb-rqlcontroller",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9.2",
    "maintainer_email": null,
    "keywords": null,
    "author": "LOGILAB S.A. (Paris, FRANCE)",
    "author_email": "contact@logilab.fr",
    "download_url": "https://files.pythonhosted.org/packages/93/91/dc1c1235cef935d8d5aca74a88b3af68b9fb574bf7fb93dffd2d6f7ba5ee/cubicweb_rqlcontroller-1.1.0.tar.gz",
    "platform": null,
    "description": "Summary\n-------\n\nController that gives users rql read/ write capabilities. To have token\nauthentication, install `cubicweb_signedrequest <https://forge.extranet.logilab.fr/cubicweb/cubes/signedrequest>`_.\n\n\nSample usage\n------------\n\nUsers of this service must perform a HTTP POST request to its endpoint,\nthat is the base url of the CubicWeb application instance appended with\nthe \"rqlio/1.0\" url path.\n\nThe posted data must use the `application/json` or `multipart/form-data`.\nFor the `application/json` MIME type, the posted data must contain a list of\npairs of the form `(rql_string, rql_args)`, where:\n\n* `rql_string` is any valid RQL query that may contain mapping keys with\n  their usual form\n\n* `rql_args` is a dictionary, whose keys are the mapping keys from\n  `rql_string`, and the values can be:\n\n  - actual values\n\n  - string references to a previous RQL query's result, with the\n    assumption that the referenced RQL query returns a single line and\n    single column rset; under such conditions, a string reference\n    must be \"__rXXX\" where `XXX` is the (0-based) index of the RQL query in\n    the json-encoded list of queries.\n\nThe HTTP request's response (in case where there is no error), is a\njson-encoded list.  Its length is the number of RQL queries in the request,\nand each element contains the json-encoded result set rows from the\ncorresponding query.\n\nIn case of an error, a json object with a `reason` key will explain the\nproblem.\n\nPython client example using python-requests::\n\n    import requests\n    import json\n\n    args = [('INSERT CWUser U: U login %(l)s, U upassword %(p)s',\n            {'l': 'Babar', 'p': 'cubicweb rulez & 42'}),\n\n           ('INSERT CWGroup G: G name \"pachyderms\"', {}),\n\n           ('SET U in_group G WHERE U eid %(u)s, G eid %(g)s',\n            {'u': '__r0', 'g': '__r1'})\n           ]\n\n    resp = requests.post('https://myinstance.example.com/rqlio/1.0'),\n                         data=json.dumps(args),\n                         headers={'Content-Type': 'application/json'})\n    assert resp.status_code == 200\n",
    "bugtrack_url": null,
    "license": "LGPL",
    "summary": "restfull RQL edition capabilities for CubicWeb",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://forge.extranet.logilab.fr/cubicweb/cubes/cubicweb-rqlcontroller"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fe86e348c00c29d13aca5277b0dd6d86caa044540c1327be574ae65417200706",
                "md5": "33dcc39d829a30168f70fd63a39b7a6c",
                "sha256": "b27994761c92388f8072320874b8367aabc502071facb3104625caa51c67d5de"
            },
            "downloads": -1,
            "filename": "cubicweb_rqlcontroller-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "33dcc39d829a30168f70fd63a39b7a6c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9.2",
            "size": 10181,
            "upload_time": "2025-08-01T09:22:30",
            "upload_time_iso_8601": "2025-08-01T09:22:30.949351Z",
            "url": "https://files.pythonhosted.org/packages/fe/86/e348c00c29d13aca5277b0dd6d86caa044540c1327be574ae65417200706/cubicweb_rqlcontroller-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9391dc1c1235cef935d8d5aca74a88b3af68b9fb574bf7fb93dffd2d6f7ba5ee",
                "md5": "6ccd9396bd385403673321f72a96b7d2",
                "sha256": "07a84774d628f6f2630737feda07adbe25d3849efa7a4af7b2725b08b03199a9"
            },
            "downloads": -1,
            "filename": "cubicweb_rqlcontroller-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6ccd9396bd385403673321f72a96b7d2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9.2",
            "size": 9528,
            "upload_time": "2025-08-01T09:22:31",
            "upload_time_iso_8601": "2025-08-01T09:22:31.935553Z",
            "url": "https://files.pythonhosted.org/packages/93/91/dc1c1235cef935d8d5aca74a88b3af68b9fb574bf7fb93dffd2d6f7ba5ee/cubicweb_rqlcontroller-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-01 09:22:31",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "cubicweb-rqlcontroller"
}
        
Elapsed time: 3.09073s