Skip to content

Commit 675c955

Browse files
committed
Update README
1 parent 56b6972 commit 675c955

File tree

1 file changed

+50
-37
lines changed

1 file changed

+50
-37
lines changed

README.md

+50-37
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
# Myth:Auth
22

3-
[![](https://github.com/lonnieezell/myth-auth/workflows/PHPUnit/badge.svg)](https://github.com/lonnieezell/myth-auth/actions?query=workflow%3A%22PHPUnit%22)
4-
[![](https://github.com/lonnieezell/myth-auth/workflows/PHPStan/badge.svg)](https://github.com/lonnieezell/myth-auth/actions?query=workflow%3A%22PHPStan%22)
3+
[![](https://github.com/lonnieezell/myth-auth/workflows/PHPUnit/badge.svg)](https://github.com/lonnieezell/myth-auth/actions/workflows/phpunit.yml)
4+
[![](https://github.com/lonnieezell/myth-auth/workflows/PHPStan/badge.svg)](https://github.com/lonnieezell/myth-auth/actions/workflows/phpstan.yml)
5+
[![](https://github.com/lonnieezell/myth-auth/workflows/Deptrac/badge.svg)](https://github.com/lonnieezell/myth-auth/actions/workflows/deptrac.yml)
56
[![Coverage Status](https://coveralls.io/repos/github/lonnieezell/myth-auth/badge.svg?branch=develop)](https://coveralls.io/github/lonnieezell/myth-auth?branch=develop)
67

78
Flexible, Powerful, Secure auth package for CodeIgniter 4.
89

9-
*This repo is maintained by volunteers. If you post an issue and haven't heard from us within 7 days, feel free to ping the issue so that we see it again.*
10+
## Project Notice
11+
12+
As of [June 2022](https://forum.codeigniter.com/showthread.php?tid=82003) CodeIgniter now has an official
13+
Authentication library, [CodeIgniter Shield](https://www.codeigniter.com/user_guide/libraries/official_packages.html#shield).
14+
If you are looking for an authentication solution for a new project then that is the recommended solution.
15+
16+
This project is now maintained by volunteers. If you interact with the project repository there may be delays
17+
in receiving response. Please direct support questions to [GitHub Discussions](https://github.com/lonnieezell/myth-auth/discussions)
18+
or to CodeIgniter's [Forums](https://forum.codeigniter.com/forumdisplay.php?fid=34) or [Slack Channel](https://codeigniterchat.slack.com/).
1019

1120
## Requirements
1221

13-
- PHP 7.3+, 8.0+
14-
- CodeIgniter 4.0.4+
22+
- PHP 7.4+, 8.0+
23+
- CodeIgniter 4.1+
1524

1625
## Features
1726

@@ -29,32 +38,30 @@ the following primary features:
2938

3039
Installation is best done via Composer. Assuming Composer is installed globally, you may use
3140
the following command:
32-
41+
```shell
3342
> composer require myth/auth
43+
```
3444

35-
This will add the latest stable release of **Myth\Auth** as a module to your project. Note that
36-
you may need to adjust your project's
37-
[minimum stability ](http://webtips.krajee.com/setting-composer-minimum-stability-application/)
38-
in order to use **Myth\Auth** while it is in beta.
45+
This will add the latest stable release of **Myth:Auth** as a module to your project.
3946

4047
### Manual Installation
4148

4249
Should you choose not to use Composer to install, you can clone or download this repo and
43-
then enable it by editing **app/Config/Autoload.php** and adding the **Myth\Auth**
44-
namespace to the **$psr4** array. For example, if you copied it into **app/ThirdParty**:
50+
then enable it by editing **app/Config/Autoload.php** and adding the `Myth\Auth`
51+
namespace to the `$psr4` array. For example, if you copied it into **app/ThirdParty/**:
4552
```php
4653
$psr4 = [
4754
'Config' => APPPATH . 'Config',
4855
APP_NAMESPACE => APPPATH,
4956
'App' => APPPATH,
50-
'Myth\Auth' => APPPATH .'ThirdParty/myth-auth/src',
57+
'Myth\Auth' => APPPATH . 'ThirdParty/myth-auth/src',
5158
];
5259
```
5360

5461
### Upgrading
5562

56-
Be sure to check the [Changes Docs](https://github.com/lonnieezell/myth-auth/blob/develop/docs/_changes.md) for
57-
necessary steps to take after upgrading versions.
63+
Be sure to check the [Changes Docs](https://github.com/lonnieezell/myth-auth/blob/develop/docs/_changes.md)
64+
for necessary steps to take after upgrading versions.
5865

5966
## Configuration
6067

@@ -68,8 +75,9 @@ In your application, perform the following setup:
6875
`\Myth\Auth\Authentication\Passwords\ValidationRules::class`
6976

7077
3. Ensure your database is setup correctly, then run the Auth migrations:
71-
78+
```shell
7279
> php spark migrate -all
80+
```
7381

7482
NOTE: This library uses your application's cache settings to reduce database lookups. If you want
7583
to make use of this, simply make sure that your are using a cache engine other than `dummy` and
@@ -88,26 +96,27 @@ by setting the `$allowRemembering` variable to be `true` in Config/Auth.php.
8896

8997
Routes are defined in Auth's **Config/Routes.php** file. This file is automatically located by CodeIgniter
9098
when it is processing the routes. If you would like to customize the routes, you should copy the file
91-
to the **app/Config** directory and make your changes there.
99+
to the **app/Config** directory, update the namespace, and make your route changes there. You
100+
may also use the `$reservedRoutes` property of `Config\Auth` to redirect internal route names.
92101

93102
### Views
94103

95-
Basic views are provided that are based on [Bootstrap 4](http://getbootstrap.com/) for all features.
104+
Basic views are provided that are based on [Bootstrap 4](https://getbootstrap.com/) for all features.
96105

97-
You can easily override the views used by editing Config/Auth.php, and changing the appropriate values
98-
within the `$views` variable:
106+
You can easily override the views used by editing **Config/Auth.php**, and changing the appropriate
107+
values within the `$views` variable:
99108

100109
public $views = [
101-
'login' => 'Myth\Auth\Views\login',
102-
'register' => 'Myth\Auth\Views\register',
103-
'forgot' => 'Myth\Auth\Views\forgot',
104-
'reset' => 'Myth\Auth\Views\reset',
110+
'login' => 'Myth\Auth\Views\login',
111+
'register' => 'Myth\Auth\Views\register',
112+
'forgot' => 'Myth\Auth\Views\forgot',
113+
'reset' => 'Myth\Auth\Views\reset',
105114
'emailForgot' => 'Myth\Auth\Views\emails\forgot',
106115
];
107116

108117
NOTE: If you're not familiar with how views can be namespaced in CodeIgniter, please refer to
109-
[the user guide](https://codeigniter4.github.io/CodeIgniter4/general/modules.html) for CI4's
110-
Code Module support.
118+
[the CodeIgniter User Guide](https://codeigniter.com/user_guide/general/modules.html) for section
119+
on Code Module support.
111120

112121
## Services
113122

@@ -117,48 +126,54 @@ The following Services are provided by the package:
117126

118127
Provides access to any of the authentication packages that Myth:Auth knows about. By default
119128
it will return the "Local Authentication" library, which is the basic password-based system.
120-
129+
```php
121130
$authenticate = service('authentication');
131+
```
122132

123133
You can specify the library to use as the first argument:
124-
134+
```php
125135
$authenticate = service('authentication', 'jwt');
126-
136+
```
137+
127138
**authorization**
128139

129140
Provides access to any of the authorization libraries that Myth:Auth knows about. By default
130141
it will return the "Flat" authorization library, which is a Flat RBAC (role-based access control)
131142
as defined by NIST. It provides user-specific permissions as well as group (role) based permissions.
132-
143+
```php
133144
$authorize = service('authorization');
145+
```
134146

135147
**passwords**
136148

137149
Provides direct access to the Password validation system. This is an expandable system that currently
138150
supports many of [NIST's latest Digital Identity guidelines](https://pages.nist.gov/800-63-3/). The
139151
validator comes with a dictionary of over 620,000 common/leaked passwords that can be checked against.
140152
A handful of variations on the user's email/username are automatically checked against.
141-
153+
```php
142154
$authenticate = service('passwords');
143-
155+
```
156+
144157
Most of the time you should not need to access this library directly, though, as a new Validation rule
145158
is provided that can be used with the Validation library, `strong_password`. In order to enable this,
146159
you must first edit **app/Config/Validation.php** and add the new ruleset to the available rule sets:
147-
160+
```php
148161
public $ruleSets = [
149162
\CodeIgniter\Validation\Rules::class,
150163
\CodeIgniter\Validation\FormatRules::class,
151164
\CodeIgniter\Validation\FileRules::class,
152165
\CodeIgniter\Validation\CreditCardRules::class,
153166
\Myth\Auth\Authentication\Passwords\ValidationRules::class,
154167
];
155-
156-
Now you can use `strong_password` in any set of rules for validation:
168+
```
157169

170+
Now you can use `strong_password` in any set of rules for validation:
171+
```php
158172
$validation->setRules([
159173
'username' => 'required',
160174
'password' => 'required|strong_password'
161175
]);
176+
```
162177

163178
## Helper Functions
164179

@@ -200,7 +215,6 @@ auth filters all pre-load the helper so it is available on any filtered routes.
200215
* Parameters: Permission ID or name.
201216
* Returns: `true` or `false`
202217

203-
204218
## Users
205219

206220
Myth:Auth uses [CodeIgniter Entities](https://codeigniter4.github.io/CodeIgniter4/models/entities.html)
@@ -215,7 +229,6 @@ or modify it as needed.
215229
The UserModel can automatically assign a role during user creation. Pass the group name to the
216230
`withGroup()` method prior to calling `insert()` or `save()` to create a new user and the user
217231
will be automatically added to that group.
218-
219232
```php
220233
$user = $userModel
221234
->withGroup('guests')

0 commit comments

Comments
 (0)