|
4 | 4 |
|
5 | 5 | import aiofiles |
6 | 6 | import aiofiles.os |
7 | | -from auth_lib.fastapi import UnionAuth |
8 | 7 | from fastapi import APIRouter, File, UploadFile |
9 | 8 | from fastapi.exceptions import HTTPException |
10 | 9 | from fastapi.params import Depends |
@@ -160,10 +159,7 @@ async def send(inp: SendInput, settings: Settings = Depends(get_settings)): |
160 | 159 | response_model=SendOutput, |
161 | 160 | ) |
162 | 161 | async def upload_file( |
163 | | - pin: str, |
164 | | - file: UploadFile = File(...), |
165 | | - settings: Settings = Depends(get_settings), |
166 | | - _=Depends(UnionAuth(scopes=["print.file.create"], allow_none=False, auto_error=True)), |
| 162 | + pin: str, file: UploadFile = File(...), settings: Settings = Depends(get_settings) |
167 | 163 | ): |
168 | 164 | """Загрузить файл на сервер. |
169 | 165 |
|
@@ -233,10 +229,7 @@ async def upload_file( |
233 | 229 | response_model=SendOutput, |
234 | 230 | ) |
235 | 231 | async def update_file_options( |
236 | | - pin: str, |
237 | | - inp: SendInputUpdate, |
238 | | - settings: Settings = Depends(get_settings), |
239 | | - _=Depends(UnionAuth(scopes=["print.file.update"], allow_none=False, auto_error=True)), |
| 232 | + pin: str, inp: SendInputUpdate, settings: Settings = Depends(get_settings) |
240 | 233 | ): |
241 | 234 | """Обновляет настройки печати. |
242 | 235 |
|
@@ -282,11 +275,7 @@ async def update_file_options( |
282 | 275 | }, |
283 | 276 | response_model=ReceiveOutput, |
284 | 277 | ) |
285 | | -async def print_file( |
286 | | - pin: str, |
287 | | - settings: Settings = Depends(get_settings), |
288 | | - _=Depends(UnionAuth(scopes=["print.file.get"], allow_none=False, auto_error=True)), |
289 | | -): |
| 278 | +async def print_file(pin: str, settings: Settings = Depends(get_settings)): |
290 | 279 | """Получить файл для печати. |
291 | 280 |
|
292 | 281 | Требует пин-код, полученный в методе POST `/file`. Файл можно скачать |
|
0 commit comments