8000 feat: configurable CORS origins and /api/2.0, /api/2.1 jobs aliases by dmux · Pull Request #93 · dmux/minilake · GitHub
[go: up one dir, main page]

Skip to content

feat: configurable CORS origins and /api/2.0, /api/2.1 jobs aliases - #93

Merged
dmux merged 2 commits into
mainfrom
feature/92-cors-origins-jobs-api-compat
Nov 5, 2026
Merged

dmux merged 2 commits into
mainfrom
feature/92-cors-origins-jobs-api-compat

Conversation

@dmux
@dmux dmux commented Nov 5, 2026
Copy link
Copy Markdown
Owner

Summary

  • Add MINILAKE_CORS_ORIGINS, a comma-separated allowlist of browser origins (* allowed) that may call the API cross-origin. MINILAKE_DEV_CORS=1 keeps working.
  • Answer Private Network Access preflights (Access-Control-Allow-Private-Network), using Starlette's native allow_private_network when available and a small middleware fallback otherwise.
  • Serve the Jobs API under /api/2.0/jobs and /api/2.1/jobs as aliases of /api/2.2/jobs.
  • Set a default for the variable in docker-compose.yml and document it in docs/configuration.md and FEATURES.md.

This lets OpenArchFlow's Databricks Studio call minilake directly from the browser (see dmux/OpenArchFlow#57).

Notes

Settings is a pydantic-settings model, which parses list-typed fields from the environment as JSON. The value is therefore stored as a string and exposed through cors_origin_list; a regression test covers this.

Test plan

  • pytest tests/test_app.py (13 passed): allowed and disallowed origins, CORS off by default, Private Network Access preflight, alias middleware, env parsing.
  • Ran the server locally and exercised workspace/mkdirs, workspace/import, runs/submit, runs/get, runs/list (via /api/2.1) and runs/get-output end to end, with the subprocess executor.
  • Full suite via scripts/run-tests-docker.sh (needs the Docker socket).

Closes #92

dmux added 2 commits November 4, 2026 22:07
Add MINILAKE_CORS_ORIGINS allowlist (with Private Network Access preflight
support) so external browser apps can call the API, and serve the Jobs API
under /api/2.0 and /api/2.1 as aliases of /api/2.2.

Refs #92
…vate network support

pydantic-settings decoded the list-typed field as JSON, so a comma-separated
value stopped startup. Keep the raw string and expose cors_origin_list. Use
CORSMiddleware(allow_private_network=True) when Starlette supports it, with the
custom middleware as a fallback for older versions.

Refs #92
@dmux dmux self-assigned this Nov 5, 2026
@dmux dmux added the enhancement New feature or request label Nov 5, 2026
@dmux
dmux merged commit 1ae83fa into main Nov 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configurable CORS origins and /api/2.1, /api/2.0 jobs aliases for browser clients

1 participant

0