dump-things-server/dump_things_service/admin.py
Christian Monch 7c0731ea8c
Some checks failed
Test execution / Test-all (push) Failing after 48s
[temp] moving further to abstract_config and instance_state
2026-04-27 12:28:31 +02:00

21 lines
529 B
Python

import sys
from fastapi import HTTPException
from dump_things_service import (
HTTP_401_UNAUTHORIZED,
)
from dump_things_service.instance_state import InstanceState
def authenticate_admin(
instance_state: InstanceState,
api_key: str,
):
print('IMPLEMENT: authenticate_admin() ', file=sys.stderr, flush=True)
if api_key != 'admin-1':
detail = f'invalid admin token: {api_key}'
raise HTTPException(
status_code=HTTP_401_UNAUTHORIZED,
detail=detail,
)