|
30 | 30 | statistics_router = APIRouter( |
31 | 31 | prefix='/statistics', |
32 | 32 | tags=['Statistics'], |
33 | | - dependencies=[Depends(get_current_user)], |
| 33 | + # Dependencies should not be added to the router since the system |
| 34 | + # statistics endpoint is public |
34 | 35 | ) |
35 | 36 |
|
36 | 37 |
|
@@ -112,7 +113,10 @@ def get_system_statistics( |
112 | 113 | ] |
113 | 114 |
|
114 | 115 |
|
115 | | -@statistics_router.get('/series/{series_id}') |
| 116 | +@statistics_router.get( |
| 117 | + '/series/{series_id}', |
| 118 | + dependencies=[Depends(get_current_user)], |
| 119 | +) |
116 | 120 | def get_series_statistics( |
117 | 121 | series_id: int, |
118 | 122 | db: Session = Depends(get_database), |
@@ -147,7 +151,10 @@ def get_series_statistics( |
147 | 151 | ] |
148 | 152 |
|
149 | 153 |
|
150 | | -@statistics_router.get('/snapshots') |
| 154 | +@statistics_router.get( |
| 155 | + '/snapshots', |
| 156 | + dependencies=[Depends(get_current_user)], |
| 157 | +) |
151 | 158 | def get_snapshots( |
152 | 159 | start: datetime | None = Query( |
153 | 160 | default_factory=lambda: datetime.now() - timedelta(days=14) |
@@ -197,7 +204,10 @@ def get_snapshots( |
197 | 204 | return db.query(subquery).filter(subquery.c.row % slice_ == 0).all() |
198 | 205 |
|
199 | 206 |
|
200 | | -@statistics_router.get('/task-durations') |
| 207 | +@statistics_router.get( |
| 208 | + '/task-durations', |
| 209 | + dependencies=[Depends(get_current_user)], |
| 210 | +) |
201 | 211 | def get_task_durations( |
202 | 212 | after: datetime = Query(default=datetime.now() - timedelta(days=7)), |
203 | 213 | task_name: str | None = Query(default=None), |
|
0 commit comments