MCPcopy Create free account
hub / github.com/N4si/microservices-python-app / upload

Function upload

src/gateway-service/server.py:32–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30
31@server.route("/upload", methods=["POST"])
32def upload():
33 access, err = validate.token(request)
34
35 if err:
36 unauth_count.inc()
37 return err
38
39 access = json.loads(access)
40
41 if access["admin"]:
42 if len(request.files) > 1 or len(request.files) < 1:
43 return "exactly 1 file required", 400
44
45 for _, f in request.files.items():
46 err = util.upload(f, fs_videos, channel, access)
47
48 if err:
49 return err
50
51 return "success!", 200
52 else:
53 return "not authorized", 401
54
55@server.route("/download", methods=["GET"])
56def download():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected