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

Aperta
#367 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
62/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
django, python
Ambito
api, authorization

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Python
Stelle
1
Fork
0
Merge medio
1g 20h
PR unite (30g)
5

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pskillen/meshflow-api

Tutte le issue di pskillen/meshflow-api

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.