#!/usr/bin/env python3

from contextvars import ContextVar

from attrs import define
from tentacles.store import Store
from werkzeug.local import LocalProxy


@define
class Ctx:
    db: Store
    uid: int = None
    gid: int = None
    sid: str = None
    username: str = None
    is_admin: bool = None


_ctx = ContextVar("tentacles.ctx")
ctx: Ctx = LocalProxy(_ctx)
