Benign repos Download

store_admin_routes.py

imports tempfilePython JSON content type
SHA-256ada54f3a8209c0bd10010974d68598090bd692c359287b67a046a1b58b621818

Evidence

imports tempfile lines 1–29
1import logging
2import tempfile
3import typing
4
5import autogpt_libs.auth
6import fastapi
7import fastapi.responses
8import prisma.enums
9
10import backend.api.features.store.cache as store_cache
11import backend.api.features.store.db as store_db
12import backend.api.features.store.model as store_model
13import backend.util.json
14
15logger = logging.getLogger(__name__)
⋯6 lines
22
23
24@router.get(
25 "/listings",
26 summary="Get Admin Listings History",
27)
28async def get_admin_listings_with_versions(
29 status: typing.Opt …
English function-word token "the" lines 33–42
33:45… minViewResponse:
34 """
35 Get store listings with their version history for admins.
36
37 This provides a consolidated view of listings with their versions,
38 allowing for an expandable UI in the admin dashboard.
39
40 Args:
41 status: Filter by submission status (PENDING, APPROVED, REJECTED)
42 search: Search by name, description, or user …
Python basic HTTP route decorator lines 52–63
⋯4 lines
56
57
58@router.post(
59 "/submissions/{store_listing_version_id}/review",
60 summary="Review Store Submission",
61)
62async def review_submission(
63 …
English function-word token "and" lines 72–76
72:11… quest: Review details including approval status and comments
73 user_id: Authenticated admin user performing the review
74
75 Returns:
76 …
Python JSON content type lines 125–134
⋯6 lines
131
132 return fastapi.responses.FileResponse(
133 tmp_file.name, filename=file_name, media_type="application/json"
134 )

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.