Skip to content

Harden default authentication secrets#20

Merged
alias8818 merged 2 commits into
mainfrom
cursor/harden-auth-secrets-be81
Apr 26, 2026
Merged

Harden default authentication secrets#20
alias8818 merged 2 commits into
mainfrom
cursor/harden-auth-secrets-be81

Conversation

@alias8818
Copy link
Copy Markdown
Owner

@alias8818 alias8818 commented Apr 26, 2026

Summary

  • remove hardcoded JWT/admin-token defaults from production configuration
  • require admin proxy authentication before forwarding dashboard /api/v1 calls
  • require users to provide API keys in the UI instead of shipping a demo key
  • carry the submitted UI API key through polling/details requests without re-reading the input mid-flight
  • stop seeding a known demo API key in the base database schema
  • remove an API-key-shaped placeholder from quick-start docs

Verification

  • npm run build
  • npm test -- --runTestsByPath src/api/__tests__/gateway.test.ts src/api/__tests__/authentication.test.ts
Open in Web Open in Cursor 

Co-authored-by: Aliasocracy <alias8818@users.noreply.github.com>
@alias8818 alias8818 marked this pull request as ready for review April 26, 2026 17:17
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c325b9c. Configure here.

Comment thread src/ui/interface.ts Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c325b9c636

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/dashboard/admin-server.ts Outdated
Comment on lines +165 to +166
if (this.adminApiToken && !req.headers.authorization) {
headers.authorization = `ApiKey ${this.adminApiToken}`;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Gate proxy token injection behind dashboard authentication

proxyToApiGateway now adds Authorization: ApiKey <ADMIN_API_TOKEN> whenever the incoming request lacks an Authorization header, but /api/v1 is mounted without any auth guard in setupRoutes. This means any client that can reach the admin server (for example via the published admin port) can call /api/v1/* without credentials and still be proxied as admin-dashboard, which nullifies the token hardening this change is trying to achieve. Require admin-side authentication before injecting the token (or only inject for trusted authenticated sessions).

Useful? React with 👍 / 👎.

Co-authored-by: Aliasocracy <alias8818@users.noreply.github.com>
@alias8818 alias8818 merged commit 014357b into main Apr 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants