flag to disable api auth - #38
Merged
Merged
Conversation
- default requireAuth value is false - figure out how to handle auth on client side components
Contributor
There was a problem hiding this comment.
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
requireAuthboolean 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.
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.
What
api auth behind a flag to disable auth if preferred