A FastAPI microservice for validating RSA public keys against a registry of known sensor keys.
- Install dependencies:
pip install -r requirements.txt - Run the service:
uvicorn main:app --reload --host 0.0.0.0 --port 8003 - Test the API:
python utils/test_api.py
The service will be available at http://localhost:8003
sensor-key-registry/
├── main.py # FastAPI application
├── models/ # Models
│ ├── __init__.py
│ ├── requests.py # Request models (Pydantic input schemas)
│ └── responses.py # Response models (Pydantic output schemas)
├── routers/ # Routers
│ ├── __init__.py
│ ├── health.py # Health check endpoints
│ └── keys.py # Key validation and management endpoints
├── utils/
│ ├── __init__.py
│ ├── key_loader.py # Key loading and management functions
│ ├── client_example.py # Usage examples
│ ├── integration_example.py # Integration workflows
│ └── test_api.py # API tests
├── docs/ # Documentation
├── keys/ # Public key files
├── k8s/ # Kubernetes deployment
└── requirements.txt # Dependencies
- API Usage Examples - Integration examples for different languages
- cURL Examples - Command-line testing examples
GET /- Health checkGET /keys/info- Registry informationPOST /validate- Validate a public keyGET /keys/list- List all registered keys
# Test with cURL
./test_curl.sh
# Test with Python
python utils/test_api.py