llama-stack-mirror/docs/source
Sumanth Kamenani ac25e35124
feat: Add CORS configuration support for server (#3201)
Adds flexible CORS (Cross-Origin Resource Sharing) configuration support
to the FastAPI
  server with both local development and explicit configuration modes:

- **Local development mode**: `cors: true` enables localhost-only access
with regex
  pattern `https?://localhost:\d+`
- **Explicit configuration mode**: Specific origins configuration with
credential support
   and validation
   
- Prevents insecure combinations (wildcards with credentials)
  
- FastAPI CORSMiddleware integration via `model_dump()`

Addresses the need for configurable CORS policies to support web
frontends and
  cross-origin API access while maintaining security.

  Closes #2119

  ## Test Plan

  1.  Ran Unit Tests.

2. Manual tests: FastAPI middleware integration with actual HTTP
requests
    - Local development mode localhost access validation
    - Explicit configuration mode origins validation
    - Preflight OPTIONS request handling

Some screenshots of manual tests.
<img width="1920" height="927" alt="image"
src="https://github.com/user-attachments/assets/79322338-40c7-45c9-a9ea-e3e8d8e2f849"
/>

<img width="1911" height="1037" alt="image"
src="https://github.com/user-attachments/assets/1683524e-b0c9-48c9-a0a5-782e949cde01"
/>

cc: @leseb @rhuss @franciscojavierarceo
2025-08-21 14:23:27 -07:00
..
advanced_apis chore: rename templates to distributions (#3035) 2025-08-04 11:34:17 -07:00
apis chore: bump min python version in docs and tests (#3103) 2025-08-12 08:52:57 -07:00
building_applications docs: Update blocks formatting in docs/source files (#3120) 2025-08-13 08:06:31 -07:00
concepts feat: add batches API with OpenAI compatibility (with inference replay) (#3162) 2025-08-15 15:34:15 -07:00
contributing chore: Update benchmarking location in contributing docs (#3180) 2025-08-18 08:04:21 -04:00
deploying chore(rename): move llama_stack.distribution to llama_stack.core (#2975) 2025-07-30 23:30:53 -07:00
distributions feat: Add CORS configuration support for server (#3201) 2025-08-21 14:23:27 -07:00
getting_started docs: Added comment about a known limitation of AgentEventLogger (#2930) 2025-08-07 10:09:57 -07:00
providers feat: add batches API with OpenAI compatibility (with inference replay) (#3162) 2025-08-15 15:34:15 -07:00
references docs: Update blocks formatting in docs/source files (#3120) 2025-08-13 08:06:31 -07:00
conf.py docs: Add documentation on how to contribute a Vector DB provider and update testing documentation (#3093) 2025-08-11 11:11:09 -07:00
index.md docs: Reorganize documentation on the webpage (#2651) 2025-07-15 14:19:35 -07:00