Initial refactoring work
This commit is contained in:
@@ -165,10 +165,10 @@ return [
|
||||
/*
|
||||
* Other Service Providers...
|
||||
*/
|
||||
Igaster\LaravelTheme\themeServiceProvider::class,
|
||||
Intervention\Image\ImageServiceProvider::class,
|
||||
Collective\Html\HtmlServiceProvider::class,
|
||||
Acacha\User\Providers\GuestUserServiceProvider::class,
|
||||
Orchestra\Asset\AssetServiceProvider::class,
|
||||
Collective\Html\HtmlServiceProvider::class,
|
||||
Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class,
|
||||
],
|
||||
|
||||
/*
|
||||
@@ -196,13 +196,14 @@ return [
|
||||
'Cookie' => Illuminate\Support\Facades\Cookie::class,
|
||||
'Crypt' => Illuminate\Support\Facades\Crypt::class,
|
||||
'DB' => Illuminate\Support\Facades\DB::class,
|
||||
'Debugbar' => Barryvdh\Debugbar\Facade::class,
|
||||
'Doorman' => Clarkeash\Doorman\Facades\Doorman::class,
|
||||
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
|
||||
'Event' => Illuminate\Support\Facades\Event::class,
|
||||
'File' => Illuminate\Support\Facades\File::class,
|
||||
'Gravatar' => Creativeorange\Gravatar\Facades\Gravatar::class,
|
||||
'Gate' => Illuminate\Support\Facades\Gate::class,
|
||||
'Gravatar' => Creativeorange\Gravatar\Facades\Gravatar::class,
|
||||
'Hash' => Illuminate\Support\Facades\Hash::class,
|
||||
'Image' => Intervention\Image\Facades\Image::class,
|
||||
'Lang' => Illuminate\Support\Facades\Lang::class,
|
||||
'Log' => Illuminate\Support\Facades\Log::class,
|
||||
'Mail' => Illuminate\Support\Facades\Mail::class,
|
||||
@@ -217,7 +218,6 @@ return [
|
||||
'Schema' => Illuminate\Support\Facades\Schema::class,
|
||||
'Session' => Illuminate\Support\Facades\Session::class,
|
||||
'Storage' => Illuminate\Support\Facades\Storage::class,
|
||||
'Theme' => Igaster\LaravelTheme\Facades\Theme::class,
|
||||
'URL' => Illuminate\Support\Facades\URL::class,
|
||||
'Validator' => Illuminate\Support\Facades\Validator::class,
|
||||
'View' => Illuminate\Support\Facades\View::class,
|
||||
|
@@ -43,9 +43,9 @@ return [
|
||||
'driver' => 'mysql',
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '3306'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'database' => env('DB_DATABASE', 'billing'),
|
||||
'username' => env('DB_USERNAME', 'billing'),
|
||||
'password' => env('DB_PASSWORD', 'billing'),
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'charset' => 'utf8mb4',
|
||||
'collation' => 'utf8mb4_unicode_ci',
|
||||
@@ -78,6 +78,18 @@ return [
|
||||
'prefix' => '',
|
||||
],
|
||||
|
||||
'cockroach' => [
|
||||
'driver' => 'cockroach',
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '26257'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'schema' => env('DB_DATABASE', 'forge'),
|
||||
'sslmode' => 'prefer',
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|
34
config/demo-mode.php
Normal file
34
config/demo-mode.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
* This is the master switch to enable demo mode.
|
||||
*/
|
||||
'enabled' => env('DEMO_MODE_ENABLED', false),
|
||||
|
||||
/*
|
||||
* Visitors browsing a protected url will be redirected to this path.
|
||||
*/
|
||||
'redirect_unauthorized_users_to_url' => '/under-construction',
|
||||
|
||||
/*
|
||||
* After having gained access, visitors will be redirected to this path.
|
||||
*/
|
||||
'redirect_authorized_users_to_url' => '/',
|
||||
|
||||
/*
|
||||
* The following IP's will automatically gain access to the
|
||||
* app without having to visit the `demoAccess` route.
|
||||
*/
|
||||
'authorized_ips' => [
|
||||
//
|
||||
],
|
||||
|
||||
/*
|
||||
* When strict mode is enabled, only IP's listed in `authorized_ips` will gain access.
|
||||
* Visitors won't be able to gain access by visiting the `demoAccess` route anymore.
|
||||
*/
|
||||
'strict_mode' => false,
|
||||
|
||||
];
|
@@ -13,7 +13,7 @@ return array(
|
||||
'fallback' => 'mm',
|
||||
|
||||
// would you like to return a https://... image
|
||||
'secure' => false,
|
||||
'secure' => true,
|
||||
|
||||
// Gravatar allows users to self-rate their images so that they can indicate if an image
|
||||
// is appropriate for a certain audience. By default, only 'G' rated images are displayed
|
||||
|
177
config/jwt.php
Normal file
177
config/jwt.php
Normal file
@@ -0,0 +1,177 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of jwt-auth.
|
||||
*
|
||||
* (c) Sean Tymon <tymon148@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| JWT Authentication Secret
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Don't forget to set this, as it will be used to sign your tokens.
|
||||
| A helper command is provided for this: `php artisan jwt:generate`
|
||||
|
|
||||
*/
|
||||
|
||||
'secret' => env('JWT_SECRET',
|
||||
(file_exists(base_path('.jwt.'.env('APP_ENV').'.crt'))
|
||||
? file_get_contents(base_path('.jwt.'.env('APP_ENV').'.crt'))
|
||||
: 'changeme')
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| JWT time to live
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the length of time (in minutes) that the token will be valid for.
|
||||
| Defaults to 1 hour
|
||||
|
|
||||
*/
|
||||
|
||||
'ttl' => 60,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Refresh time to live
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the length of time (in minutes) that the token can be refreshed
|
||||
| within. I.E. The user can refresh their token within a 2 week window of
|
||||
| the original token being created until they must re-authenticate.
|
||||
| Defaults to 2 weeks
|
||||
|
|
||||
*/
|
||||
|
||||
'refresh_ttl' => 20160,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| JWT hashing algorithm
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the hashing algorithm that will be used to sign the token.
|
||||
|
|
||||
| See here: https://github.com/namshi/jose/tree/2.2.0/src/Namshi/JOSE/Signer
|
||||
| for possible values
|
||||
|
|
||||
*/
|
||||
|
||||
'algo' => 'RS256',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| User Model namespace
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the full namespace to your User model.
|
||||
| e.g. 'Acme\Entities\User'
|
||||
|
|
||||
*/
|
||||
|
||||
'user' => 'App\User',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| User identifier
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify a unique property of the user that will be added as the 'sub'
|
||||
| claim of the token payload.
|
||||
|
|
||||
*/
|
||||
|
||||
'identifier' => 'id',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Required Claims
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the required claims that must exist in any token.
|
||||
| A TokenInvalidException will be thrown if any of these claims are not
|
||||
| present in the payload.
|
||||
|
|
||||
*/
|
||||
|
||||
'required_claims' => ['iss', 'iat', 'exp', 'nbf', 'sub', 'jti'],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Blacklist Enabled
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| In order to invalidate tokens, you must have the blacklist enabled.
|
||||
| If you do not want or need this functionality, then set this to false.
|
||||
|
|
||||
*/
|
||||
|
||||
'blacklist_enabled' => env('JWT_BLACKLIST_ENABLED', true),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the various providers used throughout the package.
|
||||
|
|
||||
*/
|
||||
|
||||
'providers' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| User Provider
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the provider that is used to find the user based
|
||||
| on the subject claim
|
||||
|
|
||||
*/
|
||||
|
||||
'user' => 'Tymon\JWTAuth\Providers\User\EloquentUserAdapter',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| JWT Provider
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the provider that is used to create and decode the tokens.
|
||||
|
|
||||
*/
|
||||
|
||||
'jwt' => 'Tymon\JWTAuth\Providers\JWT\NamshiAdapter',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Provider
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the provider that is used to authenticate users.
|
||||
|
|
||||
*/
|
||||
|
||||
'auth' => 'Tymon\JWTAuth\Providers\Auth\IlluminateAuthAdapter',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Storage Provider
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the provider that is used to store tokens in the blacklist
|
||||
|
|
||||
*/
|
||||
|
||||
'storage' => 'Tymon\JWTAuth\Providers\Storage\IlluminateCacheAdapter',
|
||||
|
||||
],
|
||||
|
||||
];
|
Reference in New Issue
Block a user