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 basic authentication middleware for HTTP requests #82

Merged
merged 2 commits into from
Jun 12, 2024

Conversation

ksysoev
Copy link
Owner

@ksysoev ksysoev commented Jun 12, 2024

This pull request adds a new middleware function, NewBasicAuthMiddleware, that performs basic authentication for HTTP requests. It takes a map of users and passwords, and a realm string as input. The middleware function checks if the request contains valid basic authentication credentials. If the credentials are valid, it calls the next handler in the chain. If the credentials are invalid or missing, it sends an HTTP 401 Unauthorized response. The pull request also includes unit tests for the middleware function.

Address issue #73

@ksysoev ksysoev merged commit ad6128a into main Jun 12, 2024
2 checks passed
@ksysoev ksysoev deleted the 73-basic-auth-middleware branch June 12, 2024 12:35
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.

1 participant