PnX-SI / UsersHub-authentification-module

Module Flask d'authentification de UsersHub
GNU General Public License v3.0
5 stars 12 forks source link

Fix/cookie path #70

Closed mvergez closed 1 year ago

mvergez commented 1 year ago

Ajout d'un paramètre Path aux cookies créés par ce module.

Pour cela :

closes https://github.com/PnX-SI/UsersHub-authentification-module/issues/69

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 63.63% and project coverage change: +0.93 :tada:

Comparison is base (93d3c1e) 38.59% compared to head (61aadfb) 39.52%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #70 +/- ## =========================================== + Coverage 38.59% 39.52% +0.93% =========================================== Files 12 12 Lines 710 721 +11 =========================================== + Hits 274 285 +11 Misses 436 436 ``` | Flag | Coverage Δ | | |---|---|---| | pytest | `39.52% <63.63%> (+0.93%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PnX-SI#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://app.codecov.io/gh/PnX-SI/UsersHub-authentification-module/pull/70?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PnX-SI) | Coverage Δ | | |---|---|---| | [src/pypnusershub/routes.py](https://app.codecov.io/gh/PnX-SI/UsersHub-authentification-module/pull/70?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PnX-SI#diff-c3JjL3B5cG51c2Vyc2h1Yi9yb3V0ZXMucHk=) | `22.81% <11.11%> (ø)` | | | [src/pypnusershub/utils.py](https://app.codecov.io/gh/PnX-SI/UsersHub-authentification-module/pull/70?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PnX-SI#diff-c3JjL3B5cG51c2Vyc2h1Yi91dGlscy5weQ==) | `39.62% <100.00%> (+15.81%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

mvergez commented 1 year ago

J'ai testé chez moi, et, si je ne dis pas de bêtises, ce développement fait apparaître la contrainte suivante :

Si on considère que GeoNature est accessible sous https://mondomaine.fr/geonature, l'url de l'API doit commencer par cet url. Donc par exemple https://mondomaine.fr/geonature/api mais pas https://mondomaine.fr/api.

En effet, ce développement permet de générer un cookie avec un PATH = "/geonature" donc s'appliquera sur tous les urls ayant pour base "/geonature".

En espérant avoir été clair et de ne pas m'être trompé dans mes explications.

TheoLechemia commented 1 year ago

Oui, c'était déjà la cas, il fallait que le backend soit sur le même domaine que le front pour que le cookie soit correctement mis.