Deux systèmes d'authentification, une même session JWT :
- COORDINATION : login e-mail + mot de passe (bcrypt), POST .../auth/login ;
POST .../auth/change-password pour le compte courant
- RÉFÉRENTS / BÉNÉVOLES : lien magique inchangé, mais refusé pour un compte
qui a un mot de passe
- Account.password_hash (nullable) + migration 0002 ; propriété auth_method
("password" / "magic_link") exposée dans AccountRead
- app/auth/passwords.py : hash/verify bcrypt, longueur mini 10
- Création de compte : password requis pour COORDINATOR, interdit sinon
- seed : la coordination de démo a un mot de passe, affiché dans le résumé
- 12 tests (login ok/ko, séparation des deux systèmes, change-password,
validation à la création) ; 129 tests au total ; alembic check vert
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uUsRg7XzopkCPWimwg9ZM
52 lines
972 B
TOML
52 lines
972 B
TOML
[project]
|
|
name = "benevoles-backend"
|
|
version = "0.1.0"
|
|
description = "API de gestion des bénévoles d'un festival"
|
|
requires-python = ">=3.12,<3.13"
|
|
dependencies = [
|
|
"fastapi>=0.115",
|
|
"uvicorn[standard]>=0.32",
|
|
"sqlmodel>=0.0.22",
|
|
"alembic>=1.14",
|
|
"psycopg[binary]>=3.2",
|
|
"pydantic-settings>=2.6",
|
|
"python-multipart>=0.0.12",
|
|
"openpyxl>=3.1",
|
|
"pyjwt>=2.9",
|
|
"bcrypt>=4.1",
|
|
]
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"pytest>=8.3",
|
|
"pytest-cov>=6.0",
|
|
"httpx>=0.27",
|
|
"ruff>=0.8",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["app"]
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
target-version = "py312"
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "I", "UP", "B"]
|
|
|
|
[tool.ruff.lint.flake8-bugbear]
|
|
extend-immutable-calls = [
|
|
"fastapi.Depends",
|
|
"fastapi.File",
|
|
"fastapi.Form",
|
|
"fastapi.Query",
|
|
]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
addopts = "-ra"
|