Skip to content

Commit 8f885d2

Browse files
authored
Merge pull request #605 from kenjis/fix-docs-file-paths
docs: make file paths bold
2 parents 0da847b + 37ed756 commit 8f885d2

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

docs/authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ user_id();
6565

6666
> **Note**
6767
> The `auth_helper` is autoloaded by Composer. If you want to *override* the functions,
68-
> you need to define them in `app/Common.php`.
68+
> you need to define them in **app/Common.php**.
6969
7070
## Authenticator Responses
7171

docs/authorization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ group elsewhere, like checking if `$user->inGroup('superadmin')`. By default, th
5050
### Default User Group
5151

5252
When a user is first registered on the site, they are assigned to a default user group. This group is defined in
53-
`app/config/AuthGroups::defaultGroup`, and must match the name of one of the defined groups.
53+
`Config\AuthGroups::$defaultGroup`, and must match the name of one of the defined groups.
5454

5555
```php
5656
public $defaultGroup = 'users';
@@ -132,7 +132,7 @@ if (! $user->hasPermission('users.create')) {
132132

133133
#### Authorizing via Filters
134134

135-
You can restrict access to multiple routes through a [Controller Filter](https://codeigniter.com/user_guide/incoming/filters.html). One is provided for both restricting via groups the user belongs to, as well as which permission they need. The filters are automatically registered with the system under the `group` and `permission` aliases, respectively. You can define the protections within `app/Config/Filters.php`:
135+
You can restrict access to multiple routes through a [Controller Filter](https://codeigniter.com/user_guide/incoming/filters.html). One is provided for both restricting via groups the user belongs to, as well as which permission they need. The filters are automatically registered with the system under the `group` and `permission` aliases, respectively. You can define the protections within **app/Config/Filters.php**:
136136

137137
```php
138138
public $filters = [

docs/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Shield fires off several events during the lifecycle of the application that you
1414

1515
## Responding to Events
1616

17-
When you want to respond to an event that Shield publishes, you will need to add it to your `app/Config/Events.php`
17+
When you want to respond to an event that Shield publishes, you will need to add it to your **app/Config/Events.php**
1818
file. Each of the following events provides a sample for responding that uses a class and method name.
1919
Other methods are available. See the [CodeIgniter 4 User Guide](https://codeigniter.com/user_guide/extending/events.html)
2020
for more information.

docs/guides/api_tokens.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Access Tokens can be used to authenticate users for your own site, or when allowing third-party developers to access your API. When making requests using access tokens, the token should be included in the `Authorization` header as a `Bearer` token.
44

5-
> **Note** By default, `$authenticatorHeader['tokens']` is set to `Authorization`. You can change this value by setting the `$authenticatorHeader['tokens']` value in the `Auth.php` config file.
5+
> **Note** By default, `$authenticatorHeader['tokens']` is set to `Authorization`. You can change this value by setting the `$authenticatorHeader['tokens']` value in the **app/Config/Auth.php** config file.
66
77
Tokens are issued with the `generateAccessToken()` method on the user. This returns a `CodeIgniter\Shield\Entities\AccessToken` instance. Tokens are hashed using a SHA-256 algorithm before being saved to the database. The access token returned when you generate it will include a `raw_token` field that contains the plain-text, un-hashed, token. You should display this to your user at once so they have a chance to copy it somewhere safe, as this is the only time this will be available. After this request, there is no way to get the raw token.
88

@@ -57,7 +57,7 @@ $user->revokeAllAccessTokens();
5757

5858
The first way to specify which routes are protected is to use the `tokens` controller filter.
5959

60-
For example, to ensure it protects all routes under the `/api` route group, you would use the `$filters` setting on `app/Config/Filters.php`.
60+
For example, to ensure it protects all routes under the `/api` route group, you would use the `$filters` setting on **app/Config/Filters.php**.
6161

6262
```php
6363
public $filters = [

docs/guides/mobile_apps.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Mobile Authentication with Access Tokens
22

3-
Access Tokens can be used to authenticate mobile applications that are consuming your API. This is similar to how you would work with [third-party users](api_tokens.md) of your API, but with small differences in how you would issue the tokens.
3+
Access Tokens can be used to authenticate mobile applications that are consuming your API. This is similar to how you would work with [third-party users](./api_tokens.md) of your API, but with small differences in how you would issue the tokens.
44

55
## Issuing the Tokens
66

@@ -61,6 +61,6 @@ When making all future requests to the API, the mobile client should return the
6161

6262
> **Note**
6363
>
64-
> By default, `$authenticatorHeader['tokens']` is set to `Authorization`. You can change the header name by setting the `$authenticatorHeader['tokens']` value in the `Auth.php` config file.
64+
> By default, `$authenticatorHeader['tokens']` is set to `Authorization`. You can change the header name by setting the `$authenticatorHeader['tokens']` value in the **app/Config/Auth.php** config file.
6565
>
6666
> e.g. if `$authenticatorHeader['tokens']` is set to `PersonalAccessCodes` then the mobile client should return the raw token in the `PersonalAccessCodes` header as a `Bearer` token.

docs/install.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- [Protect All Pages](#protect-all-pages)
1313
- [Rate Limiting](#rate-limiting)
1414

15-
These instructions assume that you have already [installed the CodeIgniter 4 app starter](https://codeigniter.com/user_guide/installation/installing_composer.html) as the basis for your new project, set up your `.env` file, and created a database that you can access via the Spark CLI script.
15+
These instructions assume that you have already [installed the CodeIgniter 4 app starter](https://codeigniter.com/user_guide/installation/installing_composer.html) as the basis for your new project, set up your **.env** file, and created a database that you can access via the Spark CLI script.
1616

1717
## Requirements
1818

@@ -54,14 +54,14 @@ Require it with an explicit version constraint allowing its desired stability.
5454
```
5555

5656
The above specifies `develop` branch.
57-
See https://getcomposer.org/doc/articles/versions.md#branches
57+
See <https://getcomposer.org/doc/articles/versions.md#branches>
5858

5959
```console
6060
composer require codeigniter4/shield:^1.0.0-beta
6161
```
6262

6363
The above specifies `v1.0.0-beta` or later and before `v2.0.0`.
64-
See https://getcomposer.org/doc/articles/versions.md#caret-version-range-
64+
See <https://getcomposer.org/doc/articles/versions.md#caret-version-range->
6565

6666
## Initial Setup
6767

@@ -73,7 +73,7 @@ Require it with an explicit version constraint allowing its desired stability.
7373
php spark shield:setup
7474
```
7575

76-
2. Configure `app/Config/Email.php` to allow Shield to send emails with the [Email Class](https://codeigniter.com/user_guide/libraries/email.html).
76+
2. Configure **app/Config/Email.php** to allow Shield to send emails with the [Email Class](https://codeigniter.com/user_guide/libraries/email.html).
7777

7878
```php
7979
<?php
@@ -103,7 +103,7 @@ Require it with an explicit version constraint allowing its desired stability.
103103
There are a few setup items to do before you can start using Shield in
104104
your project.
105105

106-
1. Copy the `Auth.php` and `AuthGroups.php` from `vendor/codeigniter4/shield/src/Config/` into your project's config folder and update the namespace to `Config`. You will also need to have these classes extend the original classes. See the example below. These files contain all of the settings, group, and permission information for your application and will need to be modified to meet the needs of your site.
106+
1. Copy the **Auth.php** and **AuthGroups.php** from **vendor/codeigniter4/shield/src/Config/** into your project's config folder and update the namespace to `Config`. You will also need to have these classes extend the original classes. See the example below. These files contain all of the settings, group, and permission information for your application and will need to be modified to meet the needs of your site.
107107

108108
```php
109109
// new file - app/Config/Auth.php
@@ -120,7 +120,7 @@ your project.
120120
}
121121
```
122122

123-
2. **Helper Setup** The `setting` helper needs to be included in almost every page. The simplest way to do this is to add it to the `BaseController::initController` method:
123+
2. **Helper Setup** The `setting` helper needs to be included in almost every page. The simplest way to do this is to add it to the `BaseController::initController()` method:
124124

125125
```php
126126
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
@@ -134,13 +134,13 @@ your project.
134134

135135
This requires that all of your controllers extend the `BaseController`, but that's a good practice anyway.
136136

137-
3. **Routes Setup** The default auth routes can be setup with a single call in `app/Config/Routes.php`:
137+
3. **Routes Setup** The default auth routes can be setup with a single call in **app/Config/Routes.php**:
138138

139139
```php
140140
service('auth')->routes($routes);
141141
```
142142

143-
4. **Security Setup** Set `Config\Security::$csrfProtection` to `'session'` (or set `security.csrfProtection = session` in your `.env` file) for security reasons, if you use Session Authenticator.
143+
4. **Security Setup** Set `Config\Security::$csrfProtection` to `'session'` (or set `security.csrfProtection = session` in your **.env** file) for security reasons, if you use Session Authenticator.
144144

145145
5. **Migration** Run the migrations.
146146

@@ -152,14 +152,14 @@ your project.
152152

153153
When you run `spark migrate --all`, if you get `Class "SQLite3" not found` error:
154154

155-
1. Remove sample migration files in `tests/_support/Database/Migrations/`
155+
1. Remove sample migration files in **tests/_support/Database/Migrations/**
156156
2. Or install `sqlite3` php extension
157157

158158
If you get `Specified key was too long` error:
159159

160160
1. Use InnoDB, not MyISAM.
161161

162-
6. Configure `app/Config/Email.php` to allow Shield to send emails.
162+
6. Configure **app/Config/Email.php** to allow Shield to send emails.
163163

164164
```php
165165
<?php
@@ -207,13 +207,13 @@ auth-rates | Provides a good basis for rate limiting of auth-related routes.
207207
group | Checks if the user is in one of the groups passed in.
208208
permission | Checks if the user has the passed permissions.
209209

210-
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).
210+
These can be used in any of the [normal filter config settings](https://codeigniter.com/user_guide/incoming/filters.html#globals), or [within the routes file](https://codeigniter.com/user_guide/incoming/routing.html#applying-filters).
211211

212-
> **Note** These filters are already loaded for you by the registrar class located at `src/Config/Registrar.php`.
212+
> **Note** These filters are already loaded for you by the registrar class located at **src/Config/Registrar.php**.
213213
214214
### Protect All Pages
215215

216-
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.
216+
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.
217217

218218
```php
219219
public $globals = [
@@ -241,7 +241,7 @@ public $filters = [
241241
];
242242
```
243243

244-
> **Note** If you have grouped or changed the default format of the routes, ensure that your code matches the new format(s) in the `App/Config/Filter.php` file.
244+
> **Note** If you have grouped or changed the default format of the routes, ensure that your code matches the new format(s) in the **app/Config/Filter.php** file.
245245
246246
For example, if you configured your routes like so:
247247

@@ -260,4 +260,4 @@ public $globals = [
260260
]
261261
]
262262
```
263-
The same should apply for the Rate Limiting.
263+
The same should apply for the Rate Limiting.

0 commit comments

Comments
 (0)