diff options
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/api/groups.py')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/api/groups.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/api/groups.py b/packages/meshbay-hub/src/meshbay_hub/api/groups.py index 2ae2c93..5bccf71 100644 --- a/packages/meshbay-hub/src/meshbay_hub/api/groups.py +++ b/packages/meshbay-hub/src/meshbay_hub/api/groups.py @@ -67,10 +67,11 @@ async def swarm_register( db: AsyncSession = Depends(get_db), ): """Node registers itself as a source for a content hash (public swarm).""" + from meshbay_hub.csam import check_content_hash + if check_content_hash(body.content_hash): + raise HTTPException(status_code=451, detail="Content blocked") + from datetime import datetime, timezone - node_result = await db.execute( - select(User).where(User.id == current_user.id)) - # Use current_user.id as node_id for simplicity existing = await db.get(SwarmSource, (body.content_hash, current_user.id)) now = datetime.now(timezone.utc) if existing: |