Skip to content

Commit a5f68b4

Browse files
committed
feat(feeds): add auth field to FeedEntry, set Authorization header for authenticated feeds
1 parent 94ae8a3 commit a5f68b4

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

internal/feeds/fetcher.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ func (f *Fetcher) doFetch(ctx context.Context, agentID string, entry FeedEntry)
142142
req.Header.Set("X-Claw-Pod", f.podName)
143143
req.Header.Set("Accept", "text/plain, text/markdown, application/json")
144144
req.Header.Set("X-Forwarded-Proto", "https")
145+
if entry.Auth != "" {
146+
req.Header.Set("Authorization", "Bearer "+entry.Auth)
147+
}
145148

146149
resp, err := f.client.Do(req)
147150
if err != nil {

internal/feeds/manifest.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type FeedEntry struct {
2323
Path string `json:"path"`
2424
TTL int `json:"ttl"`
2525
URL string `json:"url"`
26+
Auth string `json:"auth,omitempty"` // bearer token for authenticated feeds
2627
}
2728

2829
// LoadManifest reads feeds.json from contextDir. Returns nil, nil if the file

0 commit comments

Comments
 (0)