kubeflow / kubeflow/docs-agent
security: Replace CORS allow_origins=["*"] with env-var allowlist
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 42
- Forks
- 111
- Avg merge
- 6d 23m
- Merged PRs (30d)
- 2
Description
Context
server-https/app.py:104 configures CORSMiddleware with allow_origins=["*"].
Problem
A wildcard origin lets any website make credentialed cross-origin requests to the API.
- This matters especially once PR #67's auth middleware lands —CORS and auth need to be hardened together to actually be effective.
Why This Order
Filed after the Kustomize restructure because the clean fix is injecting ALLOWED_ORIGINS as an env var patched per overlay — empty in base, localhost in generic, production domain in OCI. Doing it before Kustomize means hardcoding values.
Acceptance Criteria
allow_originsread fromALLOWED_ORIGINSenv var (comma-separated)- Defaults to
http://localhost:3000when unset (dev-safe) - Kustomize overlays patch the value per environment
- Requests from unlisted origins receive a proper CORS rejection
Related
server-https/app.py:104- PR #67 — auth middleware (CORS and auth go together)
- Parent tracking issue: #72
- Depends on: Kustomize issue (child A above)
- Blocks: auth hardening work (tracked in PR #67
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CORS configuration at server-https/app.py:104, then inspect the Kustomize overlays and the related auth work in PR #67. Trace how environment values are supplied per overlay, and verify that unset, environment-specific, and unlisted-origin requests meet the acceptance criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100