Package: cone.tokens
This package provides a unique token generator forcone.app.Features:QR Code generationJSON API for token managementApplication ini file configurationcone.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 APIcone.tokensprovides a JSON API for token management.query_tokenQuery token by value. It expects aGETrequest.Schema: URL/tokens/query_tokenParamsvalue: A string containing the token value to look up.Responsesuccess: True or False.token: Token data or null if token not exists.message: On failure the error message is returned.add_tokenadd_tokenis for generating a new token. It expects aPOSTrequest.Schema: URL/tokens/add_tokenParamsvalue: 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.Responsesuccess: True or False.token_uid: On success the token uid is returned.message: On failure the error message is returned.consume_tokenconsume_tokenis for consuming a token. It expects aGETrequest.Schema: URL/tokens/<UUID>/consume_tokenParamsNo parametes expected.Responsesuccess: True or False.consumed: On success flag whether token consumption was valid.message: On failure the error message is returned.update_tokenedit_tokenis for editing a token. It expects aPOSTrequest.Schema: URL/tokens/<UUID>/update_tokenParamsvalue: 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.Responsesuccess: True or False.message: On failure the error message is returned.delete_tokendelete_tokenis for deleting a token. It expects aPOSTrequest.Schema: URL/tokens/<UUID>/delete_tokenParamsNo parametes expected.Responsesuccess: True or False.message: On failure the error message is returned.TODOIntroduceconsumepermission for JSON API.ContributorsRobert NiederreiterTorben BaumgartnerLena DaxenbichlerChanges0.4 (2024-02-12)Adopt Settings UI changes fromcone.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]LicenseMIT LicenseCopyright (c) 2023-2024, Cone ContributorsPermission 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.