1012 B
1012 B
memberapi.ose.tw backend
Quick start
cd backend
python -m venv .venv
source .venv/bin/activate
pip install -e .
cp .env.example .env
uvicorn app.main:app --host 127.0.0.1 --port 8000 --reload
Required DB setup
- Initialize API client whitelist table with
docs/API_CLIENTS_SQL.sql. - Initialize core tables with
backend/scripts/init_schema.sql. - Generate
api_key_hashand updateapi_clientsrecords, e.g.:
python scripts/generate_api_key_hash.py 'YOUR_PLAIN_KEY'
Authentik JWT setup
- Configure at least one of:
AUTHENTIK_JWKS_URLAUTHENTIK_ISSUER(the service infers<issuer>/jwks/)
- Optional:
AUTHENTIK_AUDIENCE(enables audience claim validation)
Main APIs
GET /healthzGET /me(Bearer token required)GET /me/permissions/snapshot(Bearer token required)POST /internal/users/upsert-by-subGET /internal/permissions/{authentik_sub}/snapshotPOST /admin/permissions/grantPOST /admin/permissions/revoke