forked from retoor/devplacepy
POST /auth/login (form and JSON) now accepts the username in the email field, like HTTP Basic and POST /auth/token always did; the token endpoint no longer lowercases the identifier before the username lookup, fixing mixed-case usernames. The login field is relabelled and type=text so browsers accept a username.
Every JSON return of the personal API key now also returns the account username and email: the profile JSON gains a can_view_api_key-gated email beside api_key (username already rides profile_user), and POST /profile/regenerate-api-key returns {api_key, username, email}. A client holding only its DEVPLACE_API_KEY value can now fetch its full account via GET /profile in one call.
Documented fully: authentication prose page (three credentials, precedence, DEVPLACE_API_KEY, account fetch, separate DevRant/WebSocket auth domains), new auth-token docs_api card, regenerated-key sample, conventions, README, CLAUDE.md, OpenAPI description, corrected profile key hint. Summary in changes.md (left unversioned per request).
Tests: username/mixed-case/uppercase-email login and token cases, API-key account fetch via X-API-KEY and Bearer, owner/admin vs stranger/guest email gating, regenerate shape, browser login by username. Failing-first observed red, green after.
67 lines
1.5 KiB
TOML
67 lines
1.5 KiB
TOML
[project]
|
|
name = "devplacepy"
|
|
version = "1.1.20"
|
|
description = "DevPlace - The Developer Social Network"
|
|
requires-python = ">=3.12"
|
|
dependencies = [
|
|
"fastapi",
|
|
"uvicorn[standard]",
|
|
"jinja2",
|
|
"python-multipart",
|
|
"dataset",
|
|
"passlib[bcrypt]",
|
|
"python-dotenv",
|
|
"aiofiles",
|
|
"httpx[http2]",
|
|
"curl_cffi",
|
|
"brotli",
|
|
"zstandard",
|
|
"cryptography",
|
|
"PyJWT",
|
|
"multiavatar",
|
|
"locust",
|
|
"Pillow",
|
|
"imagehash",
|
|
"uuid_utils",
|
|
"mistune",
|
|
"emoji",
|
|
"pypdf",
|
|
"playwright",
|
|
"playwright-stealth",
|
|
"chromadb",
|
|
"weasyprint",
|
|
"cairosvg",
|
|
"sqlglot",
|
|
"curl_cffi",
|
|
"faker",
|
|
"defusedxml",
|
|
"stealthii @ git+https://retoor.molodetz.nl/retoor/stealthii.git",
|
|
]
|
|
|
|
[project.scripts]
|
|
devplace = "devplacepy.cli:main"
|
|
devii = "devplacepy.services.devii.cli:main"
|
|
devplace-xmlrpc = "devplacepy.services.xmlrpc.server:main"
|
|
|
|
[project.optional-dependencies]
|
|
dev = ["pytest", "playwright", "requests", "coverage"]
|
|
bots = ["playwright", "faker"]
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.hatch.metadata]
|
|
allow-direct-references = true
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests/unit", "tests/api", "tests/e2e"]
|
|
python_files = ["*.py"]
|
|
addopts = "--tb=line -rf -p no:xdist"
|
|
filterwarnings = [
|
|
"ignore:'crypt' is deprecated",
|
|
"ignore:Using `httpx` with `starlette.testclient` is deprecated",
|
|
"ignore:invalid escape sequence",
|
|
"ignore:Skipped unsupported reflection of expression-based index",
|
|
]
|