Add mc_is_infrastructure flag and feeder/admin CRUD for MeshCore infra nodes

未关闭
#367 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
62/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
冷清
技术栈
django, python
领域
api, authorization

调研方向

Start with the ObservedNode model and its migrations, then the infrastructure action on the observed-nodes endpoint (GET /api/nodes/observed-nodes/infrastructure/), which currently filters only on protocol for MeshCore. Add mc_is_infrastructure as a default-False field, filter MeshCore results on it, and gate writes to the feeder group or is_staff, documenting the rules in docs/permissions/README.md and openapi.yaml. Done when only flagged MeshCore nodes are returned, non-feeder users get 403 on writes, and Meshtastic infrastructure output is unchanged.

由索引模型根据 Issue 内容生成。

描述

enhancement meshcore

Summary

MeshCore infrastructure listing should not return every observed MC node. Add an explicit operator-controlled flag on ObservedNode and tighten the infrastructure endpoint.

UI tracking: meshflow-ui#307

Background

GET /api/nodes/observed-nodes/infrastructure/?protocol=meshcore currently returns all protocol=MESHCORE rows in the time window. Meshtastic infra correctly uses meshtastic_role ∈ INFRASTRUCTURE_ROLES. MeshCore has no equivalent role model; filtering by repeater/type alone is too loose.

Design

ObservedNode.mc_is_infrastructure
  • BooleanField, default=False
  • Meaningful only for protocol=MESHCORE; ignore or reject writes on Meshtastic rows
  • Does not replace MT infrastructure semantics
Infrastructure list
  • protocol=meshtastic (default): unchanged (protocol=MESHTASTIC + infrastructure roles)
  • protocol=meshcore: protocol=MESHCORE and mc_is_infrastructure=True
Write API
  • Expose on observed-node PATCH and/or dedicated action (e.g. POST …/observed-nodes/{id}/set-mc-infrastructure/)
  • Permissions: Django feeder group or is_staff only; deny for plain authenticated users
  • Document in docs/permissions/README.md and openapi.yaml

Tasks

  • Migration + model field
  • Serializer(s) + validation (MC only)
  • Permission class / object checks
  • Update infrastructure action filter for meshcore
  • Unit tests (permissions + queryset)
  • Optional: admin list filter

Acceptance criteria

  1. Only flagged MC nodes appear in meshcore infrastructure API results.
  2. Non-feeder non-admin users receive 403 on flag writes.
  3. MT infrastructure list unchanged.
主要语言
Python
星标
1
派生
0
平均合并
23 小时 9 分钟
30 天内合并 PR
15

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pskillen/meshflow-api 的其他 Issue

查看 pskillen/meshflow-api 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。