How leboncoin/cassh works
Based on our analysis of the file tree and README, CASSH is an SSH key signing solution developed to automate the signing of user public keys (a process traditionally done manually). In this project the core idea is to provide a set of tools – a client CLI to submit signing requests, a backend server to process them, and a WebUI for administrative and interactive operations – all containerized for easier deployment and scalability.
Main Components
• Client CLI: Located in src/client, this is the command-line tool that individuals use to add, sign, check status, and manage keys.
• Server Core: Found in src/server, this contains the business logic for processing key-signing, administration commands, and configuration management. Note that this also includes several subcomponents:
– The core signing engine (server.py, server/lib)
– SQL scripts (src/server/sql) that suggest likely database initialization or configuration (even if it is a file-based storage or an actual DB).
– SSH utilities (src/server/ssh_utils) that manage the SSH key operations.
• WebUI: Under src/server/web, this component provides a graphical management interface (with its own Dockerfile and set of templates/static assets) to manage various functions (e.g., signing statuses, administrative actions, etc.).
• Supporting/Deployment Infrastructure: You have several Dockerfiles (for client, server, and WebUI), scripts in the contrib directory for service and Docker setups, and CI/CD files (like .travis.yml) that support deployment and testing.
Component Relationships and Data Flow
• The Client CLI issues “add”, “sign”, and “status” commands to the Server.
• The Server processes requests – it reads configuration files, applies signing logic using its tools and SQL configurations, and may interact with SSH utilities.
• For administrative operations (active, revoke, delete, etc.) the Admin CLI (using the same client tool with admin options) communicates with the Server.
• The WebUI serves as an alternative or supplemental administrative tool, providing a browser-based interface that interacts with the same Server or its dedicated REST endpoints (if available).
Architectural Patterns and Design Principles
• Separation of concerns is clearly visible – the project is divided into distinct submodules (client, server core, and web front-end).
• Containerization is emphasized – each major part has Docker support.
• There is a testing infrastructure as seen in the tests folder, indicating a layered approach where unit, integration, and system tests simulate the interactions between components.
• The design implies a microservice or modular monolith pattern: although the components might be deployed in separate containers, they are tightly integrated so that even if deployed independently (multiple server instances as indicated in the README), they work as a cohesive system.
Relevant Technologies/Frameworks
• Python is the main development language.
• Docker for containerizing the client, server, and web modules.
• Travis CI (as seen in .travis.yml) for continuous integration.
• SSH, OpenSSH, and related libraries are central for key generation and signing.
• SQL scripts hint at some form of configuration or state management (even if not a full-fledged RDBMS, they may be used for initial setup or audits).