feat(admin): add authenticated settings API endpoints - #690
Merged
Conversation
Signed-off-by: ABHAY PANDEY <pandeyabhay967@gmail.com>
Signed-off-by: ABHAY PANDEY <pandeyabhay967@gmail.com>
Signed-off-by: ABHAY PANDEY <pandeyabhay967@gmail.com>
🦋 Changeset detectedLatest commit: 733b79f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Collaborator
This was referenced Jul 16, 2026
Reconcile merged UI-DASH and Settings PRs with the settings API branch: keep authenticated settings endpoints, adopt upstream dashboard, Grafana port 7777, fail-closed rate limiting, and Settings review refactors.
18 tasks
cameri
approved these changes
Jul 27, 2026
There was a problem hiding this comment.
Pull request overview
Adds authenticated admin API endpoints to read, validate, and update relay settings using the shared settings-config utilities (introduced in #672), including redaction of sensitive fields for safe UI consumption.
Changes:
- Add
/admin/settingsread endpoint and/admin/settings/schemaguided schema endpoint for the admin console. - Add
/admin/settings/validateand/admin/settings(PATCH) endpoints to validate and persist settings updates. - Introduce settings redaction utilities and unit tests covering redaction and the new admin settings routes.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/utils/settings-redaction.spec.ts | Adds unit coverage for sensitive-path detection and secret redaction behavior. |
| test/unit/routes/admin-settings.spec.ts | Adds integration-style unit tests for admin settings endpoints (auth, get/schema/validate/patch). |
| test/unit/app/maintenance-worker.spec.ts | Updates existing test to stub new metrics telemetry shutdown dependency. |
| src/utils/settings-redaction.ts | Implements redaction helpers for settings payloads and per-path values. |
| src/schemas/admin-settings-schema.ts | Adds request-body schema for admin settings PATCH validation. |
| src/routes/admin/index.ts | Registers new authenticated admin settings routes under the admin router. |
| src/factories/controllers/post-admin-settings-validate-controller-factory.ts | Wires up the settings validate controller. |
| src/factories/controllers/patch-admin-settings-controller-factory.ts | Wires up the settings patch controller. |
| src/factories/controllers/get-admin-settings-schema-controller-factory.ts | Wires up the guided settings schema controller. |
| src/factories/controllers/get-admin-settings-controller-factory.ts | Wires up the get settings controller. |
| src/controllers/admin/post-settings-validate-controller.ts | Implements merged-settings validation endpoint. |
| src/controllers/admin/patch-settings-controller.ts | Implements validated dot-path PATCH with persistence and response redaction. |
| src/controllers/admin/get-settings-schema-controller.ts | Exposes guided setting categories for the admin UI. |
| src/controllers/admin/get-settings-controller.ts | Exposes merged settings with secret redaction. |
| .changeset/admin-settings-api.md | Declares a minor release for the new admin settings API feature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Implement atomic writes and timestamped backups in saveSettings - Fix array path validation for empty default schemas - Filter unknown keys from merged settings in GET /admin/settings to prevent secret leaks
cameri
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds backend-only admin settings endpoints that reuse the shared settings-config module from #672, so the admin console can read and update relay settings without duplicating CLI logic.
Why
The admin settings editor needs the same get/set/validate behavior as the CLI. This PR exposes that through authenticated admin routes ahead of the UI work in #594.
Related Issue
Fixes- Part of #665
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: