soiposervices / httpauth
A simple package to enable http auth, useful especially for stage and dev environments
Requires
- php: ^8.2
- illuminate/support: ^8|^9|^10|^11
Requires (Dev)
- mockery/mockery: ^1.6
- orchestra/testbench: ^6.0
- pestphp/pest: ^1.23
README
This laravel package provides a simple http auth middleware. It can be enable for specific environments and it allows white listed ip to skip the auth check.
Installation
You can install the package via composer:
composer require soiposervices/httpauth
Usage
Make sure
To use this laravel package simply add the HttpAuth middleware to the routes your want to enable the authentication.
You can set the admin and password, using the env variables HTTP_AUTH_USER and HTTP_AUTH_PASS
To whitelist some ip addresses set a comma delimited string in the env variable HTTP_AUTH_WHITELIST
To enable for specific enviroments set the env vairable HTTP_AUTH_ENABLED_ENV eg: "prod,stage"
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email luigi@soiposervices.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.