Skip to content

feat(api): add basic and bearer auth for URL fetching - #164

Merged
SashankBhamidi merged 1 commit into
mainfrom
feat/auth-url-fetching-79
Sep 12, 2026
Merged

SashankBhamidi merged 1 commit into
mainfrom
feat/auth-url-fetching-79

Conversation

@SashankBhamidi

Copy link
Copy Markdown
Member

Summary

  • Adds Basic and Bearer auth for the Fetch URL feature (CalDAV, bearer token APIs).
  • Credentials go through a new POST /fetch JSON body instead of query params. GET /fetch?... would put credentials straight into gunicorn's stdout access log (--access-logfile - in the Dockerfile) on every deployment.
  • _ssrf.py doesn't know about Basic/Bearer at all. It just attaches whatever headers it's given and drops them the moment (scheme, host, port) changes from the original request, checked fresh on every redirect hop.
  • URLs with user:pass@host embedded are rejected. Without that, a redirect to the same host with different userinfo would still pass the origin check and get the real Authorization header forwarded.
  • Also fixes an existing bug, not caused by this PR: the frontend picked "Network error" vs. real error text by checking if err.message contained 'Failed to fetch', which is also literally how this app's own error details start ("Failed to fetch URL: ..."). Every real 401/404 was getting swallowed into a useless "Network error" message.

Closes #79

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 icalendar-anonymizer | 🛠️ Build #34524649 | 📁 Comparing 801c30d against latest (820a4cf)

  🔍 Preview build  

1 file changed
± changelog.html

@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@SashankBhamidi
SashankBhamidi merged commit 42ce9fb into main Sep 12, 2026
15 checks passed
@SashankBhamidi
SashankBhamidi deleted the feat/auth-url-fetching-79 branch September 12, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support authentication for URL fetching

1 participant