Skip to content

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

@pskillen

Description

@pskillen

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_roleINFRASTRUCTURE_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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions