Development #29240
Avoir un écran pour gérer le paramétrage de debug
0%
Description
Idée sur #29239:
Quand à DEBUG=True, je serai assez pour avoir un setting DEBUG_IP="<ip1> <ip2>", idem géré par hobo (je clique sur activate debug et ça ajoute mon ip cliente dans le truc), et avoir un middleware qui quand il voit l'IP pose DEBUG=True pour la durée de la requête.
Via #28930 ce serait gérable via un écran dans hobo :
[ Activer l'affichage des traces pour mon IP ]
IPs voyant les traces actuellement : 123.34.45.56 (La Ciotat, France), ...
Il faudrait peut-être expirer cette donnée régulièrement (genre ne pas laisser les traces activées plus de 8h).
Fichiers
Demandes liées
Révisions associées
test_schemas: adapt to newly exposed field of Authentic (#29240)
urls: coding style (#29240)
franceconnect: remove dead import (#29240)
environment: rename get_setting_variable to get_variable (#29240)
environment: factorize get_setting_variable from franceconnect (#29240)
tests: coding style (#29240)
environment: add a setter for Variable.json (#29240)
add debug application (#29240)
reset MUST_NOTIFY on request start (#29240)
It breaks test tests_hobo/test_manager.py:test_unlogged_access which do
not expect any DB access but the flag seems to still be True from a
previous test.
Historique
Mis à jour par Benjamin Dauvergne il y a environ 5 ans
- Sujet changé de pour avoir activer les écrans de trace pour son IP depuis hobo à Avoir un écran pour gérer le paramétrage de debug
Mis à jour par Benjamin Dauvergne il y a environ 5 ans
- Fichier 0002-urls-coding-style-29240.patch 0002-urls-coding-style-29240.patch ajouté
- Fichier 0001-environment-coding-style-29240.patch 0001-environment-coding-style-29240.patch ajouté
- Fichier 0003-franceconnect-remove-dead-import-29240.patch 0003-franceconnect-remove-dead-import-29240.patch ajouté
- Fichier 0005-environment-factorize-get_setting_variable-from-fran.patch 0005-environment-factorize-get_setting_variable-from-fran.patch ajouté
- Fichier 0008-add-debug-application-29240.patch 0008-add-debug-application-29240.patch ajouté
- Fichier 0006-tests-coding-style-29240.patch 0006-tests-coding-style-29240.patch ajouté
- Fichier 0004-environment-rename-get_setting_variable-to-get_varia.patch 0004-environment-rename-get_setting_variable-to-get_varia.patch ajouté
- Fichier 0007-environment-add-a-setter-for-Variable.json-29240.patch 0007-environment-add-a-setter-for-Variable.json-29240.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Mis à jour par Benjamin Dauvergne il y a environ 5 ans
- Fichier 0002-urls-coding-style-29240.patch 0002-urls-coding-style-29240.patch ajouté
- Fichier 0001-environment-coding-style-29240.patch 0001-environment-coding-style-29240.patch ajouté
- Fichier 0003-franceconnect-remove-dead-import-29240.patch 0003-franceconnect-remove-dead-import-29240.patch ajouté
- Fichier 0005-environment-factorize-get_setting_variable-from-fran.patch 0005-environment-factorize-get_setting_variable-from-fran.patch ajouté
- Fichier 0008-add-debug-application-29240.patch 0008-add-debug-application-29240.patch ajouté
- Fichier 0009-reset-MUST_NOTIFY-on-request-start-29240.patch 0009-reset-MUST_NOTIFY-on-request-start-29240.patch ajouté
- Fichier 0006-tests-coding-style-29240.patch 0006-tests-coding-style-29240.patch ajouté
- Fichier 0004-environment-rename-get_setting_variable-to-get_varia.patch 0004-environment-rename-get_setting_variable-to-get_varia.patch ajouté
- Fichier 0007-environment-add-a-setter-for-Variable.json-29240.patch 0007-environment-add-a-setter-for-Variable.json-29240.patch ajouté
Remplacé type(y) in (int, six.string_types) par un isinstance(y, six.integer_types + six.string_types).
Corrigé problème avec tls.MUST_NOTIFY sur un test sans accès DB.
Mis à jour par Frédéric Péters il y a environ 5 ans
Du bout "je clique sur activate debug et ça ajoute mon ip cliente dans le truc" de la description, je me dis que ça peut être bien d'avoir ainsi l'ajout de son IP, sans avoir à la chercher. (peut-être que ça peut juste être un truc d'affichage, sur la page "votre adresse IP est : ").
Mis à jour par Benjamin Dauvergne il y a environ 5 ans
Mis à jour par Benjamin Dauvergne il y a environ 5 ans
- Fichier 0002-urls-coding-style-29240.patch 0002-urls-coding-style-29240.patch ajouté
- Fichier 0001-environment-coding-style-29240.patch 0001-environment-coding-style-29240.patch ajouté
- Fichier 0003-franceconnect-remove-dead-import-29240.patch 0003-franceconnect-remove-dead-import-29240.patch ajouté
- Fichier 0005-environment-factorize-get_setting_variable-from-fran.patch 0005-environment-factorize-get_setting_variable-from-fran.patch ajouté
- Fichier 0008-add-debug-application-29240.patch 0008-add-debug-application-29240.patch ajouté
- Fichier 0009-reset-MUST_NOTIFY-on-request-start-29240.patch 0009-reset-MUST_NOTIFY-on-request-start-29240.patch ajouté
- Fichier 0006-tests-coding-style-29240.patch 0006-tests-coding-style-29240.patch ajouté
- Fichier 0004-environment-rename-get_setting_variable-to-get_varia.patch 0004-environment-rename-get_setting_variable-to-get_varia.patch ajouté
- Fichier 0007-environment-add-a-setter-for-Variable.json-29240.patch 0007-environment-add-a-setter-for-Variable.json-29240.patch ajouté
Avec bouton pour ajouter/retirer IP du client.
Mis à jour par Benjamin Dauvergne il y a environ 5 ans
- Fichier 0002-urls-coding-style-29240.patch 0002-urls-coding-style-29240.patch ajouté
- Fichier 0001-environment-coding-style-29240.patch 0001-environment-coding-style-29240.patch ajouté
- Fichier 0003-franceconnect-remove-dead-import-29240.patch 0003-franceconnect-remove-dead-import-29240.patch ajouté
- Fichier 0005-environment-factorize-get_setting_variable-from-fran.patch 0005-environment-factorize-get_setting_variable-from-fran.patch ajouté
- Fichier 0008-add-debug-application-29240.patch 0008-add-debug-application-29240.patch ajouté
- Fichier 0009-reset-MUST_NOTIFY-on-request-start-29240.patch 0009-reset-MUST_NOTIFY-on-request-start-29240.patch ajouté
- Fichier 0006-tests-coding-style-29240.patch 0006-tests-coding-style-29240.patch ajouté
- Fichier 0004-environment-rename-get_setting_variable-to-get_varia.patch 0004-environment-rename-get_setting_variable-to-get_varia.patch ajouté
- Fichier 0007-environment-add-a-setter-for-Variable.json-29240.patch 0007-environment-add-a-setter-for-Variable.json-29240.patch ajouté
Rebasé.
Mis à jour par Benjamin Dauvergne il y a environ 5 ans
- Lié à Development #29149: Revoir le fonctionnement des logs de debug ajouté
Mis à jour par Benjamin Dauvergne il y a presque 5 ans
- Fichier 0002-urls-coding-style-29240.patch 0002-urls-coding-style-29240.patch ajouté
- Fichier 0001-environment-coding-style-29240.patch 0001-environment-coding-style-29240.patch ajouté
- Fichier 0003-franceconnect-remove-dead-import-29240.patch 0003-franceconnect-remove-dead-import-29240.patch ajouté
- Fichier 0005-environment-factorize-get_setting_variable-from-fran.patch 0005-environment-factorize-get_setting_variable-from-fran.patch ajouté
- Fichier 0008-add-debug-application-29240.patch 0008-add-debug-application-29240.patch ajouté
- Fichier 0009-reset-MUST_NOTIFY-on-request-start-29240.patch 0009-reset-MUST_NOTIFY-on-request-start-29240.patch ajouté
- Fichier 0006-tests-coding-style-29240.patch 0006-tests-coding-style-29240.patch ajouté
- Fichier 0004-environment-rename-get_setting_variable-to-get_varia.patch 0004-environment-rename-get_setting_variable-to-get_varia.patch ajouté
- Fichier 0007-environment-add-a-setter-for-Variable.json-29240.patch 0007-environment-add-a-setter-for-Variable.json-29240.patch ajouté
Branche à jour.
Mis à jour par Benjamin Dauvergne il y a presque 5 ans
Souci nouveau à cause des tests sur cook, une des mes modifs non essentielles :
# 0001-environment-coding-style-29240.patch
def as_dict(self):
as_dict = dict([(x, y) for (x, y) in self.__dict__.items()
- if type(y) in (int, str, unicode)])-
+ if isinstance(y, six.integer_types + six.string_types)])
as_dict['base_url'] = self.get_base_url_path()
as_dict['service-id'] = self.Extra.service_id
as_dict['service-label'] = force_text(self.Extra.service_label)
fait que des attributs non exposés dans le hobo.json des services le sont maintenant :
> assert dump == expected_dump E assert '{\n "prof...89"\n }\n}' == '{\n "profi...89"\n }\n}' E Skipping 5532 identical leading characters in diff, use -v to show E - "use_as_idp_for_self": true, E - "variables": {} E ? --- E + "variables": {} E }, E {... E E ...Full output truncated (66 lines hidden), use '-vv' to show
Ici "use_as_idp_for_self" qui est booléen et désormais pris en compte par six.integer_types (les booléens sont des entiers en python pour des raisons historiques), je défais ça ?
Mis à jour par Benjamin Dauvergne il y a presque 5 ans
- Fichier 0007-tests-coding-style-29240.patch 0007-tests-coding-style-29240.patch ajouté
- Fichier 0004-franceconnect-remove-dead-import-29240.patch 0004-franceconnect-remove-dead-import-29240.patch ajouté
- Fichier 0003-urls-coding-style-29240.patch 0003-urls-coding-style-29240.patch ajouté
- Fichier 0002-test_schemas-adapt-to-newly-exposed-field-of-Authent.patch 0002-test_schemas-adapt-to-newly-exposed-field-of-Authent.patch ajouté
- Fichier 0009-add-debug-application-29240.patch 0009-add-debug-application-29240.patch ajouté
- Fichier 0001-environment-coding-style-29240.patch 0001-environment-coding-style-29240.patch ajouté
- Fichier 0005-environment-rename-get_setting_variable-to-get_varia.patch 0005-environment-rename-get_setting_variable-to-get_varia.patch ajouté
- Fichier 0008-environment-add-a-setter-for-Variable.json-29240.patch 0008-environment-add-a-setter-for-Variable.json-29240.patch ajouté
- Fichier 0010-reset-MUST_NOTIFY-on-request-start-29240.patch 0010-reset-MUST_NOTIFY-on-request-start-29240.patch ajouté
- Fichier 0006-environment-factorize-get_setting_variable-from-fran.patch 0006-environment-factorize-get_setting_variable-from-fran.patch ajouté
Mis à jour par Nicolas Roche il y a presque 5 ans
Juste pour commenter le point ci-dessus avec les tests sur cook :
le test ne fait rien de plus que d'avertir quand l'environnement (hobo.json) évolue.
S'il évolue et que c'est souhaité, alors le patch 2 fait l'affaire :
- soit modifier le json attendu à la main
- soit le régénérer comme indiqué dans tests_schema/test_cook.py::test_cook_example
Je répond à côté car je n'ai pas d'avis sur le fait d'avoir une nouvelle entrée "use_as_idp_for_self".
Mis à jour par Benjamin Dauvergne il y a presque 5 ans
Nicolas Roche a écrit :
Je répond à côté car je n'ai pas d'avis sur le fait d'avoir une nouvelle entrée "use_as_idp_for_self".
Je pense que c'est juste la bonne chose à faire, hobo.json doit exposer tout ce qui est stocké dans les objets de service.
Mis à jour par Nicolas Roche il y a presque 5 ans
Voici 2 tests pour améliorer la couverture.
Le second montre un petit problème dans l'IHM avec les IP non valables.
/tests/test_manager.py::test_debug_home() :
# toggle-current-ip button page = logged_app.get('/debug/') page.form['debug_ips'] = IPS page = page.form.submit(name='toggle-current-ip').follow() # click assert get_setting_variable('INTERNAL_IPS').json == IP_LIST + ['127.0.0.1'] page = page.form.submit(name='toggle-current-ip').follow() # click again assert get_setting_variable('INTERNAL_IPS').json == IP_LIST # wrong ips are not returned as a list page = logged_app.get('/debug/') page.form['debug_ips'] = 'not_an_IP' page = page.form.submit() assert 'Enter a valid IPv4 or IPv6 address' in page.content assert page.form['debug_ips']._value == 'not_an_IP' # get 'n o t _ a n _ I P'
Mis à jour par Benjamin Dauvergne il y a plus de 4 ans
- Fichier 0007-tests-coding-style-29240.patch 0007-tests-coding-style-29240.patch ajouté
- Fichier 0004-franceconnect-remove-dead-import-29240.patch 0004-franceconnect-remove-dead-import-29240.patch ajouté
- Fichier 0003-urls-coding-style-29240.patch 0003-urls-coding-style-29240.patch ajouté
- Fichier 0002-test_schemas-adapt-to-newly-exposed-field-of-Authent.patch 0002-test_schemas-adapt-to-newly-exposed-field-of-Authent.patch ajouté
- Fichier 0009-add-debug-application-29240.patch 0009-add-debug-application-29240.patch ajouté
- Fichier 0001-environment-coding-style-29240.patch 0001-environment-coding-style-29240.patch ajouté
- Fichier 0005-environment-rename-get_setting_variable-to-get_varia.patch 0005-environment-rename-get_setting_variable-to-get_varia.patch ajouté
- Fichier 0008-environment-add-a-setter-for-Variable.json-29240.patch 0008-environment-add-a-setter-for-Variable.json-29240.patch ajouté
- Fichier 0010-reset-MUST_NOTIFY-on-request-start-29240.patch 0010-reset-MUST_NOTIFY-on-request-start-29240.patch ajouté
- Fichier 0006-environment-factorize-get_setting_variable-from-fran.patch 0006-environment-factorize-get_setting_variable-from-fran.patch ajouté
Remarques intégrées, branche rebasée.
Mis à jour par Nicolas Roche il y a plus de 4 ans
- Statut changé de Solution proposée à Solution validée
Pour moi l'IHM fait le job, pas de problème.
Mis à jour par Benjamin Dauvergne il y a plus de 4 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit 661a526109af425330f26224f9075e4df797b92d Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Fri Mar 8 15:52:59 2019 +0100 reset MUST_NOTIFY on request start (#29240) It breaks test tests_hobo/test_manager.py:test_unlogged_access which do not expect any DB access but the flag seems to still be True from a previous test. commit b36e054cb0269d64e672c61c797197234722a0a0 Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Fri Mar 8 02:41:26 2019 +0100 add debug application (#29240) commit 09588c0de696fea068b0f9c21081948382c6b319 Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Fri Mar 8 02:58:04 2019 +0100 environment: add a setter for Variable.json (#29240) commit 8ced89e097824b2b37959e145d64ecf466dadf2d Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Fri Mar 8 02:51:39 2019 +0100 tests: coding style (#29240) commit 9635e4c8f514737103a51591ef921a8e81db61ee Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Fri Mar 8 02:16:13 2019 +0100 environment: factorize get_setting_variable from franceconnect (#29240) commit 12ea45988896b56971d36a5f89244056d08f6a0a Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Fri Mar 8 02:08:44 2019 +0100 environment: rename get_setting_variable to get_variable (#29240) commit 96d6eb291a536cc6678d563ae8b372b122cd5b0a Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Fri Mar 8 01:53:15 2019 +0100 franceconnect: remove dead import (#29240) commit 31dfd4e85303ba2169a0b7c5c8c77001ed3e117e Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Fri Mar 8 02:39:44 2019 +0100 urls: coding style (#29240) commit d6661ec386cc222a9b28ce78934f107e3da270ca Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Fri Jun 7 22:20:02 2019 +0200 test_schemas: adapt to newly exposed field of Authentic (#29240) commit 9bf094388ac18baa61f96a1da56985265efa0ffb Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Fri Mar 8 01:58:41 2019 +0100 environment: coding style (#29240)
Mis à jour par Frédéric Péters il y a plus de 4 ans
Pour moi l'IHM fait le job, pas de problème.
Par contre, le taf attendu, logguer, sur l'environnement de dev je ne vois rien, et c'est normal ce ticket n'avait aucun sens à être poussé avant #29240.
Mis à jour par Benjamin Dauvergne il y a plus de 4 ans
Mis à jour par Frédéric Péters il y a plus de 4 ans
- Statut changé de Résolu (à déployer) à Solution déployée
environment: coding style (#29240)