feat(sources): enforce supported source allowlist
Assign stable keys to the three supported sources, preserve excluded historical rows, and expose history read-only in admin. Add migration, coverage, and responsive browser spec. Refs #13 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -117,14 +117,14 @@ func (u *useCase) Generate(ctx context.Context, userID string) (Result, error) {
|
||||
stats := map[string]int{}
|
||||
partial := false
|
||||
for _, source := range input.Sources {
|
||||
if !source.Enabled {
|
||||
if !source.Operational() {
|
||||
continue
|
||||
}
|
||||
stat := SourceStat{SourceID: source.ID, SourceType: source.Type, ArticleLimit: source.ArticleLimit, Status: "ok"}
|
||||
if stat.ArticleLimit <= 0 {
|
||||
stat.ArticleLimit = 20
|
||||
}
|
||||
feed := u.Scrapers[source.Type]
|
||||
feed := u.Scrapers[*source.SourceKey]
|
||||
var articles []scraper.Article
|
||||
if feed == nil {
|
||||
err = fmt.Errorf("unavailable")
|
||||
|
||||
Reference in New Issue
Block a user