Files
mcpctl/.taskmaster/tasks/task_132.md

26 lines
988 B
Markdown
Raw Normal View History

# Task ID: 132
**Title:** CodeRepo repository and service layers
**Status:** pending
**Dependencies:** 119
**Priority:** medium
**Description:** Create CodeRepoRepository and CodeRepoService with credential resolution through SecretService
**Details:**
Create src/mcpd/src/repositories/code-repo.repository.ts and src/mcpd/src/services/code-repo.service.ts:
1. Repository: standard CRUD, findByProjectId
2. Service.create(): validate project exists, validate credSecretId/Key if provided
3. Service.resolveCredentials(repoId): fetch Secret via SecretService, extract the key, return credential (never store plaintext)
4. Service.update(): validate changes
5. Service.delete(): check no active sessions reference this repo
6. Follow existing service patterns for validation
**Test Strategy:**
Unit tests: test create with valid project, test credential resolution returns correct value, test create fails with invalid secret reference, test findByProjectId returns filtered list.