Commit Graph

377 Commits

Author SHA1 Message Date
Maxime Alves LIRMM 51877b271e [conf] Read "HALFAPI_SECRET" file content if the option is not specified. Do not use HALFAPI_SECRET to store the *secret* value 2021-09-03 16:22:55 +02:00
Maxime Alves LIRMM 061c966072 [lib.domain] fix mounting domains with environment variable 2021-09-03 14:56:18 +02:00
Maxime Alves LIRMM cdd2214043 [conf] halfapi becomes configurable only by environment variables (for one domain) 2021-09-03 13:17:06 +02:00
Maxime Alves LIRMM 0470f9fa89 [0.5.9] release
Squashed commit of the following:

commit 7fe3e22f5e4108b5eb149abf8d608334debc49ca
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Thu Sep 2 16:59:52 2021 +0200

    [0.5.9] release

commit c36c0fcc982388a5acf2f9f937fa8ab54a18f3de
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Thu Sep 2 16:53:13 2021 +0200

    [conf] fix #19 et ajout du test (test_dummy_project_router/test_get_config)

    configuration du domaine accessible depuis :

    l'attribut config de l'argument "halfapi" pour les fonctions
    request.scope['config'] pour les fonctions async

commit cc235eee8c6f8f5d3606dda0f88156697eac296e
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Thu Sep 2 14:59:17 2021 +0200

    [tests] don't import click two times

commit fa418478c76205bb407e536737d8e389b4bf391c
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Thu Sep 2 14:57:06 2021 +0200

    [clean] remove unused variables, remove [] as default value in fct, raise from exc
2021-09-02 17:01:36 +02:00
Maxime Alves LIRMM 74b79120ba [deps] starlette 0.16 2021-09-02 14:48:48 +02:00
Maxime Alves LIRMM bc556854ac Fix #21 by simplifying DomainMiddleware
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'
2021-09-02 14:45:06 +02:00
Maxime Alves LIRMM 865a4dffd1 [ci] add continuous integration
Squashed commit of the following:

commit e7b303310f3726c4ec5b36db668f7a5aaee29287
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Thu Sep 2 10:35:16 2021 +0200

    fix gitlab-ci run

commit 360c03371f1b088ce883646799f829a50f7a04a8
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Thu Sep 2 08:26:51 2021 +0000

    Update .gitlab-ci.yml file
2021-09-02 10:38:19 +02:00
Maxime Alves LIRMM 5e2ccceedf [deps] "build" (python -m build --sdist; python -m build --wheel) 2021-09-02 10:20:03 +02:00
Maxime Alves LIRMM 844f6a8f14 [packaging] 0.5.8 update to PyPi 2021-09-01 15:59:47 +02:00
Maxime Alves LIRMM 43b7fe21df [license] change author 2021-09-01 15:26:56 +02:00
Maxime Alves LIRMM c9ba99c1df [readme] fix formatting 2021-09-01 15:24:53 +02:00
Maxime Alves LIRMM 18a1f71d99 [package] set source url to github 2021-09-01 15:24:21 +02:00
Maxime Alves LIRMM c2cea298bf [readme] update with instructions 2021-09-01 15:19:51 +02:00
Maxime Alves LIRMM 387fc01f44 [0.5.7] release, real fix for halfapi/acl route bug 2021-07-06 11:30:30 +02:00
Maxime Alves LIRMM c2054e9aa9 [lib.domain.domain_acls] fix ROUTES constant using read_router function 2021-07-06 11:28:23 +02:00
Maxime Alves LIRMM@home 0e669b81b0 [domain] do not raise exception when the router is missing the ROUTES variable in halfapi/acls route 2021-06-30 15:13:57 +02:00
Maxime Alves LIRMM@home b45c0bf746 [deps] Avoid starlette update to 0.15, stay in latest 0.14 2021-06-28 12:09:56 +02:00
Maxime Alves LIRMM@home c920531610 [release] 0.5.6 2021-06-25 12:21:40 +02:00
Maxime Alves LIRMM@home bb50fae186 [lib.acl] fixes #20 2021-06-25 12:21:10 +02:00
Maxime Alves LIRMM 0c3aeb532f [0.5.5] retablissement de la configuration par domaine 2021-06-23 15:04:37 +02:00
Maxime Alves LIRMM 8a9f93b9e0 [conf] lecture des sections du nom des domaines activés et ajout dans request.scope['config']['config'] 2021-06-23 15:03:00 +02:00
Maxime Alves LIRMM 9381e1582e [0.5.4] 2021-06-18 17:11:34 +02:00
Maxime Alves LIRMM a539212faf [lib.acl] fix args_check for get parameters 2021-06-18 12:08:51 +02:00
Maxime Alves LIRMM a14285475e [lib.domain] check if an HTTPException is raised, else raise an HTTPException(500) 2021-06-18 10:39:05 +02:00
Maxime Alves LIRMM@home 15d69efd60 [tests] /halfapi/schema 2021-06-17 19:14:39 +02:00
Maxime Alves LIRMM@home 2819483070 [doc] docstring for api_routes 2021-06-17 19:02:11 +02:00
Maxime Alves LIRMM@home 81f6cf8b39 [0.5.3]
Squashed commit of the following:

commit ac935db6d6
Author: Maxime Alves LIRMM@home <maxime.alves@lirmm.fr>
Date:   Thu Jun 17 18:52:49 2021 +0200

    [tests] remove dummy-domain from dependencies

commit 4d50363c9b
Author: Maxime Alves LIRMM@home <maxime.alves@lirmm.fr>
Date:   Thu Jun 17 18:52:18 2021 +0200

    [tests] update tests for 0.5.3

commit 6181592692
Author: Maxime Alves LIRMM@home <maxime.alves@lirmm.fr>
Date:   Thu Jun 17 18:17:51 2021 +0200

    [lib.*] Refactor libs

commit ed7485a8a1
Author: Maxime Alves LIRMM@home <maxime.alves@lirmm.fr>
Date:   Thu Jun 17 18:15:10 2021 +0200

    [app] Use HalfAPI class to be able to use custom configuration
    à

commit fa1ca6bf9d
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Wed Jun 16 15:34:25 2021 +0200

    [wip] tests dummy_domain

commit 86e8dd3465
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Tue Jun 15 18:12:13 2021 +0200

    [0.5.3] ajout de la config actuelle dans les arguments des routes

commit aa7ec62c7a
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Tue Jun 15 11:16:23 2021 +0200

    [lib.jwtMw] verify signature even if halfapi is in DEBUG mode

commit e208728d7e
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Tue Jun 15 10:49:46 2021 +0200

    [lib.acl] args_check doesn't check required/optional arguments if "args" is not specified in request, if the target function is not async

commit aa4c309778
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Tue Jun 15 09:45:37 2021 +0200

    [lib.domain] SUBROUTER can be a path parameter if including ":"

commit 138420461d
Author: Maxime Alves LIRMM@home <maxime.alves@lirmm.fr>
Date:   Tue Jun 15 07:24:32 2021 +0200

    [gitignore] *.swp

commit 0c1e2849ba
Author: Maxime Alves LIRMM@home <maxime.alves@lirmm.fr>
Date:   Tue Jun 15 07:24:14 2021 +0200

    [tests] test get route with dummy projects

commit 7227e2d7f1
Author: Maxime Alves LIRMM@home <maxime.alves@lirmm.fr>
Date:   Mon Jun 14 17:18:47 2021 +0200

    [lib.domain] handle modules without ROUTES attribute

commit 78c75cd60e
Author: Maxime Alves LIRMM@home <maxime.alves@lirmm.fr>
Date:   Mon Jun 14 16:34:58 2021 +0200

    [tests] add dummy_project_router tests for path-based routers (without ROUTES variable)
2021-06-17 18:53:23 +02:00
Maxime Alves LIRMM eb68d06ac0 [0.5.2] /halfapi/acls crash if acl attribute does not exist on a route 2021-06-07 19:40:50 +02:00
Maxime Alves LIRMM 3fb6fb4ded [0.5.1] Reactivation de la route "/halfapi/acls" (bug lors de multiples de domaines) 2021-06-07 19:30:00 +02:00
Maxime Alves LIRMM e5a278c84c [release] 0.5.0 2021-06-07 16:44:43 +02:00
Maxime Alves LIRMM 904783b134 [deps] 2021-05-28 22:30:39 +02:00
Maxime Alves LIRMM e0b06f51d5 [acl decorator] when check flag is activated, returns a 200 status code with empty body if no acl has passed
check function should always return 200. If we don't do this, we can't see the difference between a "refused" call and a "refused" check
2021-05-28 22:23:20 +02:00
Maxime Alves LIRMM 8ca94ab7ed [acl decorator] possibility to decorate functions with "@route_acl_decorator" 2021-05-28 22:22:05 +02:00
Maxime Alves LIRMM e4e04c6ac1 [JWTmw] add CheckUser to be used when using the "check" flag. Add "user_id" query param to check access of a specific user to a route 2021-05-28 22:18:58 +02:00
Maxime Alves LIRMM 0e5a8ede9d [test] test of lib.acl 2021-05-28 22:13:48 +02:00
Maxime Alves LIRMM a0c41d7d78 [tests] jwt, use of TestClient instead of requests 2021-05-28 22:12:53 +02:00
Maxime Alves LIRMM a82fd6def0 [acl] ajout de l'acl private (test purposes) 2021-05-28 22:02:35 +02:00
Maxime Alves LIRMM 9a9bc16bbc [tests] déplacement des fixtures jwt dans conftest 2021-05-28 21:54:45 +02:00
Maxime Alves LIRMM ea1f54cb82 [tests] JWTmw - flags check et user_id 2021-05-28 12:41:23 +02:00
Maxime Alves LIRMM 3c6713b5e2 [tests] add JWTMw test for query without tokens (must return Unauth user) 2021-05-28 12:27:35 +02:00
Maxime Alves LIRMM c7e29e399b [tests] use "isinstance" instead of "type" 2021-05-28 12:26:51 +02:00
Maxime Alves LIRMM 89a5f3aa52 [tests] nettoyage test jwt 2021-05-28 12:26:27 +02:00
Maxime Alves LIRMM@home 933f456c86 Montage des routes uniquement si les variables DOMAINDICt et SECREt sont présentes 2021-04-27 08:26:48 +02:00
Maxime Alves LIRMM@home 5276833afe [lib/domain] ajout du dossier courant dans le path pour import de librairies dans le dossier du projet 2021-04-24 23:54:18 +02:00
Maxime Alves LIRMM@home 10b1960f4e nettoyage / commentaires / renommage de variables - JWTUser.id deviens JWTUser.identity 2021-04-24 08:56:18 +02:00
Maxime Alves LIRMM@home a2fb70f84b DomainMiddleware ne vérifie plus les domaines non concernés par la première partie du path (optimisation vitesse) 2021-04-23 12:51:51 +02:00
Maxime Alves LIRMM@home 795ca3dcc0 [decorator] ajout du décorateur "args_check" pour automatiser la vérification des args requis/optionels 2021-04-22 23:36:34 +02:00
Maxime Alves LIRMM@home 5b67d938e2 Ajout du timing middleware pour le mode debug 2021-04-22 22:33:02 +02:00
Maxime Alves LIRMM@home 89ec439d3e ajout du header x-args-required et x-args-optional 2021-04-22 22:06:27 +02:00
Maxime Alves LIRMM@home b5ef4a12d1 Ajout du header http "x-acl" qui renseigne l'acl qui a passé dans une requête 2021-04-22 22:04:21 +02:00