This example shows the simplicity in integrating zero trust into a web server or API using Flask. This example also shows how to use the decorator to apply the monkeypatch.
This is a perfect example of application to application embedded zero trust. When used in conjunction with the Ziti urllib3 example, both ends of the network are fully app-embedded zero trust applications and therefore offer complete encryption from app to app, no unencrypted data ever leaves the application environment.
Refer to the examples README for details on setting up your network, service, and obtaining an identity file.
If you haven't already installed them, you'll need the dependent libraries used in the examples.
pip install -r ../requirements
This example accepts two input arguments.
- The identity file to be used by the SDK tunneler
- The service to bind to
python helloFlazk.py </path/to/id.json> <name-of-service>
By default, the base url is mapped to our hello_world()
function. So, if we hit that endpoint we will see the
response from the function which is simply Have some ziti
. This could be tested with
-
The Ziti urllib3 example
-
The Ziti Requests example
-
A curl command
curl <name-of-service>:<intercept-port>
-
Or simply visiting the intercept address in a browser.