Basic example of how to use dedicated paths in an mse application.
This example works with a self-signed certificate on a fully zero trust environment. This example contains:
- A simple hello-world flask application
- The mse app config file
- A secret file
- Python tests
On a first terminal, run:
$ # From `path` example directory
$ cd mse_src
$ SECRETS_PATH=../secrets.json flask run
You can also run instead:
$ # From `path` example directory
$ mse cloud localtest
$ mse cloud deploy
Your application is now ready to be used
$ mse cloud test <APP_ID>
You can get the certificate and check it using:
$ mse cloud verify "$APP_DOMAIN_NAME"
You can now query the microservice:
$ curl https://$APP_DOMAIN_NAME/ --cacert cert.pem
The file secrets.json
contains the tokens used by the app to manage authentication.
In a real-world application, this file should not be pushed on a public git repository.
Write current date into file
$ curl -H "Authorization: Bearer 6fMvPktkMwZj5UJwxasOIj7sO37H4DfZZo05Nn1fFYw=" -X POST https://$APP_DOMAIN_NAME/ --cacert cert.pem
Read the date file
$ curl -H "Authorization: Bearer bAyJhel6vwzrvNcy7ux2nULRwpP6BviE34KSiZRGixo=" https://$APP_DOMAIN_NAME/ --cacert cert.pem