Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for API Key Authentication #230

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

alessiodallapiazza
Copy link
Contributor

This pull request introduces the ability to secure the server using API key authentication, adding an extra layer of security for server access. By requiring an API key for incoming requests, we ensure that only authorized users can interact with the server's endpoints.

  • Implementation Details:

The APIKeyValidatorMiddleware class has been introduced to perform the API key check. It intercepts incoming requests, checks for the API key in the X-API-Key header, and validates it against the expected key.
If the API key is missing or incorrect, the middleware immediately returns a 403 response, blocking access to the server's endpoints.
This feature is opt-in, ensuring backward compatibility for existing deployments. Users can enable API key authentication by setting the appropriate variable.

@merrymercy merrymercy merged commit d5ae2eb into sgl-project:main Mar 11, 2024
@merrymercy merrymercy mentioned this pull request Mar 11, 2024
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.

None yet

2 participants