Skip to content

move hardcoded API endpoints/tokens to env vars (closes #21)#23

Open
neha222222 wants to merge 1 commit into
chaoss:mainfrom
neha222222:feat/env-config-issue-21
Open

move hardcoded API endpoints/tokens to env vars (closes #21)#23
neha222222 wants to merge 1 commit into
chaoss:mainfrom
neha222222:feat/env-config-issue-21

Conversation

@neha222222
Copy link
Copy Markdown

Closes #21.

Centralizes external classifier endpoints (Aurora, OSDG) and the GitHub
API base URL in a new backend/config.py, which reads values from env
vars (loaded via python-dotenv when backend/.env is present) and falls
back to the existing hardcoded defaults.

Changes

  • backend/config.pyAURORA_API_URL, OSDG_API_URL, GITHUB_API_URL,
    OSDG_TOKEN, GITHUB_TOKEN, HTTP_TIMEOUT_SECONDS
  • backend/.env.example — documents all variables
  • backend/app.py, aurora_api.py, embedding_url.py read from config
    instead of inline literals
  • backend/aurora_api.py gains a request timeout (was unset, would hang
    forever on stalled upstream); OSDG timeout reduced from 1000s to 30s
  • python-dotenv added to requirements.txt
  • top-level .gitignore keeps .env, venvs, build artifacts out of git
  • README updated with a configuration section

Compatibility

Defaults match previous hardcoded values, so existing local setups keep
working without an .env file. No paid services introduced.

Test

  • All modified files compile cleanly (py_compile).
  • Verified env vars override defaults via small importlib.reload test.

Closes chaoss#21.

Centralize backend service URLs, tokens, and request timeout settings in backend/config.py with documented .env defaults. Add frontend API-base configuration for hosted deployments, fail fast when OSDG_TOKEN is missing, cover config behavior with unittest tests, and remove tracked generated artifacts now covered by .gitignore.
@neha222222 neha222222 force-pushed the feat/env-config-issue-21 branch from 1e1a399 to 3ad1f83 Compare May 3, 2026 07:25
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.

Move hardcoded API endpoints and tokens to environment configuration

1 participant