myparcelcom / auth-module
Package for validating a JWT token and checking the contained scopes
Installs: 25 422
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=8.2
- laravel/framework: >=9.0
- lcobucci/jwt: >=5.0
- myclabs/php-enum: >=1.7
- myparcelcom/json-api: ^3.0
Requires (Dev)
- ext-openssl: *
- mockery/mockery: ^1.5
- phpunit/phpunit: ^11.0
- roave/security-advisories: dev-latest
- squizlabs/php_codesniffer: ^3.7
README
Shared library with Authentication modules for validating JWT authorization headers and checking its scopes
Installation
The library uses Docker to run php and composer. To install Docker, follow the steps in the documentation.
Setup
To setup the project, run:
./mp.sh setup
Providers
Add a provider to set the Public Key
$this->app->singleton(JwtAuthenticator::class, function () {
return (new JwtAuthenticator())->setPublicKey(config('auth.public_key'));
});
Commands
The following commands are available for development:
./mp.sh composer <args>
- Run composer inside the container.
./mp.sh php <args>
- Run any command on the php container.
./mp.sh test <args>
- Run the PHPUnit tests.
License
All software by MyParcel.com is licensed under the MyParcel.com general terms and conditions.