bc556854ac
Tests are passing, but we loose the by-domain configuration (#19) Squashed commit of the following: commit d75fafcb9a043ac2540b2ac135704721b002d3c0 Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr> Date: Thu Sep 2 14:40:05 2021 +0200 fix #21 commit 38c59e4ea3b40bd230f2add2bb0e05772913c097 Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr> Date: Thu Sep 2 01:13:51 2021 +0200 [deps] starlette 0.15 (breaks tests) FAILED tests/test_debug_routes.py::test_current_user - AttributeError: 'DomainMiddleware' object has no attribute 'call_next' FAILED tests/test_debug_routes.py::test_log - AttributeError: 'DomainMiddleware' object has no attribute 'call_next' FAILED tests/test_debug_routes.py::test_error - AttributeError: 'DomainMiddleware' object has no attribute 'call_next' FAILED tests/test_dummy_project_router.py::test_get_route - AttributeError: 'DomainMiddleware' object has no attribute 'call_next' FAILED tests/test_dummy_project_router.py::test_delete_route - AttributeError: 'DomainMiddleware' object has no attribute 'call_next' FAILED tests/test_lib_schemas.py::test_get_api_routes - AttributeError: 'DomainMiddleware' object has no attribute 'call_next' FAILED tests/test_lib_schemas.py::test_get_schema_route - AttributeError: 'DomainMiddleware' object has no attribute 'call_next' FAILED tests/test_lib_schemas.py::test_get_api_dummy_domain_routes - AttributeError: 'DomainMiddleware' object has no attribute 'call_next' |
||
---|---|---|
conf | ||
halfapi | ||
scripts | ||
tests | ||
.gitignore | ||
.gitlab-ci.yml | ||
CHANGELOG.md | ||
LICENSE.txt | ||
MANIFEST.in | ||
Pipfile | ||
Pipfile.lock | ||
README.md | ||
pyproject.toml | ||
pytest.ini | ||
requirements.txt | ||
setup.cfg | ||
setup.py |
README.md
HalfAPI
Base tools to develop comlex API with rights management.
Dependencies
- python3
- python3-pip
- libgit2-dev
- starlette
- PyJWT
- click
- uvicorn
- orjson
- pyyaml
Configuration
Configure HalfAPI in the file : .halfapi/config .
It's an ini file that contains at least two sections, project and domains.
### 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.
loglevel : The log level (info, debug, critical, ...)
Domains
The name of the options should be the name of the domains' module, the value is the submodule which contains the routers.
Example :
dummy_domain = .routers
Usage
Develop an HalfAPI domain by following the examples located in tests/dummy_domain . An HalfAPI domain should be an importable python module that is available in the python path.
Run the project by using the halfapi run
command.
API Testing
@TODO
Example
Check out the sample project that helps you to build your own domain.
Development
@TODO