soiposervices/httpauth

A simple package to enable http auth, useful especially for stage and dev environments

0.0.1 2025-01-22 10:15 UTC

This package is auto-updated.

Last update: 2025-02-22 11:14:34 UTC


README

Latest Version on Packagist Total Downloads GitHub Actions

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.