[Feature] Create API Key Authenticaton for v1 API (#327)

Add API key authentication to v1 API
Also includes:
- management command to create keys for users
- Improvements to API tests

Minor:
- more robust way to start docker dev container.

Reviewed-on: enviPath/enviPy#327
Co-authored-by: Tobias O <tobias.olenyi@envipath.com>
Co-committed-by: Tobias O <tobias.olenyi@envipath.com>
This commit is contained in:
2026-02-11 02:29:54 +13:00
committed by jebus
parent c0cfdb9255
commit 5789f20e7f
15 changed files with 282 additions and 165 deletions

View File

@ -11,6 +11,8 @@ import signal
import subprocess
import sys
import time
import os
import dotenv
def find_pnpm():
@ -65,6 +67,7 @@ class DevServerManager:
bufsize=1,
)
self.processes.append((process, description))
print(" ".join(command))
print(f"✓ Started {description} (PID: {process.pid})")
return process
except Exception as e:
@ -146,6 +149,7 @@ class DevServerManager:
def main():
"""Main entry point."""
dotenv.load_dotenv()
manager = DevServerManager()
manager.register_cleanup()
@ -174,9 +178,10 @@ def main():
time.sleep(1)
# Start Django dev server
port = os.environ.get("DJANGO_PORT", "8000")
django_process = manager.start_process(
["uv", "run", "python", "manage.py", "runserver"],
"Django server",
["uv", "run", "python", "manage.py", "runserver", f"0:{port}"],
f"Django server on port {port}",
shell=False,
)