Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 11, 2025

Renamed the expectedKey parameter to key and made authentication optional. When no key is provided, bearer auth middleware is not applied.

API Changes

  • Parameter rename: expectedKeykey in createApp()
  • Type change: key is now optional (key?: string)
  • Behavior: Bearer auth middleware only applied when key is provided

Usage

// With authentication
const app = createApp({
  key: "my-secret",
  proxyUri: "http://proxy.example.com:8080"
});

// Without authentication
const app = createApp({
  proxyUri: "http://proxy.example.com:8080"
});

Environment Variables

  • PROXY_FETCH_KEY remains the environment variable name (backward compatible)
  • Now optional; server starts without authentication when omitted
  • PROXY_URI is the only required variable

Modified Files

  • src/app.js: Parameter rename, conditional middleware application
  • src/server.js: Removed key validation requirement
  • tests/server.test.js: Added tests for unauthenticated mode
  • README.md: Updated to reflect optional authentication
Original prompt

Rename expectedKey to key, and make it optional.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Dec 11, 2025
Copilot AI changed the title [WIP] Rename expectedKey to key and make it optional Rename expectedKey to key and make it optional Dec 11, 2025
Copilot AI requested a review from nzakas December 11, 2025 14:54
@nzakas nzakas marked this pull request as ready for review December 11, 2025 14:57
@nzakas nzakas merged commit 0571355 into main Dec 11, 2025
20 of 21 checks passed
@nzakas nzakas deleted the copilot/rename-expected-key-to-optional-key branch December 11, 2025 14:59
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