diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-08-28 03:43:29 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-08-28 03:43:29 +0200 |
| commit | 2f573b4143212b21d92ff20179356acb8f8fe635 (patch) | |
| tree | ce0c4ff78044a56c0882d7ba94fbea436f0e83c3 /packages/meshbay-hub/src/meshbay_hub/api/hub.py | |
| parent | e1f1b65cfac031096e4bae24ccf102ca0dbb86d9 (diff) | |
| parent | b5b4f188a39fc96c4d32e67151e067b1add6dcfc (diff) | |
| download | meshbay-2f573b4143212b21d92ff20179356acb8f8fe635.tar.gz | |
Merge branch 'feat/hub-disable-public-groups'
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/api/hub.py')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/api/hub.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/api/hub.py b/packages/meshbay-hub/src/meshbay_hub/api/hub.py index 4aef93d..8692995 100644 --- a/packages/meshbay-hub/src/meshbay_hub/api/hub.py +++ b/packages/meshbay-hub/src/meshbay_hub/api/hub.py @@ -1,22 +1,29 @@ """Hub info endpoints — /v1/hub/*""" -from fastapi import APIRouter +from fastapi import APIRouter, Depends +from sqlalchemy.ext.asyncio import AsyncSession + from meshbay_common import MNP_VERSION, MHP_VERSION -from meshbay_hub import __version__ +from meshbay_hub import __version__, hub_settings from meshbay_hub.auth import hub_public_key_pem -from meshbay_hub.db.engine import get_engine +from meshbay_hub.db.engine import get_db, get_engine router = APIRouter(prefix="/v1/hub", tags=["hub"]) @router.get("/info") -async def hub_info(): +async def hub_info(db: AsyncSession = Depends(get_db)): engine = get_engine() return { "hub_version": __version__, "mnp_version": MNP_VERSION, "mhp_version": MHP_VERSION, "db_dialect": engine.dialect.name, + # Instance policy the SPA needs before drawing the create-group form. + # Unauthenticated on purpose: it is not a secret, and the form is + # reachable before the group list loads. The hub enforces it regardless + # of what any client does with this flag. + "allow_public_groups": await hub_settings.public_groups_allowed(db), } |