Commit Graph

282 Commits

Author SHA1 Message Date
Maxime Alves LIRMM 91581f9ae6 [docs][style] cli/config.py 2020-10-05 11:10:00 +02:00
Maxime Alves LIRMM 6ac0b5acd9 [doc] cli/cli.py 2020-10-05 11:08:27 +02:00
Maxime Alves LIRMM 77598b8453 [doc][style] document fonctions and fix variable names 2020-10-05 11:04:32 +02:00
Maxime Alves LIRMM ad1fed7117 [doc] add docstring to conf.py 2020-10-05 10:57:40 +02:00
Maxime Alves LIRMM 59ed5884ce [style] rename exceptions (e) as exc (pep8 style) 2020-10-05 10:55:55 +02:00
Maxime Alves LIRMM 5c4e81d5d2 [jwt_mw] Refuse DEBUG tokens in PROD mode with websockets 2020-10-05 10:55:55 +02:00
Maxime Alves LIRMM 21950aa6cd [cli] remove lib/db 2020-10-05 10:55:55 +02:00
Joël Maïzi abfaf2e1ea [acls] Fix wrong key in payload for decoded JWT. 2020-10-05 10:48:00 +02:00
Maxime Alves LIRMM 333aca9e2c [app] clean code 2020-10-05 10:09:01 +02:00
Maxime Alves LIRMM b6e511a96d [lib][domain/routes] clean code, use "yield from" 2020-10-04 18:09:23 +02:00
Maxime Alves LIRMM 429b26dec6 clean code + logs in conf 2020-10-04 17:27:02 +02:00
Maxime Alves LIRMM 74e0b3dc54 [acls] treat decorator as acl in route decorator 2020-09-30 10:59:03 +02:00
Joël Maïzi 31878d971e [routes] Add halfapi routes in production. 2020-09-30 10:31:52 +02:00
Maxime Alves LIRMM b89e03746f [acls] Allows decorators to be used as acls (fct=acl.public). 2020-09-30 10:31:25 +02:00
Maxime Alves LIRMM 79210e503e [acls] /halfapi/acls posé 2020-09-30 08:07:55 +02:00
Maxime Alves LIRMM 360f59b6ba [schema] fixes non-str keys in ORJSONResponse 2020-09-29 15:29:54 +02:00
Joël Maïzi 7d6bc2c181 [router][api] Fix GET / 2020-09-29 15:08:35 +02:00
Joël Maïzi 0a94f71dad [routing] Fix api representation (remove duplicates and fct). 2020-09-29 13:51:54 +02:00
Maxime Alves LIRMM e223c0791c [routing] fix route description when there is multiple verbs 2020-09-29 11:12:45 +02:00
Joël Maïzi d93fb23bba [0.2.1] Allows route parameters without acls. The route is deactivated. 2020-09-29 09:52:20 +02:00
Maxime Alves LIRMM 3530f53820 [routing] handle fqtn parameter in domain schema + get_api_routes (/) + /user -> /halfapi/current_user 2020-09-28 17:22:27 +02:00
Maxime Alves LIRMM@home f0d980e035 [0.2.0] Remove any reference to databases, clean clode, doc 2020-09-25 01:06:57 +02:00
Maxime Alves LIRMM@home 6a81c61649 [cli][domain] Re-implementation of list_routes, using .lib.schemas, add DOMAINSDICT constant in configuration, set a lot of default configurations 2020-09-24 19:49:16 +02:00
Maxime Alves LIRMM 2ad0b3a14b [doc][route] /schema - implementation of doc generation 2020-09-23 15:23:36 +02:00
Maxime Alves LIRMM 2610d9f089 forgot to import typ 2020-09-23 11:15:53 +02:00
Maxime Alves LIRMM 65797873da [lib][responses] include new responses in __all__ 2020-09-23 11:00:59 +02:00
Maxime Alves LIRMM d6075de2eb [lib][responses] add ORJSONResponse and update HJSONResponse 2020-09-23 10:56:32 +02:00
Maxime Alves LIRMM 39d455b682 if the route begin with a "/" we remove it 2020-09-22 16:11:32 +02:00
Maxime Alves LIRMM a78e6ebc75 [wip][routing] get_fct_name update 2020-09-22 15:46:58 +02:00
Maxime Alves LIRMM 5f7d66d4d6 [wip][routing] updated lib.domain function names 2020-09-22 14:54:45 +02:00
Maxime Alves LIRMM 38798549f6 [wip][app] adapt code to new router functions 2020-09-22 14:11:00 +02:00
Maxime Alves LIRMM ba44a01a45 [wip][routing] update routes scanner functions in lib.routes 2020-09-22 14:04:19 +02:00
Maxime Alves LIRMM c54101c3e6 [wip][routing] add routing functions in /lib/domains 2020-09-22 12:57:36 +02:00
Maxime Alves LIRMM 7337246fc1 [lib][routes] fix dict construction 2020-09-21 11:26:51 +02:00
Maxime Alves LIRMM 142ea24630 [routing] add the ACL name that returned True 2020-09-18 15:31:36 +02:00
Maxime Alves LIRMM bcc4a3e9d8 [routing] gives "keys" of the Acl row to the endpoint as kwargs 2020-09-18 11:59:44 +02:00
Maxime Alves LIRMM e8ed06a9b6 update api.sql with acl.keys 2020-09-16 14:18:37 +02:00
Joël Maïzi 31a8f68a0a [cli][domain] Remove misplaced elif in add_acls. 2020-09-16 12:21:52 +02:00
Maxime Alves LIRMM c97fa3b4c2 [acls] added "fields" value for acl table 2020-09-16 11:46:45 +02:00
Maxime Alves LIRMM 87cc59849a [acl] pass path_params arguments to next function as kwargs 2020-08-31 13:08:03 +02:00
Maxime Alves LIRMM@home 1b40b95d19 [auth] fix bug when "debug flag" = False in token 2020-08-27 18:09:48 +02:00
Maxime Alves LIRMM@home d944d45bbf [auth] added "debug flag" check and wrote relative tests close #12 2020-08-27 17:45:23 +02:00
Maxime Alves LIRMM ed54127c81 [cli] added the "config" command to the CLI, updated tests 2020-08-27 11:27:28 +02:00
Maxime Alves LIRMM 2389d67749 [conf] sets the HALFAPI_PROD environment variable 2020-08-26 14:06:53 +02:00
Maxime Alves LIRMM@home bdc131434b [conf] set SECRET in environ 2020-08-07 01:58:41 +02:00
Maxime Alves LIRMM@home 3849ba4500 [cli][domain] one more thing 2020-08-07 00:30:59 +02:00
Maxime Alves LIRMM@home 05a95d069b [cli][domain] continue to convert code ... 2020-08-07 00:28:46 +02:00
Maxime Alves LIRMM@home 63793a94e5 [cli][domain] forgot to remove argument 2020-08-07 00:26:29 +02:00
Maxime Alves LIRMM@home 51c319de20 [cli][domain] continue -> return 2020-08-07 00:24:58 +02:00
Maxime Alves LIRMM@home 976ba9b808 [cli][domain] update_db is now run with a string as argument 2020-08-07 00:19:10 +02:00
Maxime Alves LIRMM@home cdcf8d034d [cli][domain] clean debug code 2020-08-07 00:09:57 +02:00
Maxime Alves LIRMM@home b4302f50e4 [conf] moved "domains" section to .halfapi/config 2020-08-07 00:02:59 +02:00
Maxime Alves LIRMM@home c4872ec0b3 [cli][tests] Changed the routes names and wrote the tests according to current configuration 2020-08-07 00:00:33 +02:00
Maxime Alves LIRMM@home 7c4eafb40c [cli][domain] better output for list_routes 2020-08-05 21:48:29 +02:00
Maxime Alves LIRMM@home 63bd4c8db6 [domain] changed "route" command to "domain", fixed "list_routes" 2020-08-05 21:26:59 +02:00
Maxime Alves LIRMM 6a65aaeaef [cli][tests] split cli __init__ module, added check for .halfapi/config 2020-08-05 14:01:39 +02:00
Maxime Alves LIRMM 155bab1e8f [cli] split cli/__init__ into multiple files 2020-08-05 14:01:39 +02:00
Maxime Alves LIRMM 60877762c0 [cli] moved run command to its own file 2020-08-05 14:01:39 +02:00
Joël Maïzi d164ad001a [lib] Add HJSONResponse. 2020-08-05 12:58:05 +02:00
Maxime Alves LIRMM 446db4ee27 [cli] renamed init-project to init 2020-08-05 12:30:11 +02:00
Joël Maïzi 7f0e2d0a07 [cli] Print routes when running application. 2020-08-05 10:34:54 +02:00
Joël Maïzi ceaf2774bf [cli] .halfapi/domains. 2020-08-05 10:04:20 +02:00
Joël Maïzi 15a63f3713 [cli] create project directory. 2020-08-05 09:40:16 +02:00
Joël Maïzi 36f87849ca Remove gitpy2 dependency. 2020-08-05 09:24:02 +02:00
Maxime Alves LIRMM b34631cdd0 [cli][init-project][tests][wip] creation du projet halfapi 2020-08-05 09:24:02 +02:00
Joël Maïzi a3c3d7c816 [cli][WIP] Init API repo directory. 2020-08-05 09:24:02 +02:00
Joël Maïzi 14ab8bd346 [routes] Await route function in decorator. 2020-07-30 11:11:40 +02:00
Joël Maïzi b8f1d3a35e [routes] Fix func -> fct. 2020-07-30 11:06:36 +02:00
Maxime Alves LIRMM@home 4eba987eb9 [cli] simplification of `halfapi routes` 2020-07-29 22:58:25 +02:00
Maxime Alves LIRMM@home 4d02cf4acd [cli] Added init-project command and cli tests 2020-07-29 22:07:16 +02:00
Joël Maïzi 527d5c2e93 Replace dbupdate command with routes.
Allows to use --update, --list, ...
2020-07-29 16:40:25 +02:00
Maxime Alves LIRMM@home e289f6ad6b [cli] handle dbupdate without argument 2020-07-28 16:22:34 +02:00
Joël Maïzi be1e5ed722 Fix some typos. 2020-07-28 14:40:01 +02:00
Maxime Alves LIRMM@home cf9b5168b4 [conf] get -> items for list of domains, fix default conf 2020-07-28 11:50:53 +02:00
Joël Maïzi f5a210a855 Fix #9. Mise en place du chargement des domaines à partir du fichier de conf. 2020-07-28 11:04:21 +02:00
Maxime Alves LIRMM@home 9e4c3506d5 [conf] fix default config 2020-07-28 09:54:29 +02:00
Maxime Alves LIRMM@home ad3792340c cleaned trailing spaces 2020-07-28 09:46:21 +02:00
Maxime Alves LIRMM e4d0b6c17e handle "/" routes 2020-07-24 18:27:20 +02:00
Maxime Alves LIRMM 0fffab106f read correct config from halfapiconfig 2020-07-24 18:16:57 +02:00
Maxime Alves LIRMM 7f3fd74a31 read project name from .halfapiconfig 2020-07-24 18:05:58 +02:00
Maxime Alves LIRMM 98f0536a1a moved acl.py in lib 2020-07-24 17:45:41 +02:00
Maxime Alves LIRMM c68dfda96c [wip] split conf and database variables into files 2020-07-24 17:41:25 +02:00
Maxime Alves LIRMM 0282da6e3d [release][0.1.0] First HalfAPI release
Squashed commit of the following:

commit 68032dc55a07565ccd17a188407d9ac2537b62e6
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Thu Jul 23 15:40:26 2020 +0200

    [release][0.1.0] First HalfAPI release

commit a046a81114a3ae22bbc84a53f1e85217a0954dbc
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Thu Jul 23 15:26:15 2020 +0200

    [doc] màj du readme

commit ed45b3011125c071aa53df8087d28bfa1150b373
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Thu Jul 23 11:03:17 2020 +0200

    [wip] rm apidb

commit 7df4b9bacf3d26f09ea07856587505f74284cab4
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Thu Jul 23 10:58:46 2020 +0200

    [db] forgot foreign key router->domain

commit 604b9a90f405121725e4b2126d73a5a83eec398f
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Thu Jul 23 10:51:01 2020 +0200

    [wip] routes mounting fixed

commit c50a5572633d7dcc3cad48ef79c5ea1ca098284d
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Thu Jul 23 10:29:09 2020 +0200

    [wip][db][nf] http_verb, fct_name are in api.route

commit 2b5b78db2f9c280dd5eb9d8bafc9174d9afc092f
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Wed Jul 22 17:37:21 2020 +0200

    [wip] refactor du 22 juillet 2222

commit d019b7e333ab37f106895c84521cef1bfe768caa
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Wed Jul 22 14:48:51 2020 +0200

    [wip] remove "version" from app

commit 98ccd61dcf369b8c4aac817a0c8409b6fed00f50
Author: Joël Maïzi <joel.maizi@lirmm.fr>
Date:   Wed Jul 22 14:45:28 2020 +0200

    Remove api.version from database.

commit aa0d4f8dbba8b8ec878835bb58b69facff7e675e
Author: Maxime Alves LIRMM@home <maxime.alves@lirmm.fr>
Date:   Tue Jul 21 21:46:22 2020 +0200

    [db] added router as api.acl primary_key part

commit a97984e9de0e6a00bddca7dece0c715c9c16cbe1
Author: Maxime Alves LIRMM@home <maxime.alves@lirmm.fr>
Date:   Tue Jul 21 21:41:31 2020 +0200

    [wip] moved all acl treatment to acl_caller_middleware, fix route mounting, fix typo in logs

commit 3dd310e80aaf6cb32f6c4ac23c1e2a924cebfde1
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Tue Jul 21 13:10:26 2020 +0200

    [wip][nf] gestion des routes avec routers

commit c2687c4a24126fbc3e57257bf23c267b334df522
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Tue Jul 21 12:39:53 2020 +0200

    [db] ajout de la table api.router

commit 9a10f76cf7790f75f23b72e19b0a58978752565c
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Tue Jul 21 12:19:53 2020 +0200

    [db] renommage des champs d'acl

commit c4e8c26a24835559d2e9b251df0eb462fe7e667d
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Tue Jul 21 12:13:38 2020 +0200

    [wip][nf] modification du systeme de montage des routes

commit b7e8352ba1e427e9883797a44bb0f3da5edd576d
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Tue Jul 21 11:15:30 2020 +0200

    [wip][dbupdate] insertion des routes au nouveau format

commit 28947444c4c062e6ced74f9bfdef11a36ddc438b
Author: Maxime Alves LIRMM <maxime.alves@lirmm.fr>
Date:   Tue Jul 21 10:32:57 2020 +0200

    [wip][dbupdate] Suppression des routes hors domaine
2020-07-23 17:54:47 +02:00
Maxime Alves LIRMM 8930e065d2 [query] add fields list to query 2020-07-20 11:20:58 +02:00
Maxime Alves LIRMM ceb0b075de [deps] added pyods3 for organigramme..., deleted CSVresponse from libs 2020-07-16 17:54:07 +02:00
Maxime Alves LIRMM 5bc97a2a58 [lib] remove CSVresponse from parse_query funct 2020-07-16 17:43:46 +02:00
Maxime Alves LIRMM@home 1aba6b5623 [cli] add apihost and apiport options to dbupdate 2020-07-12 22:00:52 +02:00
Maxime Alves LIRMM@home 32ed99deb9 [typo] domain -> Domain in cli.py 2020-07-12 20:25:39 +02:00
Maxime Alves LIRMM@home 6c5e64c202 [typo] fix true -> True 2020-07-12 19:38:53 +02:00
Maxime Alves LIRMM 9eead5cd85 [debug] better handling of debug routes 2020-07-10 12:58:53 +02:00
Maxime Alves LIRMM 1983383071 [conf] update code according to CONFIG in config.py 2020-07-10 12:57:40 +02:00
Maxime Alves LIRMM a9b109d17b [conf] put CONFIG out of app.py, add some details to debug routes 2020-07-10 12:57:03 +02:00
Maxime Alves LIRMM 2f283db823 [acl] more checks in connected decorator 2020-07-10 12:53:25 +02:00
Maxime Alves LIRMM 1087804e8a [conf] clean configuration options 2020-07-09 12:07:39 +02:00
Maxime Alves LIRMM 7d2bb39593 [cli] fixed typo in booleans 2020-07-09 10:39:53 +02:00
Maxime Alves LIRMM 13ac878a7c [test] add default DEBUG flag for pytest, add tests for jwt_middleware 2020-07-09 10:29:17 +02:00
Joël Maïzi 55ebe0bbdd FIX non lecture des params pour halfapi run. 2020-07-09 10:29:14 +02:00
Maxime Alves LIRMM 44948be228 [conf] removed HALFORM_DSN from the env parameters, added support for the
env_file uvicorn parameter (specified by --envfile for the halfapi "run"
command), added support for default environment variables in pytest.ini
2020-07-09 10:23:13 +02:00
Maxime Alves LIRMM@home 644e5c5d3d [conf] add envfile supprt / fix the bugs related to acl_caller_middleware / fix the bugs related to responses classes 2020-07-09 08:02:44 +02:00
Maxime Alves LIRMM@home f0d5eb7d92 post-rebase fixes 2020-07-08 17:40:40 +02:00
Maxime Alves LIRMM@home b28f651cf8 [test] add testing routes for debug 2020-07-08 17:36:25 +02:00
Maxime Alves LIRMM 15cd059705 [jwt] fix jwt middleware and add some tests 2020-07-08 17:28:14 +02:00
Joël Maïzi 7b134f2dfb FIX non lecture des params pour halfapi run. 2020-07-08 17:28:14 +02:00
Maxime Alves LIRMM 24673e4408 [exceptions] add exception handlers, moved AclCallerMiddleware to lib 2020-07-08 17:19:31 +02:00
Maxime Alves LIRMM@home 3fda051180 [middleware] put AclCallerMiddleware in lib file 2020-07-08 17:12:58 +02:00
Maxime Alves LIRMM 17261f7da9 [middleware] pass domain's acl module as parameter 2020-07-07 12:59:52 +02:00
Maxime Alves LIRMM 26e0bb8716 [middleware] convert acl_middleware function to class 2020-07-07 11:20:24 +02:00
Maxime Alves LIRMM 65e0d09ff8 [middleware] removed decorator from acl_middleware 2020-07-07 11:10:38 +02:00
Maxime Alves LIRMM 4be18f8344 [middleware] add lib/acl_middleware 2020-07-07 11:02:53 +02:00
Maxime Alves LIRMM 1aa03d9077 @connected : getattr -> hasattr 2020-07-07 10:34:17 +02:00
Maxime Alves LIRMM fe8f90ccda Mount openapi.json on the right path 2020-07-06 08:39:35 +02:00
Maxime Alves LIRMM@home fb156af905 ajout de la gestion des paramètres pour halform 2020-07-06 07:53:34 +02:00
Maxime Alves LIRMM@home 37104948ca working cli dbupdate (poetry run halfapi dbupdate) 2020-07-05 14:49:13 +02:00
Maxime Alves LIRMM@home b879840491 uvicorn not optional 2020-07-04 05:15:49 +02:00
Maxime Alves LIRMM 70ee654ed9 DSN -> SECRET dans middleware 2020-07-03 21:39:59 +02:00
Joël Maïzi dd354648f8 [WIP] Pb import halfapi dans test_jwt_middleware. 2020-07-03 21:39:59 +02:00
Joël Maïzi f423d78278 Fix test. 2020-07-03 21:39:59 +02:00
Maxime Alves LIRMM@home 81613f0e6f ajout de la gestion des paramètres pour halform 2020-07-03 21:39:57 +02:00
Maxime Alves LIRMM d9a40474fc upd_cli.py 2020-07-03 21:25:35 +02:00
Maxime Alves LIRMM@home c960638a40 màj du cli 2020-07-03 11:58:26 +02:00
Maxime Alves LIRMM 6968feb59e merge avec cli_update_db 2020-07-03 11:58:13 +02:00
Maxime Alves LIRMM 364c246ef4 gestion des variables d'environement dans le cli 2020-07-03 11:49:59 +02:00
Joël Maïzi dada376016 Ajout JWTAuthenticationBackend (from https://github.com/amitripshtos/starlette-jwt/blob/master/starlette_jwt/middleware.py). 2020-07-02 15:11:11 +02:00
Maxime Alves LIRMM d1e3198441 ajout des fonctions de DB dans le cli 2020-07-02 11:40:57 +02:00
Maxime Alves LIRMM b532aac634 déplacement models dans dossier module et rajoute du dossier dans setup.py 2020-07-02 11:39:50 +02:00
Maxime Alves LIRMM d8729b1d49 ajout des modèles dans le dépot halfAPI 2020-07-02 11:30:53 +02:00
Maxime Alves LIRMM 906bdb6ded passage des ACL en module 2020-07-02 10:58:54 +02:00
Maxime Alves LIRMM 6b999cdb94 sortir connected de baseACL 2020-07-01 12:05:52 +02:00
Maxime Alves LIRMM e60a7ae50e typo dans le nom de fonction 2020-07-01 10:52:10 +02:00
Maxime Alves LIRMM a719b4a31a ajout du decorateur "connected" 2020-07-01 10:15:42 +02:00
Maxime Alves LIRMM bb1e2503ae removed pycache and added gitignore 2020-07-01 09:43:02 +02:00
Maxime Alves LIRMM 110b8b0969 commit initial 2020-06-30 17:50:35 +02:00