From 69129fd7af5ba11355d958d50eb8dcdfd1610544 Mon Sep 17 00:00:00 2001 From: Maxime Alves LIRMM Date: Fri, 3 Feb 2023 12:43:30 +0100 Subject: [PATCH] [doc][release] 0.7.0 --- CHANGELOG.md | 5 +++++ README.md | 42 ++++++++++++++++++++++++++++++++---------- halfapi/__init__.py | 2 +- 3 files changed, 38 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9f00e2..97b2753 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # HalfAPI +## 0.7.0 + +- Uses the "Authorization" cookie to read authentication token additionnaly to the "Authorization" header +- CLI : allows to run a single domain using the "halfapi domain --run domain_name" command + ## 0.6.23 Dependency update version diff --git a/README.md b/README.md index 3da8b80..4e131c3 100644 --- a/README.md +++ b/README.md @@ -23,17 +23,15 @@ to reference [HalfORM](https://github.com/collorg/halfORM), a project written by Configure HalfAPI in the file : .halfapi/config . -It's an **ini** file that contains at least two sections, project and domains. +It's a **toml** file that contains at least two sections, project and domains. + +https://toml.io/en/ ### Project The main configuration options without which HalfAPI cannot be run. -**name** : Project's name - -**halfapi_version** : The HalfAPI version on which you work - **secret** : The file containing the secret to decode the user's tokens. **port** : The port for the test server. @@ -43,12 +41,28 @@ The main configuration options without which HalfAPI cannot be run. ### Domains -The name of the options should be the name of the domains' module, the value is the -submodule which contains the routers. +Specify the domains configurations in the following form : -Example : +``` +[domains.DOMAIN_NAME] +name = "DOMAIN_NAME" +enabled = true +prefix = "/prefix" +module = "domain_name.path.to.api.root" +port = 1002 +``` -dummy_domain = .routers +Specific configuration can be done under the "config" section : + +``` +[domains.DOMAIN_NAME.config] +boolean_option = false +string_value = "String" +answer = 42 +listylist = ["hello", "world"] +``` + +And can be accessed through the app's "config" dictionnary. ## Usage @@ -62,9 +76,17 @@ Run the project by using the `halfapi run` command. You can try the dummy_domain with the following command. ``` -python -m halfapi routes --export --noheader dummy_domain.routers | python -m halfapi run - +PYTHONPATH=$PWD/tests python -m halfapi domain dummy_domain ``` +### CLI documentation + +Use the CLI help. + +``` +python -m halfapi --help +python -m halfapi domain --help +``` ## API Testing diff --git a/halfapi/__init__.py b/halfapi/__init__.py index ecda646..167382d 100644 --- a/halfapi/__init__.py +++ b/halfapi/__init__.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -__version__ = '0.6.23' +__version__ = '0.7.0' def version(): return f'HalfAPI version:{__version__}'