airqo-platform / airqo-platform/AirQo-api
Remove dead validate_network() helper — proxied a removed Auth Service endpoint; device-registry owns this data now
- Ngôn ngữ chính
- JavaScript
- Star
- 26
- Fork
- 24
- Merge trung bình
- 5 giờ 36 phút
- Pull request đã merge (30 ngày)
- 81
Mô tả
## 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.
Hướng dẫn đóng góp
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- api, backend
- Loại issue
- Tái cấu trúc
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 55/100