Commit a9d39cf6 authored by Nicolas Widart's avatar Nicolas Widart

Removing sentry support, setting up Sentinel as default

parent 334a08a2
......@@ -2,6 +2,6 @@
return [
'driver' => 'Sentry',
'driver' => 'Sentinel',
];
<?php
/**
* Part of the Sentinel package.
*
* NOTICE OF LICENSE
*
* Licensed under the 3-clause BSD License.
*
* This source file is subject to the 3-clause BSD License that is
* bundled with this package in the LICENSE file.
*
* @package Sentinel
* @version 2.0.4
* @author Cartalyst LLC
* @license BSD License (3-clause)
* @copyright (c) 2011-2015, Cartalyst LLC
* @link http://cartalyst.com
*/
return [
/*
|--------------------------------------------------------------------------
| Session Key
|--------------------------------------------------------------------------
|
| Please provide your session key for Sentinel.
|
*/
'session' => 'cartalyst_sentinel',
/*
|--------------------------------------------------------------------------
| Cookie Key
|--------------------------------------------------------------------------
|
| Please provide your cookie key for Sentinel.
|
*/
'cookie' => 'cartalyst_sentinel',
/*
|--------------------------------------------------------------------------
| Users
|--------------------------------------------------------------------------
|
| Please provide the user model used in Sentinel.
|
*/
'users' => [
'model' => 'Modules\User\Entities\Sentinel\User',
],
/*
|--------------------------------------------------------------------------
| Roles
|--------------------------------------------------------------------------
|
| Please provide the role model used in Sentinel.
|
*/
'roles' => [
'model' => 'Cartalyst\Sentinel\Roles\EloquentRole',
],
/*
|--------------------------------------------------------------------------
| Permissions
|--------------------------------------------------------------------------
|
| Here you may specify the permissions class. Sentinel ships with two
| permission types.
|
| 'Cartalyst\Sentinel\Permissions\StandardPermissions'
| 'Cartalyst\Sentinel\Permissions\StrictPermissions'
|
| "StandardPermissions" will assign a higher priority to the user
| permissions over role permissions, once a user is allowed or denied
| a specific permission, it will be used regardless of the
| permissions set on the role.
|
| "StrictPermissions" will deny any permission as soon as it finds it
| rejected on either the user or any of the assigned roles.
|
*/
'permissions' => [
'class' => 'Cartalyst\Sentinel\Permissions\StandardPermissions',
],
/*
|--------------------------------------------------------------------------
| Persistences
|--------------------------------------------------------------------------
|
| Here you may specify the persistences model used and weather to use the
| single persistence mode.
|
*/
'persistences' => [
'model' => 'Cartalyst\Sentinel\Persistences\EloquentPersistence',
'single' => false,
],
/*
|--------------------------------------------------------------------------
| Checkpoints
|--------------------------------------------------------------------------
|
| When logging in, checking for existing sessions and failed logins occur,
| you may configure an indefinite number of "checkpoints". These are
| classes which may respond to each event and handle accordingly.
| We ship with two, a throttling checkpoint and an activation
| checkpoint. Feel free to add, remove or re-order
| these.
|
*/
'checkpoints' => [
'throttle',
'activation',
],
/*
|--------------------------------------------------------------------------
| Activations
|--------------------------------------------------------------------------
|
| Here you may specify the activations model used and the time (in seconds)
| which activation codes expire. By default, activation codes expire after
| three days. The lottery is used for garbage collection, expired
| codes will be cleared automatically based on the provided odds.
|
*/
'activations' => [
'model' => 'Cartalyst\Sentinel\Activations\EloquentActivation',
'expires' => 259200,
'lottery' => [2, 100],
],
/*
|--------------------------------------------------------------------------
| Reminders
|--------------------------------------------------------------------------
|
| Here you may specify the reminders model used and the time (in seconds)
| which reminder codes expire. By default, reminder codes expire
| after four hours. The lottery is used for garbage collection, expired
| codes will be cleared automatically based on the provided odds.
|
*/
'reminders' => [
'model' => 'Cartalyst\Sentinel\Reminders\EloquentReminder',
'expires' => 14400,
'lottery' => [2, 100],
],
/*
|--------------------------------------------------------------------------
| Throttling
|--------------------------------------------------------------------------
|
| Here, you may configure your site's throttling settings. There are three
| types of throttling.
|
| The first type is "global". Global throttling will monitor the overall
| failed login attempts across your site and can limit the effects of an
| attempted DDoS attack.
|
| The second type is "ip". This allows you to throttle the failed login
| attempts (across any account) of a given IP address.
|
| The third type is "user". This allows you to throttle the login attempts
| on an individual user account.
|
| Each type of throttling has the same options. The first is the interval.
| This is the time (in seconds) for which we check for failed logins. Any
| logins outside this time are no longer assessed when throttling.
|
| The second option is thresholds. This may be approached one of two ways.
| the first way, is by providing an key/value array. The key is the number
| of failed login attempts, and the value is the delay, in seconds, before
| the next attempt can occur.
|
| The second way is by providing an integer. If the number of failed login
| attempts outweigh the thresholds integer, that throttle is locked until
| there are no more failed login attempts within the specified interval.
|
| On this premise, we encourage you to use array thresholds for global
| throttling (and perhaps IP throttling as well), so as to not lock your
| whole site out for minutes on end because it's being DDoS'd. However,
| for user throttling, locking a single account out because somebody is
| attempting to breach it could be an appropriate response.
|
| You may use any type of throttling for any scenario, and the specific
| configurations are designed to be customized as your site grows.
|
*/
'throttling' => [
'model' => 'Cartalyst\Sentinel\Throttling\EloquentThrottle',
'global' => [
'interval' => 900,
'thresholds' => [
10 => 1,
20 => 2,
30 => 4,
40 => 8,
50 => 16,
60 => 12
],
],
'ip' => [
'interval' => 900,
'thresholds' => 5,
],
'user' => [
'interval' => 900,
'thresholds' => 5,
],
],
];
<?php
/**
* Part of the Sentry package.
*
* NOTICE OF LICENSE
*
* Licensed under the 3-clause BSD License.
*
* This source file is subject to the 3-clause BSD License that is
* bundled with this package in the LICENSE file. It is also available at
* the following URL: http://www.opensource.org/licenses/BSD-3-Clause
*
* @package Sentry
* @version 2.0.0
* @author Cartalyst LLC
* @license BSD License (3-clause)
* @copyright (c) 2011 - 2013, Cartalyst LLC
* @link http://cartalyst.com
*/
return array(
/*
|--------------------------------------------------------------------------
| Default Authentication Driver
|--------------------------------------------------------------------------
|
| This option controls the authentication driver that will be utilized.
| This drivers manages the retrieval and authentication of the users
| attempting to get access to protected areas of your application.
|
| Supported: "eloquent" (more coming soon).
|
*/
'driver' => 'eloquent',
/*
|--------------------------------------------------------------------------
| Default Hasher
|--------------------------------------------------------------------------
|
| This option allows you to specify the default hasher used by Sentry
|
| Supported: "native", "bcrypt", "sha256", "whirlpool"
|
*/
'hasher' => 'native',
/*
|--------------------------------------------------------------------------
| Cookie
|--------------------------------------------------------------------------
|
| Configuration specific to the cookie component of Sentry.
|
*/
'cookie' => array(
/*
|--------------------------------------------------------------------------
| Default Cookie Key
|--------------------------------------------------------------------------
|
| This option allows you to specify the default cookie key used by Sentry.
|
| Supported: string
|
*/
'key' => 'cartalyst_sentry',
),
/*
|--------------------------------------------------------------------------
| Groups
|--------------------------------------------------------------------------
|
| Configuration specific to the group management component of Sentry.
|
*/
'groups' => array(
/*
|--------------------------------------------------------------------------
| Model
|--------------------------------------------------------------------------
|
| When using the "eloquent" driver, we need to know which
| Eloquent models should be used throughout Sentry.
|
*/
'model' => 'Cartalyst\Sentry\Groups\Eloquent\Group',
),
/*
|--------------------------------------------------------------------------
| Users
|--------------------------------------------------------------------------
|
| Configuration specific to the user management component of Sentry.
|
*/
'users' => array(
/*
|--------------------------------------------------------------------------
| Model
|--------------------------------------------------------------------------
|
| When using the "eloquent" driver, we need to know which
| Eloquent models should be used throughout Sentry.
|
*/
'model' => 'Modules\User\Entities\Sentry\User',
/*
|--------------------------------------------------------------------------
| Login Attribute
|--------------------------------------------------------------------------
|
| If you're using the "eloquent" driver and extending the base Eloquent
| model, we allow you to globally override the login attribute without
| even subclassing the model, simply by specifying the attribute below.
|
*/
'login_attribute' => 'email',
),
/*
|--------------------------------------------------------------------------
| User Groups Pivot Table
|--------------------------------------------------------------------------
|
| When using the "eloquent" driver, you can specify the table name
| for the user groups pivot table.
|
| Default: users_groups
|
*/
'user_groups_pivot_table' => 'users_groups',
/*
|--------------------------------------------------------------------------
| Throttling
|--------------------------------------------------------------------------
|
| Throttling is an optional security feature for authentication, which
| enables limiting of login attempts and the suspension & banning of users.
|
*/
'throttling' => array(
/*
|--------------------------------------------------------------------------
| Throttling
|--------------------------------------------------------------------------
|
| Enable throttling or not. Throttling is where users are only allowed a
| certain number of login attempts before they are suspended. Suspension
| must be removed before a new login attempt is allowed.
|
*/
'enabled' => true,
/*
|--------------------------------------------------------------------------
| Model
|--------------------------------------------------------------------------
|
| When using the "eloquent" driver, we need to know which
| Eloquent models should be used throughout Sentry.
|
*/
'model' => 'Cartalyst\Sentry\Throttling\Eloquent\Throttle',
/*
|--------------------------------------------------------------------------
| Attempts Limit
|--------------------------------------------------------------------------
|
| When using the "eloquent" driver and extending the base Eloquent model,
| you have the option to globally set the login attempts.
|
| Supported: int
|
*/
'attempt_limit' => 5,
/*
|--------------------------------------------------------------------------
| Suspension Time
|--------------------------------------------------------------------------
|
| When using the "eloquent" driver and extending the base Eloquent model,
| you have the option to globally set the suspension time, in minutes.
|
| Supported: int
|
*/
'suspension_time' => 15,
),
);
<?php
/**
* Part of the Sentry package.
*
* NOTICE OF LICENSE
*
* Licensed under the 3-clause BSD License.
*
* This source file is subject to the 3-clause BSD License that is
* bundled with this package in the LICENSE file. It is also available at
* the following URL: http://www.opensource.org/licenses/BSD-3-Clause
*
* @package Sentry
* @version 2.0.0
* @author Cartalyst LLC
* @license BSD License (3-clause)
* @copyright (c) 2011 - 2013, Cartalyst LLC
* @link http://cartalyst.com
*/
use Illuminate\Database\Migrations\Migration;
class MigrationCartalystSentryInstallUsers extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function($table)
{
$table->increments('id');
$table->string('email');
$table->string('password');
$table->text('permissions')->nullable();
$table->boolean('activated')->default(0);
$table->string('activation_code')->nullable();
$table->timestamp('activated_at')->nullable();
$table->timestamp('last_login')->nullable();
$table->string('persist_code')->nullable();
$table->string('reset_password_code')->nullable();
$table->string('first_name')->nullable();
$table->string('last_name')->nullable();
$table->timestamps();
// We'll need to ensure that MySQL uses the InnoDB engine to
// support the indexes, other engines aren't affected.
$table->engine = 'InnoDB';
$table->unique('email');
$table->index('activation_code');
$table->index('reset_password_code');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('users');
}
}
<?php
/**
* Part of the Sentry package.
*
* NOTICE OF LICENSE
*
* Licensed under the 3-clause BSD License.
*
* This source file is subject to the 3-clause BSD License that is
* bundled with this package in the LICENSE file. It is also available at
* the following URL: http://www.opensource.org/licenses/BSD-3-Clause
*
* @package Sentry
* @version 2.0.0
* @author Cartalyst LLC
* @license BSD License (3-clause)
* @copyright (c) 2011 - 2013, Cartalyst LLC
* @link http://cartalyst.com
*/
use Illuminate\Database\Migrations\Migration;
class MigrationCartalystSentryInstallGroups extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('groups', function($table)
{
$table->increments('id');
$table->string('name');
$table->text('permissions')->nullable();
$table->timestamps();
// We'll need to ensure that MySQL uses the InnoDB engine to
// support the indexes, other engines aren't affected.
$table->engine = 'InnoDB';
$table->unique('name');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('groups');
}
}
<?php
/**
* Part of the Sentry package.
*
* NOTICE OF LICENSE
*
* Licensed under the 3-clause BSD License.
*
* This source file is subject to the 3-clause BSD License that is
* bundled with this package in the LICENSE file. It is also available at
* the following URL: http://www.opensource.org/licenses/BSD-3-Clause
*
* @package Sentry
* @version 2.0.0
* @author Cartalyst LLC
* @license BSD License (3-clause)
* @copyright (c) 2011 - 2013, Cartalyst LLC
* @link http://cartalyst.com
*/
use Illuminate\Database\Migrations\Migration;
class MigrationCartalystSentryInstallUsersGroupsPivot extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users_groups', function($table)
{
$table->integer('user_id')->unsigned();
$table->integer('group_id')->unsigned();
// We'll need to ensure that MySQL uses the InnoDB engine to
// support the indexes, other engines aren't affected.
$table->engine = 'InnoDB';
$table->primary(array('user_id', 'group_id'));
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('users_groups');
}
}
<?php
/**
* Part of the Sentry package.
*
* NOTICE OF LICENSE
*
* Licensed under the 3-clause BSD License.
*
* This source file is subject to the 3-clause BSD License that is
* bundled with this package in the LICENSE file. It is also available at
* the following URL: http://www.opensource.org/licenses/BSD-3-Clause
*
* @package Sentry
* @version 2.0.0
* @author Cartalyst LLC
* @license BSD License (3-clause)
* @copyright (c) 2011 - 2013, Cartalyst LLC
* @link http://cartalyst.com
*/
use Illuminate\Database\Migrations\Migration;
class MigrationCartalystSentryInstallThrottle extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('throttle', function($table)
{
$table->increments('id');
$table->integer('user_id')->unsigned()->nullable();
$table->string('ip_address')->nullable();
$table->integer('attempts')->default(0);
$table->boolean('suspended')->default(0);
$table->boolean('banned')->default(0);
$table->timestamp('last_attempt_at')->nullable();
$table->timestamp('suspended_at')->nullable();
$table->timestamp('banned_at')->nullable();
// We'll need to ensure that MySQL uses the InnoDB engine to
// support the indexes, other engines aren't affected.
$table->engine = 'InnoDB';
$table->index('user_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('throttle');
}
}
<?php
/**
* Part of the Sentinel package.
*
* NOTICE OF LICENSE
*
* Licensed under the 3-clause BSD License.
*
* This source file is subject to the 3-clause BSD License that is
* bundled with this package in the LICENSE file.
*
* @package Sentinel
* @version 2.0.4
* @author Cartalyst LLC
* @license BSD License (3-clause)
* @copyright (c) 2011-2015, Cartalyst LLC
* @link http://cartalyst.com
*/
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class MigrationCartalystSentinel extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('activations', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->string('code');
$table->boolean('completed')->default(0);
$table->timestamp('completed_at')->nullable();
$table->timestamps();
$table->engine = 'InnoDB';
});
Schema::create('persistences', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->string('code');
$table->timestamps();
$table->engine = 'InnoDB';
$table->unique('code');
});
Schema::create('reminders', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->string('code');
$table->boolean('completed')->default(0);
$table->timestamp('completed_at')->nullable();
$table->timestamps();
});
Schema::create('roles', function (Blueprint $table) {
$table->increments('id');
$table->string('slug');
$table->string('name');
$table->text('permissions')->nullable();
$table->timestamps();
$table->engine = 'InnoDB';
$table->unique('slug');
});
Schema::create('role_users', function (Blueprint $table) {
$table->integer('user_id')->unsigned();
$table->integer('role_id')->unsigned();
$table->nullableTimestamps();
$table->engine = 'InnoDB';
$table->primary(['user_id', 'role_id']);
});
Schema::create('throttle', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned()->nullable();
$table->string('type');
$table->string('ip')->nullable();
$table->timestamps();
$table->engine = 'InnoDB';
$table->index('user_id');
});
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('email');
$table->string('password');
$table->text('permissions')->nullable();
$table->timestamp('last_login')->nullable();
$table->string('first_name')->nullable();
$table->string('last_name')->nullable();
$table->timestamps();
$table->engine = 'InnoDB';
$table->unique('email');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('activations');
Schema::drop('persistences');
Schema::drop('reminders');
Schema::drop('roles');
Schema::drop('role_users');
Schema::drop('throttle');
Schema::drop('users');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment