e7819bfc82
- Add docker-compose.yml with postgres, redis, api, and web services - Add multi-stage Dockerfile for API (Python 3.11) - Add multi-stage Dockerfile for web (Node.js 20 + nginx) - Add Makefile with common development commands - Add .env.example with all required environment variables - Add placeholder pyproject.toml and package.json for builds - Configure health checks for all services - Setup persistent volumes for postgres, redis, and repos - Run services as non-root users
66 lines
1.6 KiB
Markdown
66 lines
1.6 KiB
Markdown
# SSH Key Management Specification
|
|
|
|
## Purpose
|
|
|
|
Generate and manage SSH keys for git operations with external providers.
|
|
|
|
## Requirements
|
|
|
|
### Requirement: Key Generation
|
|
|
|
The system SHALL generate Ed25519 SSH key pairs.
|
|
|
|
#### Scenario: Generate key
|
|
- GIVEN an authenticated user
|
|
- WHEN they request a new SSH key
|
|
- THEN an Ed25519 key pair is generated
|
|
- AND the private key is encrypted with Fernet
|
|
- AND the public key is stored in OpenSSH format
|
|
|
|
### Requirement: Key Association
|
|
|
|
The system SHALL support user-level and project-level keys.
|
|
|
|
#### Scenario: User-level key
|
|
- GIVEN an authenticated user
|
|
- WHEN they generate a key without specifying a project
|
|
- THEN it's associated with their user account
|
|
|
|
#### Scenario: Project-level key
|
|
- GIVEN an authenticated user with a project
|
|
- WHEN they generate a key for that project
|
|
- THEN it's associated with the project
|
|
|
|
### Requirement: Key Display
|
|
|
|
The system SHALL display public keys for copying.
|
|
|
|
#### Scenario: Copy public key
|
|
- GIVEN an authenticated user
|
|
- WHEN they view their SSH keys
|
|
- THEN each public key is displayed in OpenSSH format
|
|
- AND a copy button is available
|
|
|
|
### Requirement: Key Deletion
|
|
|
|
The system SHALL support key removal.
|
|
|
|
#### Scenario: Delete key
|
|
- GIVEN an authenticated user
|
|
- WHEN they delete an SSH key
|
|
- THEN it's removed from the database
|
|
- AND the key files are deleted
|
|
|
|
## Dependencies
|
|
|
|
- Database models: SSHKey, User, Project
|
|
- cryptography library for key generation
|
|
|
|
## Quality Gates
|
|
|
|
- `pytest` must pass
|
|
- `mypy .` must pass
|
|
- `ruff check .` must pass
|
|
- `npm run typecheck` must pass
|
|
- `npm run lint` must pass
|