airqo-platform / airqo-platform/AirQo-api
Remove dead validate_network() helper — proxied a removed Auth Service endpoint; device-registry owns this data now
- 主要言語
- JavaScript
- スター
- 26
- フォーク
- 24
- 平均マージ
- 5時間 36分
- マージ済み PR(30日)
- 81
説明
## Summary
**Microservice:** `src/analytics/` in this repo. All paths below are relative to that root.
The Auth Service has removed the `GET /users/networks` endpoint entirely, as part of a full removal of the legacy "network" org-membership concept (superseded by groups).
`validate_network()` in `api/utils/data_formatters.py` calls this endpoint. It has been confirmed to have zero live callers anywhere in this codebase — checked every import site of `data_formatters`, and nothing pulls this function in except its own test file.
## Fix
Safe to delete `validate_network()` and its associated test coverage whenever convenient. It is unreachable dead code today and would only start throwing if something were to newly call it, since the endpoint it depends on no longer exists.
**If this capability is ever needed again:** the network data it was reading (`net_name`, `net_status`, etc.) was never really an Auth Service concept — it maps directly onto device-registry's own `Network` model, which already exposes full CRUD at `GET/POST /api/v2/devices/networks` (device-registry is the canonical owner of this data now, and always should have been). A revived version of this validator would point there instead of Auth Service.
## Priority
Low — cleanup only, no live pipeline or handler depends on this function.
コントリビューションガイド
調査の方向性
Read src/analytics/api/utils/data_formatters.py and the associated test file, then confirm validate_network has no live callers. Remove the helper and its test coverage, and run the associated test file to verify the dead endpoint proxy is no longer covered.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- api, backend
- issue の種類
- リファクタリング
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 活発
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 55/100