This package provides a unique token generator for cone.app.
Features:
QR Code generation
JSON API for token management
Application ini file configuration
cone.tokens.config_file: Required. Path to tokens json config file.
cone.tokens.settings_node_path: Optional. Application node path to token settings node.
cone.tokens.entryfactory: Optional. Node class used as entry node factory.
JSON API
cone.tokens provides a JSON API for token management.
query_token
Query token by value. It expects a GET request.
Schema: URL/tokens/query_token
Params
value: A string containing the token value to look up.
Response
success: True or False.
token: Token data or null if token not exists.
message: On failure the error message is returned.
add_token
add_token is for generating a new token. It expects a POST request.
Schema: URL/tokens/add_token
Params
value: A string containing the token value. If empty, the token uuid gets used as value.
valid_from: A datetime in isoformat. If empty, token has no effective date.
valid_to: A datetime in isoformat. If empty, token has no expiration date.
usage_count: An integer defining how often the token can be consumed. If -1, token can be consumed unlimited times.
lock_time: Time in seconds the token is locked after consumption as integer.
Response
success: True or False.
token_uid: On success the token uid is returned.
message: On failure the error message is returned.
consume_token
consume_token is for consuming a token. It expects a GET request.
Schema: URL/tokens/<UUID>/consume_token
Params
No parametes expected.
Response
success: True or False.
consumed: On success flag whether token consumption was valid.
message: On failure the error message is returned.
update_token
edit_token is for editing a token. It expects a POST request.
Schema: URL/tokens/<UUID>/update_token
Params
value: A string containing the token value. If empty, the token uuid gets used as value. Unchanged if parameter is omitted.
valid_from: A datetime in isoformat. If empty, token has no effective date. Unchanged if parameter is omitted.
valid_to: A datetime in isoformat. If empty, token has no expiration date. Unchanged if parameter is omitted.
usage_count: An integer defining how often the token can be consumed. If -1, token can be consumed unlimited times. Unchanged if parameter is omitted.
lock_time: Time in seconds the token is locked after consumption as integer. Unchanged if parameter is omitted.
Response
success: True or False.
message: On failure the error message is returned.
delete_token
delete_token is for deleting a token. It expects a POST request.
Schema: URL/tokens/<UUID>/delete_token
Params
No parametes expected.
Response
success: True or False.
message: On failure the error message is returned.
TODO
Introduce consume permission for JSON API.
Contributors
Robert Niederreiter
Torben Baumgartner
Lena Daxenbichler
Changes
2.0.1 (2026-10-31)
Fix TokenScanner creating an additional hidden input on each click of the scan button, orphaning the previous one. Setting active to its current state does nothing now instead of failing when deactivating an inactive scanner. [rnix]
Fix adding tokens with an amount of 0, a negative or a non-numeric amount sending add_token requests endlessly. Only a positive amount adds tokens, the amount input requires a minimum of 1. [rnix]
Extend the JS tests to 100 % coverage, all modules including bundles are loaded by the tests now. [rnix]
Lint and format the JS code with biome. make check runs biome check, make format runs biome check --write (see include.mk). Behavior unchanged. [rnix]
JS tooling: Commit pnpm-lock.yaml. Upgrade @web/test-runner to 1.0 and run the JS tests headless in Chromium via Playwright. Drop the accidental install dev dependency. Pin patched versions of vulnerable transitive dependencies via pnpm.overrides. [rnix]
Sort the imports with ruff (one per line, from imports first, no sections) and format the code with ruff format (90 characters per line, single quotes). [rnix]
Add import sorting (I rules) and the formatter settings to the ruff configuration in pyproject.toml. [rnix]
2.0.0 (2026-10-24)
Render TokenSettingsForm in a card with the title of the settings node as card header, like the settings forms of cone.ugm. [rnix]
TokenForm.timerange_extractor skips an empty valid_to by value. It checked for UNSET, but yafowil.widget.datetime extracts an empty value as None, so the guard never applied. [rnix]
Modernise the code ruff flags as outdated: class X(object). Remove unused import. Behaviour unchanged. super(Class, self) is kept, see cone.app. [rnix]
Pin the ruff rule selection in pyproject.toml. Remove qa.isort domain from Makefile, make check runs ruff check only, like in the other cone.* packages. [rnix]
Pin setuptools<82.0.0 in mx.ini. pyramid 2.0.2 still imports pkg_resources, which setuptools 82 removed. [rnix]
Boostrap 5 styles.
1.1.0 (2026-02-03)
Refactor package layout to use pyproject.toml and implicit namespace packages. [rnix]
0.5 (2024-05-23)
Update Makefile. [rnix]
properties and metadata of cone.tokens.model.Tokens are instance properties now. [rnix]
Use ts.http_request instead of ts.ajax.request. [rnix]
0.4 (2024-02-12)
Adopt Settings UI changes from cone.app. [rnix]
0.3 (2023-09-28)
Tokens can be bulk deleted. [lenadax]
Tokens can be created from scanned value. [rnix]
0.2 (2023-09-27)
Actually upload package to pypi. [rnix]
0.1 (2023-09-27)
Initial work. [rnix, toalba, lenadax]
License
MIT License
Copyright (c) 2023-2025, Cone Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Metadata
Release files for cone.tokens 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cone_tokens-2.0.1.tar.gz | 31.4 kB | Without provenance | Details for cone_tokens-2.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cone_tokens-2.0.1-py3-none-any.whl | Python 3 | none | any | Details for cone_tokens-2.0.1-py3-none-any.whl |
Total release size: 74.1 kB
Release files / cone_tokens-2.0.1.tar.gz
| Download URL | cone_tokens-2.0.1.tar.gz |
|---|---|
| Size | 31.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cdce9555acad2252cdd044983b44b04bbcd3dfb463d620d093f76af13fb54645
|
|
BLAKE2b-256 checksum How to use checksums |
9d5d92adfb780707f2ba865c5b2ccd5ded8f33b7f0693f126a62233cc1ab05b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Release files / cone_tokens-2.0.1-py3-none-any.whl
| Download URL | cone_tokens-2.0.1-py3-none-any.whl |
|---|---|
| Size | 42.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e7d38c0d03c99f074bd3755f808d82e7d0aa8bd328a9ee3fae5f5f814d26193f
|
|
BLAKE2b-256 checksum How to use checksums |
0c8d063e4616fdd6e4faf143b7455066f41f63cf9a629f316d1b1cda6b29af06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Security for cone.tokens 2.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.