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

Open
#367 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
62/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Quiet
Tech stack
django, python
Domain
api, authorization

Research direction

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.

Written by the indexing model from the issue text.

Description

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.
Dominant language
Python
Stars
1
Forks
0
Avg merge
1d 20h
Merged PRs (30d)
5

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pskillen/meshflow-api

All issues in pskillen/meshflow-api

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.