Metadata-Version: 2.4
Name: key-rotation-planner
Version: 0.1.0
Summary: Local CLI and desktop planner for prioritizing API key and secret rotations
Author: Haider Sattar
License-Expression: MIT
Project-URL: Homepage, https://github.com/iwaheedsattar/key-rotation-planner
Project-URL: Repository, https://github.com/iwaheedsattar/key-rotation-planner
Project-URL: Issues, https://github.com/iwaheedsattar/key-rotation-planner/issues
Keywords: secrets,api-keys,rotation,security,cli
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

![Terminal report preview](docs/terminal-report.svg)

# key-rotation-planner

`key-rotation-planner` turns messy API key and secret inventory notes into a local rotation plan. It reads `.env`-style comments, CSV, or JSON records, redacts long values, scores stale keys, and produces Markdown, JSON, or HTML reports.

It is designed for teams that track provider keys, webhooks, deploy tokens, and shared credentials across notes or issue comments and need a quick rotation checklist before integrations age out.

## Install

```bash
pip install key-rotation-planner
```

## Usage

```bash
key-rotation-planner examples/secrets-inventory.txt
key-rotation-planner examples/secrets-inventory.txt --format html --output rotation-plan.html
key-rotation-planner examples/secrets-inventory.txt --fail-on-overdue
key-rotation-planner-gui
```

Inventory lines can be informal:

```text
OPENAI_API_KEY=sk-redacted # service=openai env=prod owner=ai-platform last_rotated=2026-02-12 cadence=60d
STRIPE_WEBHOOK_SECRET=whsec-redacted # service=stripe env=prod owner=billing last_rotated=2026-05-18 cadence=45d
LEGACY_ADMIN_TOKEN=redacted # env=prod last_rotated=2025-12-01
```

CSV and JSON inputs are also supported with fields such as `name`, `service`, `owner`, `environment`, `last_rotated`, and `cadence_days`.

## Output

The planner reports:

- Overdue, due-soon, healthy, and unknown-age keys.
- Due dates calculated from `last_rotated` plus cadence.
- Owner and production-scope gaps.
- Risk scores weighted by age, missing owner, production usage, and sensitive service names.
- Copy-ready next steps for the highest-priority rotations.

## Development

```bash
python3 -m unittest discover -s tests
python3 -m build --no-isolation
python3 -m twine check dist/*
```

## License

MIT

