From c29558063ca2b3ab2e2fc1a8964e1534f67c421d Mon Sep 17 00:00:00 2001 From: lance Date: Tue, 26 Feb 2019 02:40:29 -0800 Subject: [PATCH] adding info about the recurring lambdas and expiration mechanism --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 1992d49..e16d878 100644 --- a/README.md +++ b/README.md @@ -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.