python imports hell

This commit is contained in:
2025-08-08 02:35:16 +03:00
parent abffe7c594
commit 5afee284b7
5 changed files with 15 additions and 13 deletions

View File

@@ -11,11 +11,11 @@ from sanic import Sanic
from sanic.response import json, text
from sanic_prometheus import monitor
from .slack import add_slack_routes
from .users import users_with_group
import kube
import slack
app = Sanic(__name__)
add_slack_routes(app)
slack.add_routes(app)
monitor(app).expose_endpoint()
# API key for godoor controllers authenticating to k-space:floor
@@ -61,9 +61,9 @@ async def view_doorboy_uids(request):
# authorize
key = request.headers.get("KEY")
if key == DOORBOY_SECRET_FLOOR:
users = users_with_group(FLOOR_ACCESS_GROUP)
users = kube.users_with_group(FLOOR_ACCESS_GROUP)
elif key == DOORBOY_SECRET_WORKSHOP:
users = users_with_group(WORKSHOP_ACCESS_GROUP)
users = kube.users_with_group(WORKSHOP_ACCESS_GROUP)
else:
print("WARN: unknown door token in /allowed")
return "unknown doorboy secret token", 403