Skip to content

aakashkhanna/secret-sharing-api

Repository files navigation

🚀 Secret Sharing API

A lightweight FastAPI-based service to securely store and retrieve secrets using one-time tokens. Secrets are stored temporarily with TTL (Time-To-Live) and are deleted after first access.

🔗 Live Demo: https://secret-sharing-api.leapcell.app/docs


✅ Features

  • POST /post-secret/: Store a secret and get a unique token.
  • GET /get-secret/{token}: Retrieve and delete the secret using the token.
  • TTL support: Secrets expire automatically after a set time (default: 60 minutes).
  • Storage support: Redis (default) or DynamoDB (pluggable).
  • Auto-generated OpenAPI docs.

⚙️ Environment Setup

Prerequisites

  • Python 3.11+
  • Poetry
  • Redis (running locally or remote)

Steps

git clone https://github.com/aakashkhanna/secret-sharing-api.git
poetry install
poetry run uvicorn secret_sharing_api.main:app --reload

API Docs:


🔐 Configuration

To use Redis, configure:

REDIS_HOST=redis://localhost:6379/0
REDIS_PORT=50
REDIS_SECRET=secret

To use DynamoDB, configure:

AWS_ENDPOINT_URL=
AWS_REGION_NAME=
AWS_DYNAMO_NAME=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

🧪 Testing

poetry run pytest

🤝 Contributing

  • Fork this repo
  • Create a new branch: git checkout -b feature/xyz
  • Submit a PR

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors