Skip to main content

restfull rql edition capabilities

Project description

Summary

Controller that gives users rql read/ write capabilities. To have token authentication, install cubicweb_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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cubicweb-rqlcontroller-0.9.1.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cubicweb_rqlcontroller-0.9.1-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file cubicweb-rqlcontroller-0.9.1.tar.gz.

File metadata

  • Download URL: cubicweb-rqlcontroller-0.9.1.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8

File hashes

Hashes for cubicweb-rqlcontroller-0.9.1.tar.gz
Algorithm Hash digest
SHA256 9b5eb8374a627487c2c4a2aa34895d1e2a127854045c9614ed4c7a19bc3c103c
MD5 c191eeea12ae88a6a399e29ee83015b6
BLAKE2b-256 d8947042e9f11cba64e93cbe0977a6459144733d3e8a7d9bb19c93ecbc9d153e

See more details on using hashes here.

File details

Details for the file cubicweb_rqlcontroller-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: cubicweb_rqlcontroller-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8

File hashes

Hashes for cubicweb_rqlcontroller-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 71869202aaef6f17515d3a8c109054337b04f3669c40c4f0b381428049754246
MD5 a6aeec7bd43391a338abb43d040b35e5
BLAKE2b-256 a51268f444e8b2910c75bdbccbcf3d17cfb61534356dcfb2c87cd50de676c8b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page