Problem Statement
The UpdateStreamDto.status field (api/src/streams/dto/update-stream.dto.ts:24) accepts any 1-50 character string. While the service layer validates transitions, the DTO should also enforce valid status values for defense-in-depth.
Evidence
@IsOptional()
@IsString()
@Length(1, 50, { message: "status must be between 1 and 50 characters" })
status?: string // accepts any string, not just valid states
Impact
API accepts arbitrary status strings. The service rejects them later with ConflictException, but the API contract should be narrow. Swagger documentation auto-generates an open-ended status field.
Proposed Solution
Add @IsIn(['inactive', 'active', 'error']) validator to the status field, matching the ListStreamsQueryDto.status pattern.
Acceptance Criteria
File Map
api/src/streams/dto/update-stream.dto.ts — add @isin()
Labels: refactoring, good first issue
Priority: Low | Difficulty: Beginner | Estimated Effort: 0.5h
Labels: refactoring,good first issue
Priority: Low | Difficulty: Beginner | Estimated Effort: 0.5h
Backlog ID: REPO-044
Problem Statement
The
UpdateStreamDto.statusfield (api/src/streams/dto/update-stream.dto.ts:24) accepts any 1-50 character string. While the service layer validates transitions, the DTO should also enforce valid status values for defense-in-depth.Evidence
Impact
API accepts arbitrary status strings. The service rejects them later with ConflictException, but the API contract should be narrow. Swagger documentation auto-generates an open-ended status field.
Proposed Solution
Add
@IsIn(['inactive', 'active', 'error'])validator to the status field, matching theListStreamsQueryDto.statuspattern.Acceptance Criteria
File Map
api/src/streams/dto/update-stream.dto.ts— add @isin()Labels: refactoring, good first issue
Priority: Low | Difficulty: Beginner | Estimated Effort: 0.5h
Labels: refactoring,good first issue
Priority: Low | Difficulty: Beginner | Estimated Effort: 0.5h
Backlog ID: REPO-044