Skip to content

flag to disable api auth - #38

Merged
vigneshrajsb merged 3 commits into
mainfrom
api-auth-flag
Aug 21, 2025
Merged

flag to disable api auth#38
vigneshrajsb merged 3 commits into
mainfrom
api-auth-flag

Conversation

@vigneshrajsb

Copy link
Copy Markdown
Contributor

What

api auth behind a flag to disable auth if preferred

- default requireAuth value is false
- figure out how to handle auth on client side components
@vigneshrajsb
vigneshrajsb requested a review from a team as a code owner August 21, 2025 18:00
@vigneshrajsb
vigneshrajsb requested a review from Copilot August 21, 2025 18:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a configuration flag to make API authentication optional. When requireAuth is set to false, the system bypasses API key validation and rate limiting entirely.

  • Adds a requireAuth boolean flag to the API configuration with a default value of false
  • Modifies authentication validation to skip checks when authentication is disabled
  • Updates middleware to only validate API key format when provided, rather than requiring it

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/server/services/types/globalConfig.ts Adds requireAuth boolean field to ApiConfig type
src/server/services/auth.ts Sets default requireAuth value to false in DEFAULT_API_CONFIG
src/server/lib/auth/validate.ts Implements early return in validateAuth when requireAuth is false
src/pages/api/v1/admin/api-keys/index.ts Conditionally applies bootstrap token validation based on requireAuth flag
src/middleware.ts Makes API key presence optional in middleware validation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/server/services/auth.ts Outdated
Comment thread src/pages/api/v1/admin/api-keys/index.ts
Comment thread src/middleware.ts
@vigneshrajsb vigneshrajsb changed the title flag to enable api auth (when needed) flag to disable api auth Aug 21, 2025
@vigneshrajsb
vigneshrajsb merged commit 193f423 into main Aug 21, 2025
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