|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * Part of the Sentry bundle for Laravel. |
| 4 | + * |
| 5 | + * NOTICE OF LICENSE |
| 6 | + * |
| 7 | + * Licensed under the 3-clause BSD License. |
| 8 | + * |
| 9 | + * This source file is subject to the 3-clause BSD License that is |
| 10 | + * bundled with this package in the LICENSE file. It is also available at |
| 11 | + * the following URL: http://www.opensource.org/licenses/BSD-3-Clause |
| 12 | + * |
| 13 | + * @package Sentry |
| 14 | + * @version 1.0 |
| 15 | + * @author Cartalyst LLC |
| 16 | + * @license BSD License (3-clause) |
| 17 | + * @copyright (c) 2011 - 2012, Cartalyst LLC |
| 18 | + * @link http://cartalyst.com |
| 19 | + */ |
| 20 | + |
| 21 | +return array( |
| 22 | + |
| 23 | + /** |
| 24 | + * Database instance to use |
| 25 | + * Leave this null to use the default 'active' db instance |
| 26 | + * To use any other instance, set this to any instance that's defined in APPPATH/config/db.php |
| 27 | + */ |
| 28 | + 'db_instance' => null, |
| 29 | + |
| 30 | + /* |
| 31 | + * Table Names |
| 32 | + */ |
| 33 | + 'table' => array( |
| 34 | + 'users' => 'users', |
| 35 | + 'groups' => 'groups', |
| 36 | + 'users_groups' => 'users_groups', |
| 37 | + 'users_metadata' => 'users_metadata', |
| 38 | + 'users_suspended' => 'users_suspended', |
| 39 | + 'rules' => 'rules', |
| 40 | + ), |
| 41 | + |
| 42 | + /* |
| 43 | + * Session keys |
| 44 | + */ |
| 45 | + 'session' => array( |
| 46 | + 'user' => 'sentry_user', |
| 47 | + 'provider' => 'sentry_provider', |
| 48 | + ), |
| 49 | + |
| 50 | + /* |
| 51 | + * Default Authorization Column - username or email |
| 52 | + */ |
| 53 | + 'login_column' => 'email', |
| 54 | + |
| 55 | + /* |
| 56 | + * Remember Me settings |
| 57 | + */ |
| 58 | + 'remember_me' => array( |
| 59 | + |
| 60 | + /** |
| 61 | + * Cookie name credentials are stored in |
| 62 | + */ |
| 63 | + 'cookie_name' => 'sentry_rm', |
| 64 | + |
| 65 | + /** |
| 66 | + * How long the cookie should last. (seconds) |
| 67 | + */ |
| 68 | + 'expire' => 20160, // 2 weeks - minutes |
| 69 | + ), |
| 70 | + |
| 71 | + /** |
| 72 | + * Limit Number of Failed Attempts |
| 73 | + * Suspends a login/ip combo after a # of failed attempts for a set amount of time |
| 74 | + */ |
| 75 | + 'limit' => array( |
| 76 | + |
| 77 | + /** |
| 78 | + * enable limit - true/false |
| 79 | + */ |
| 80 | + 'enabled' => true, |
| 81 | + |
| 82 | + /** |
| 83 | + * number of attempts before suspensions |
| 84 | + */ |
| 85 | + 'attempts' => 5, |
| 86 | + |
| 87 | + /** |
| 88 | + * suspension length - minutes |
| 89 | + */ |
| 90 | + 'time' => 15, |
| 91 | + ), |
| 92 | + |
| 93 | + /** |
| 94 | + * Password Hashing |
| 95 | + * Sets hashing strategies for passwords |
| 96 | + * Note: you may have to adjust all password related fields in the database depending on the password hash length |
| 97 | + */ |
| 98 | + 'hash' => array( |
| 99 | + |
| 100 | + /** |
| 101 | + * Strategy to use |
| 102 | + * look into classes/sentry/hash/strategy for available strategies ( or make/import your own ) |
| 103 | + * Must be in strategies below |
| 104 | + */ |
| 105 | + 'strategy' => 'Sentry', |
| 106 | + |
| 107 | + /** |
| 108 | + * Convert hashes from another available strategy |
| 109 | + */ |
| 110 | + 'convert' => array( |
| 111 | + 'enabled' => false, |
| 112 | + 'from' => '', |
| 113 | + ), |
| 114 | + |
| 115 | + /** |
| 116 | + * Available Strategies for your app |
| 117 | + * This is used to set settings for conversion, like switching from SimpleAuth hashing to Sha256 or vice versa |
| 118 | + */ |
| 119 | + 'strategies' => array( |
| 120 | + /** |
| 121 | + * config options needed for hashing |
| 122 | + * example: |
| 123 | + * 'Strategy' => array(); // additional options needed for password hashing in your driver like a configurable salt |
| 124 | + */ |
| 125 | + |
| 126 | + 'Sentry' => array(), |
| 127 | + |
| 128 | + 'Oscommerce' => array( |
| 129 | + 'salt' => '', |
| 130 | + ), |
| 131 | + |
| 132 | + 'BCrypt' => array( |
| 133 | + 'strength' => 4, |
| 134 | + // if you want to use a bcrypt hash with an algorithm |
| 135 | + 'hashing_algorithm' => null, |
| 136 | + ), |
| 137 | + ), |
| 138 | + ), |
| 139 | + |
| 140 | + 'permissions' => array( |
| 141 | + |
| 142 | + /** |
| 143 | + * enable permissions - true or false |
| 144 | + */ |
| 145 | + 'enabled' => true, |
| 146 | + |
| 147 | + /** |
| 148 | + * super user - string |
| 149 | + * this will be used for the group and rules |
| 150 | + * if you change this, you need to make sure you change the |
| 151 | + */ |
| 152 | + 'superuser' => 'superuser', |
| 153 | + |
| 154 | + /** |
| 155 | + * Source of defined rules |
| 156 | + * Possible choices: file / database. |
| 157 | + * If file is chosen it reads the rules from config/sentry.php's permissions->rules array |
| 158 | + * If database is chosen it reads the rules from the rules table defined in the table array |
| 159 | + * |
| 160 | + */ |
| 161 | + 'rules_source' => 'file', |
| 162 | + |
| 163 | + /** |
| 164 | + * The permission rules file |
| 165 | + * Must return an array with a 'rules' key. |
| 166 | + */ |
| 167 | + 'file' => array( |
| 168 | + /** |
| 169 | + * Type options: config | php |
| 170 | + * |
| 171 | + * name and path are ignored if type is config |
| 172 | + * - name will be permissions |
| 173 | + * - path will be the bundles config folder |
| 174 | + * |
| 175 | + * name and path are required if type is php |
| 176 | + * - name will be the file name of the php file |
| 177 | + * - path will be relative to the current bundles base folder |
| 178 | + */ |
| 179 | + 'type' => 'php', |
| 180 | + 'name' => 'extension', |
| 181 | + 'path' => '', |
| 182 | + ), |
| 183 | + |
| 184 | + /** |
| 185 | + * !Ignored if database is selected instead of file! |
| 186 | + * |
| 187 | + * setup rules for permissions |
| 188 | + * These are resources that will require access permissions. |
| 189 | + * Rules are assigned to groups or specific users in the |
| 190 | + * format bundle::controller@method |
| 191 | + * |
| 192 | + * This is always used for global permissions |
| 193 | + */ |
| 194 | + 'rules' => array( |
| 195 | + /** |
| 196 | + * config samples. |
| 197 | + * |
| 198 | + * 'application::admin@dashboard', |
| 199 | + * 'user::admin@create', |
| 200 | + * 'user::admin@read', |
| 201 | + * 'blog::admin@delete', |
| 202 | + * 'my_custom_rule', |
| 203 | + * 'is_admin', |
| 204 | + */ |
| 205 | + 'is_admin', |
| 206 | + 'superuser', |
| 207 | + ), |
| 208 | + |
| 209 | + ), |
| 210 | + |
| 211 | +); |
0 commit comments