You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+93-1
Original file line number
Diff line number
Diff line change
@@ -22,12 +22,13 @@ A minimalist [Flask](https://github.com/pallets/flask) extension that serves as
22
22
- You can define a callback function/ use signals to listen for process completion. See [Example code](examples/with_callback.py).
23
23
* Maybe want to pass some additional context to the callback function ?
24
24
* Maybe intercept on completion and update the result ? See [Example code](examples/custom_save_fn.py)
25
+
- You can also apply [View Decorators](https://flask.palletsprojects.com/en/1.1.x/patterns/viewdecorators/) to the exposed endpoint. See [Example code](examples/with_decorators.py)
25
26
- Currently, all commands run asynchronously (default timeout is 3600 seconds), so result is not available directly. An option _may_ be provided for this in future releases for commands that return immediately.
26
27
27
28
> Note: This extension is primarily meant for executing long-running
28
29
> shell commands/scripts (like nmap, code-analysis' tools) in background from an HTTP request and getting the result at a later time.
This was initially made to integrate various command-line tools easily with [Intel Owl](https://github.com/intelowlproject/IntelOwl), which I am working on as part of Google Summer of Code.
Copy file name to clipboardexpand all lines: docs/source/Examples.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -7,4 +7,5 @@ I have created some example python scripts to demonstrate various use-cases. The
7
7
-[multiple_files.py](https://github.com/Eshaan7/Flask-Shell2HTTP/blob/master/examples/multiple_files.py): Upload multiple files for a single command.
8
8
-[with_callback.py](https://github.com/Eshaan7/Flask-Shell2HTTP/blob/master/examples/with_callback.py): Define a callback function that executes on command/process completion.
9
9
-[with_signals.py](https://github.com/Eshaan7/Flask-Shell2HTTP/blob/master/examples/with_signals.py): Using [Flask Signals](https://flask.palletsprojects.com/en/1.1.x/signals/) as callback function.
10
-
-[custom_save_fn.py](https://github.com/Eshaan7/Flask-Shell2HTTP/blob/master/examples/custom_save_fn.py): There may be cases where the process doesn't print result to standard output but to a file/database. This example shows how to pass additional context to the callback function, intercept the future object after completion and update it's result attribute before it's ready to be consumed.
10
+
-[with_decorators.py](https://github.com/Eshaan7/Flask-Shell2HTTP/blob/master/examples/with_decorators.py): Shows how to apply [View Decorators](https://flask.palletsprojects.com/en/1.1.x/patterns/viewdecorators/) to the exposed endpoint. Useful in case you wish to apply authentication, caching, etc. to the endpoint.
11
+
-[custom_save_fn.py](https://github.com/Eshaan7/Flask-Shell2HTTP/blob/master/examples/custom_save_fn.py): There may be cases where the process doesn't print result to standard output but to a file/database. This example shows how to pass additional context to the callback function, intercept the future object after completion and update it's result attribute before it's ready to be consumed.
Copy file name to clipboardexpand all lines: docs/source/index.rst
+1
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,7 @@ A minimalist Flask_ extension that serves as a RESTful/HTTP wrapper for python's
20
20
- Can also process multiple uploaded files in one command.
21
21
- This is useful for internal docker-to-docker communications if you have different binaries distributed in micro-containers.
22
22
- You can define a callback function/ use signals to listen for process completion.
23
+
- You can also apply View Decorators to the exposed endpoint.
23
24
- Currently, all commands run asynchronously (default timeout is 3600 seconds), so result is not available directly. An option _may_ be provided for this in future release.
24
25
25
26
`Note: This extension is primarily meant for executing long-running
0 commit comments