oralunal / scribe-auth
A Laravel middleware package that adds authentication protection to your Scribe API documentation.
Installs: 1 013
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 1
pkg:composer/oralunal/scribe-auth
Requires
- php: ^8.2
- knuckleswtf/scribe: ^5.0
- laravel/framework: ^12.0
README
A Laravel middleware package that adds authentication protection to your Scribe API documentation. This package provides a simple way to secure your API documentation with basic authentication, ensuring that only authorized users can access your API documentation pages.
Requirements
- Scribe's
typeconfig should be set tolaravelin yourconfig/scribe.phpfile. - Scribe's
laravel->add_routesconfig should be set totruein yourconfig/scribe.phpfile.
Installation
- Install the package via Composer:
composer require oralunal/scribe-auth
- Add the
webandscribe.authmiddleware to yourconfig/scribe.phpfile:
'middleware' => [ // ... 'web', 'scribe.auth', ],
- Publish the configuration file:
php artisan vendor:publish --tag=scribe-auth-config
Configuration
The package comes with a config file (config/scribe-auth.php) where you can customize the following settings:
SCRIBE_AUTH_ENABLED: Enable/disable the middleware (Default:false)SCRIBE_AUTH_PASSWORD: Authentication password (Default:1234567890)
Add the following environment variable to your .env file:
SCRIBE_AUTH_ENABLED=true SCRIBE_AUTH_PASSWORD=your_fantastic_password
Security
- Use different credentials in production
- Choose a strong password
- Keep your credentials secure
License
This package is open-sourced software licensed under the MIT license.