Skip to main content

Summary

This cube allows a client to forge signed HTTP resquests that are then recognized as valid by the CubicWeb web server, ie. the request is handled as an authenticated user. For example, it can be used to start an operation using an authenticated user.

It’s usually used alongside with cubicweb-rqlcontroller and cwclientlib.

This cube aims at make it easy to write REST-like APIs for CW.

Long story short: cubicweb-signedrequest allows you to make authenticated HTTP requests simply by addind a properly forged HTTP header in your request.

How to use signed HTTP requests in your CubicWeb app?

This cube aims at making it possible to use tokens to authenticate to a CubicWeb application. It provides a Token entity that have a unique token_id attribute and a generated (secret) token. This Token entity is related to a CWUser (using the token_for_user relation).

It’s the possible to make authenticated HTTP requests (authenticated as this CWUser) by adding a Authorization header to the HTTP request. This header is computed as a HMAC hash with:

  • the secret token as key,

  • the concatenation os method + url + all the signed headers.

By default, the method is the Cubicweb string, and the signed headers are ‘Content-SHA512’, ‘Content-Type’ and ‘Date’.

The doc/sreq_example.py script is an simple python script showing how to forge such a HTTP GET request using urllib2.

Please read the documentation of cwclientlib for examples of how it can be used.

Release files for cubicweb-signedrequest 3.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cubicweb-signedrequest 3.3.1
File Size Uploaded
cubicweb_signedrequest-3.3.1.tar.gz 19.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cubicweb-signedrequest 3.3.1
File Interpreter ABI Platform
cubicweb_signedrequest-3.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 40.2 kB

Release files / cubicweb_signedrequest-3.3.1.tar.gz

Download URL cubicweb_signedrequest-3.3.1.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c7bed0bcf42e1ef037c8f44241241f448045ee596a57993a24cc69a372f9be2b
BLAKE2b-256 checksum
How to use checksums
23a4a6506f3aac23853039381cd07607fb6abd623cfda40b31b184a43fee75c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / cubicweb_signedrequest-3.3.1-py3-none-any.whl

Download URL cubicweb_signedrequest-3.3.1-py3-none-any.whl
Size 21.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db233b5eb679d01f1ab2a416fb954f6f96967c7945476712f6ec0834ee82c62c
BLAKE2b-256 checksum
How to use checksums
2fd5c7450ec40404b04014005f8887a18bfcb0b1208125a5e90fd12c82782060
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

3.3.1 This release

2 release files

3.3.0

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

1 release file

0.6.1

2 release files

0.6.0

2 release files

0.5.2

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page