Skip to content

Fix upload proxy auth fallback#531

Open
ayushshrivastv wants to merge 1 commit intoarchi-physics:mainfrom
ayushshrivastv:ComputingOperations
Open

Fix upload proxy auth fallback#531
ayushshrivastv wants to merge 1 commit intoarchi-physics:mainfrom
ayushshrivastv:ComputingOperations

Conversation

@ayushshrivastv
Copy link
Copy Markdown

Summary

  • add a shared internal auth helper for chat-app to data-manager requests
  • fall back to a deterministic token derived from PG_PASSWORD when DM_API_TOKEN is not configured
  • keep explicit DM_API_TOKEN precedence and add regression coverage for the auth path

Why

Issue #517 reports upload actions failing with Data manager authentication failed while the data-manager logs show a 302 on /document_index/upload_url. This happens when data-manager auth is enabled but the internal proxy token is not configured, so the chat app gets redirected to the uploader login page instead of being treated as a trusted internal caller.

Testing

  • .venv/bin/python -m pytest tests/unit/test_internal_auth.py -q
  • python3 -m compileall src/utils/internal_auth.py src/interfaces/uploader_app/app.py src/interfaces/chat_app/app.py tests/unit/test_internal_auth.py

@ayushshrivastv
Copy link
Copy Markdown
Author

ayushshrivastv commented Mar 21, 2026

Verified locally on macOS in Docker with data_manager.auth.enabled: true and no DM_API_TOKEN set. Both URL upload/scrape and PDF upload from the Upload Data UI now succeed instead of failing with the previous data-manager auth redirect/error.

Screenshot 2026-03-21 at 5 56 37 PM Screenshot 2026-03-21 at 5 41 23 PM Screenshot 2026-03-21 at 5 40 49 PM

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.

1 participant