Commit c7aa3ca
authored
feat: add db migrations and live-reload for per-request content storage and raw override flags (#3117)
## Summary
Persisting raw provider bytes in logs is gated on content logging being active. This PR makes that dependency explicit in the database schema, config store, HTTP handler, UI, and documentation — and removes a spurious restart requirement when toggling `disable_content_logging`.
## Changes
- Added `allow_per_request_content_storage_override` and `allow_per_request_raw_override` columns to `TableClientConfig` with corresponding database migrations, and wired both fields through `UpdateClientConfig` / `GetClientConfig` in the RDB config store.
- Propagated both new fields through the HTTP config update handler so they are persisted when the settings are changed via the API or UI.
- Removed the restart trigger for `disable_content_logging` changes in both the Go handler and the React UI, since the logging plugin holds a live pointer to `ClientConfig` and picks up the new value on the next request without a restart.
- Updated the UI description for **Disable Content Logging** to make clear that raw provider bytes (`store_raw_request_response`) are also dropped when content logging is off, while send-back behavior (`send_back_raw_*`) is unaffected.
- Updated the UI description for **Allow Per-Request Content Storage Override** to clarify that raw-byte storage requires content logging to be on — either globally or via `x-bf-disable-content-logging: false` on the same request.
- Added a documentation warning in `request-options.mdx` stating that raw bytes are only persisted when content logging is active, and updated the `x-bf-disable-content-logging` header description to reflect that it also gates raw-byte storage and can be used to opt a single request into full content+raw capture while content logging is globally disabled.
## Type of change
- [ ] Bug fix
- [x] Feature
- [ ] Refactor
- [x] Documentation
- [ ] Chore/CI
## Affected areas
- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [x] UI (React)
- [x] Docs
## How to test
```sh
# Core/Transports
go test ./framework/configstore/... ./transports/bifrost-http/...
# Verify migrations run cleanly against a fresh or existing DB
# Start the gateway and confirm allow_per_request_content_storage_override
# and allow_per_request_raw_override columns exist in config_client.
# UI
cd ui
pnpm i
pnpm build
```
1. Enable logging, then toggle **Disable Content Logging** — confirm no restart banner appears.
2. Enable **Allow Per-Request Content Storage Override** and send a request with `x-bf-store-raw-request-response: true` while `x-bf-disable-content-logging: true` — confirm raw bytes are absent from the log record.
3. Repeat with `x-bf-disable-content-logging: false` — confirm raw bytes are present.
## Breaking changes
- [ ] Yes
- [x] No
## Security considerations
`allow_per_request_content_storage_override` and `allow_per_request_raw_override` are opt-in and default to `false`, so existing deployments retain their current behavior. Operators must explicitly enable these flags before per-request headers can influence content or raw-byte storage, preserving the existing access control boundary around sensitive log data.
## Checklist
- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable1 parent fa2e537 commit c7aa3ca
6 files changed
Lines changed: 184 additions & 86 deletions
File tree
- docs/providers
- framework/configstore
- tables
- transports/bifrost-http/handlers
- ui/app/workspace/config/views
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
421 | 425 | | |
422 | 426 | | |
423 | 427 | | |
| |||
460 | 464 | | |
461 | 465 | | |
462 | 466 | | |
463 | | - | |
| 467 | + | |
464 | 468 | | |
465 | | - | |
| 469 | + | |
466 | 470 | | |
467 | 471 | | |
468 | 472 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
623 | 623 | | |
624 | 624 | | |
625 | 625 | | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
626 | 632 | | |
627 | 633 | | |
628 | 634 | | |
| |||
6564 | 6570 | | |
6565 | 6571 | | |
6566 | 6572 | | |
| 6573 | + | |
| 6574 | + | |
| 6575 | + | |
| 6576 | + | |
| 6577 | + | |
| 6578 | + | |
| 6579 | + | |
| 6580 | + | |
| 6581 | + | |
| 6582 | + | |
| 6583 | + | |
| 6584 | + | |
| 6585 | + | |
| 6586 | + | |
| 6587 | + | |
| 6588 | + | |
| 6589 | + | |
| 6590 | + | |
| 6591 | + | |
| 6592 | + | |
| 6593 | + | |
| 6594 | + | |
| 6595 | + | |
| 6596 | + | |
| 6597 | + | |
| 6598 | + | |
| 6599 | + | |
| 6600 | + | |
| 6601 | + | |
| 6602 | + | |
| 6603 | + | |
| 6604 | + | |
| 6605 | + | |
| 6606 | + | |
| 6607 | + | |
| 6608 | + | |
| 6609 | + | |
| 6610 | + | |
| 6611 | + | |
| 6612 | + | |
| 6613 | + | |
| 6614 | + | |
| 6615 | + | |
| 6616 | + | |
| 6617 | + | |
| 6618 | + | |
| 6619 | + | |
| 6620 | + | |
| 6621 | + | |
| 6622 | + | |
| 6623 | + | |
| 6624 | + | |
| 6625 | + | |
| 6626 | + | |
| 6627 | + | |
| 6628 | + | |
| 6629 | + | |
| 6630 | + | |
| 6631 | + | |
| 6632 | + | |
| 6633 | + | |
| 6634 | + | |
| 6635 | + | |
| 6636 | + | |
| 6637 | + | |
| 6638 | + | |
| 6639 | + | |
| 6640 | + | |
| 6641 | + | |
| 6642 | + | |
6567 | 6643 | | |
6568 | 6644 | | |
6569 | 6645 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
| |||
382 | 384 | | |
383 | 385 | | |
384 | 386 | | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
399 | 403 | | |
400 | 404 | | |
401 | 405 | | |
| |||
1249 | 1253 | | |
1250 | 1254 | | |
1251 | 1255 | | |
1252 | | - | |
| 1256 | + | |
1253 | 1257 | | |
1254 | 1258 | | |
1255 | 1259 | | |
| |||
0 commit comments