bouyuc / CMPE273-Assignment1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implementation

Stack: Flask, MongoDB

The server will execute the uploaded script when it is invoked but the server does not have a middleware to identify malicious scripts

Requirements

You will be implementing a dynamic Python invoker REST service. The service will have the following features:

1. Python Script Uploader

POST http://localhost:8000/api/v1/scripts

Request

foo.py

# foo.py
print("Hello World")
curl -i -X POST -H "Content-Type: multipart/form-data" 
-F "data=@/tmp/foo.py" http://localhost:8000/api/v1/scripts
201 Created
{
    "script-id": "123456"
}

2. Python Script Invoker

GET http://localhost:8000/api/v1/scripts/{script-id}

Request

curl -i
http://localhost:8000/api/v1/scripts/123456
200 OK
Hello World

About


Languages

Language:Python 100.0%