Developer Challenge
Description
Web application that encrypts and decrypts payloads while providing searchable logs to past requests
Requirements
GUI
React webpage with the ability to do the following:
-
Enter an encryption key and a payload, call this service's API, log the request, and display the encrypted data
-
Enter a decryption key and a payload, call this service's API, log the request, and display the decrypted data
-
Paginated view of past requests
API
FastAPI Python API that meets the following details:
-
POST /api/v1/encrypt
-
Accept a JSON object containing { key: str, data: str }
-
Respond with { data: str } where data is the resulting encrypted data from signing the data with the public key
-
POST /api/v1/decrypt
-
Accept a JSON object containing { key: str, data: str } where key is a private key and data is some encrypted data from private key's keypair
-
Respond with { data: str } where data is the resulting data from decrypting the payload with the private key
-
GET /api/v1/logs
-
Paginate logs of requests made to this service, include two URL parameters: size (log count) and offset (number of logs from the beginning)
-
Logs should be of the following type { id: str, timestamp: datetime, ip: str, data: str }
-
ID should be a UUID
-
Note that datetime should be a UNIX timestamp
-
The response of this endpoint should be a collection of logs
Data
PostgreSQL should be used to store logs. Logs should match the format defined in the API section.
Documentation
Meaningful documentation should be provided detailing both set up and architecture
Containerization
This should be containerized with Docker, the project should include a Dockerfile & docker-compose.yaml file
CI
Include a linter workflow for both the web and server in your repository
Conventions
Language and tooling conventions should be followed