adding info about the recurring lambdas and expiration mechanism

pull/1/head
lance 5 years ago
parent 3197156c2f
commit c29558063c

@ -88,6 +88,8 @@ $ curl http://127.0.0.1:5000/secret/?token=tpXv-Pk3W1lZJzY5v-6oEU8029IublWHjSs3B
```
By nature of using Flask-RESTPlus there is some Swagger documentation that is automatically generated. You can view it in your browser: http://127.0.0.1:5000/
## Deploying to AWS
As long as you're setup properly you can deploy to AWS using Zappa.
@ -98,6 +100,14 @@ $ zappa deploy
When the deployment is finished you will be provided a new AWS API Gateway endpoint; something like `https://2rdpleh3tf.execute-api.us-west-2.amazonaws.com/dev`. You can validate the endpoint by running the same `curl` commands as above but replacing the endpoint with your API Gateway.
Part of the Zappa configuration includes a recurring event; every 12 hours a Lambda function is scanning all secrets and purging expired secrets. If no `expiration` was set during secret creation then the application defaults to **1 hour** expiration; this can be changed in `secretshare/config.py`. The tag set on the secret is the basis for this expiration check.
If you'd like to cleanup the secrets manually, you can invoke the Lambda function manually with Zappa:
```
$ zappa invoke secretshare.cleanup.purge_expired_secrets
```
## What Now?
Most people don't necessarily care about the backend API - this is only one half of the battle as we need something to present the information. This API can be used in conjunction with any static website with simple Javascript for posting, retrieving, and rendering the data. I'll be creating an example static website to showcase this; it's on my to-do list.

Loading…
Cancel
Save