Skip to content

Commit 19052f3

Browse files
jlopes90lonnieezell
authored andcommitted
update install.md
1 parent 60c230e commit 19052f3

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

docs/install.md

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,32 @@ your project.
135135
1. Use InnoDB, not MyISAM.
136136

137137
## Controller Filters
138+
The [Controller Filters](https://codeigniter.com/user_guide/incoming/filters.html) you can use to protect your routes the shield provides are:
139+
140+
```php
141+
public $aliases = [
142+
// ...
143+
'session' => \CodeIgniter\Shield\Filters\SessionAuth::class,
144+
'tokens' => \CodeIgniter\Shield\Filters\TokenAuth::class,
145+
'chain' => \CodeIgniter\Shield\Filters\ChainAuth::class,
146+
'auth-rates' => \CodeIgniter\Shield\Filters\AuthRates::class,
147+
'group' => \CodeIgniter\Shield\Filters\GroupFilter::class,
148+
'permission' => \CodeIgniter\Shield\Filters\PermissionFilter::class,
149+
];
150+
```
151+
152+
Filters | Description
153+
--- | ---
154+
session and tokens | The `Session` and `AccessTokens` authenticators, respectively.
155+
chained | The filter will check both authenticators in sequence to see if the user is logged in through either of authenticators, allowing a single API endpoint to work for both an SPA using session auth, and a mobile app using access tokens.
156+
auth-rates | Provides a good basis for rate limiting of auth-related routes.
157+
group | Checks if the user is in one of the groups passed in.
158+
permission | Checks if the user has the passed permissions.
138159

139-
Shield provides 4 [Controller Filters](https://codeigniter.com/user_guide/incoming/filters.html) you can
140-
use to protect your routes, `session`, `tokens`, and `chained`. The first two cover the `Session` and
141-
`AccessTokens` authenticators, respectively. The `chained` filter will check both authenticators in sequence
142-
to see if the user is logged in through either of authenticators, allowing a single API endpoint to
143-
work for both an SPA using session auth, and a mobile app using access tokens. The fourth, `auth-rates`,
144-
provides a good basis for rate limiting of auth-related routes.
145160
These can be used in any of the [normal filter config settings](https://codeigniter.com/user_guide/incoming/filters.html?highlight=filter#globals), or [within the routes file](https://codeigniter.com/user_guide/incoming/routing.html?highlight=routs#applying-filters).
146161

162+
> **Note** These filters are already loaded for you by the registrar class located at `src/Config/Registrar.php`.
163+
147164
### Protect All Pages
148165

149166
If you want to limit all routes (e.g. `localhost:8080/admin`, `localhost:8080/panel` and ...), you need to add the following code in the `app/Config/Filters.php` file.
@@ -158,18 +175,6 @@ public $globals = [
158175
];
159176
```
160177

161-
> **Note** These filters are already loaded for you by the registrar class located at `src/Config/Registrar.php`.
162-
163-
```php
164-
public $aliases = [
165-
// ...
166-
'session' => \CodeIgniter\Shield\Filters\SessionAuth::class,
167-
'tokens' => \CodeIgniter\Shield\Filters\TokenAuth::class,
168-
'chain' => \CodeIgniter\Shield\Filters\ChainAuth::class,
169-
'auth-rates' => \CodeIgniter\Shield\Filters\AuthRates::class,
170-
];
171-
```
172-
173178
### Rate Limiting
174179

175180
To help protect your authentication forms from being spammed by bots, it is recommended that you use

0 commit comments

Comments
 (0)