|
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 |
@@ -165,10 +164,7 @@ async def send(inp: SendInput, settings: Settings = Depends(get_settings)): |
165 | 164 | response_model=SendOutput, |
166 | 165 | ) |
167 | 166 | async def upload_file( |
168 | | - pin: str, |
169 | | - file: UploadFile = File(...), |
170 | | - settings: Settings = Depends(get_settings), |
171 | | - _=Depends(UnionAuth(scopes=["print.file.create"], allow_none=False, auto_error=True)), |
| 167 | + pin: str, file: UploadFile = File(...), settings: Settings = Depends(get_settings) |
172 | 168 | ): |
173 | 169 | """Загрузить файл на сервер. |
174 | 170 |
|
@@ -239,10 +235,7 @@ async def upload_file( |
239 | 235 | response_model=SendOutput, |
240 | 236 | ) |
241 | 237 | async def update_file_options( |
242 | | - pin: str, |
243 | | - inp: SendInputUpdate, |
244 | | - settings: Settings = Depends(get_settings), |
245 | | - _=Depends(UnionAuth(scopes=["print.file.update"], allow_none=False, auto_error=True)), |
| 238 | + pin: str, inp: SendInputUpdate, settings: Settings = Depends(get_settings) |
246 | 239 | ): |
247 | 240 | """Обновляет настройки печати. |
248 | 241 |
|
@@ -289,11 +282,7 @@ async def update_file_options( |
289 | 282 | }, |
290 | 283 | response_model=ReceiveOutput, |
291 | 284 | ) |
292 | | -async def print_file( |
293 | | - pin: str, |
294 | | - settings: Settings = Depends(get_settings), |
295 | | - _=Depends(UnionAuth(scopes=["print.file.get"], allow_none=False, auto_error=True)), |
296 | | -): |
| 285 | +async def print_file(pin: str, settings: Settings = Depends(get_settings)): |
297 | 286 | """Получить файл для печати. |
298 | 287 |
|
299 | 288 | Требует пин-код, полученный в методе POST `/file`. Файл можно скачать |
|
0 commit comments