Skip to content

Commit ea24ace

Browse files
authored
Merge pull request #37 from dotkernel/issue-36
Issue #36: Remove PHP 8.1 and add PHP 8.4 & 8.5 support
2 parents 7bbb5a1 + b7a2482 commit ea24ace

File tree

8 files changed

+32
-33
lines changed

8 files changed

+32
-33
lines changed

.github/workflows/codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
- ubuntu-latest
1616

1717
php:
18-
- "8.1"
1918
- "8.2"
2019
- "8.3"
2120
- "8.4"
21+
- "8.5"
2222

2323
steps:
2424
- name: Checkout

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
- ubuntu-latest
1616

1717
php:
18-
- "8.1"
1918
- "8.2"
2019
- "8.3"
2120
- "8.4"
21+
- "8.5"
2222

2323
steps:
2424
- name: Checkout

README.md

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

33
Core interfaces for authentication implementations.
44

5-
`dot-authentication` is Dotkernel's authentication base package which define interfaces for authentication services to be used with Dotkernel applications.
5+
`dot-authentication` is Dotkernel's authentication base package that defines interfaces for authentication services to be used with Dotkernel applications.
66

77
## Documentation
88

@@ -11,7 +11,7 @@ Documentation is available at: https://docs.dotkernel.org/dot-authentication/.
1111
## Badges
1212

1313
![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/dot-authentication)
14-
![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-authentication/2.6.0)
14+
![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-authentication/2.7.0)
1515

1616
[![GitHub issues](https://img.shields.io/github/issues/dotkernel/dot-authentication)](https://github.com/dotkernel/dot-authentication/issues)
1717
[![GitHub forks](https://img.shields.io/github/forks/dotkernel/dot-authentication)](https://github.com/dotkernel/dot-authentication/network)
@@ -24,18 +24,18 @@ Documentation is available at: https://docs.dotkernel.org/dot-authentication/.
2424

2525
## Installation
2626

27-
Run the following command in you project directory
27+
Run the following command in your project directory
2828

2929
```shell
3030
composer require dotkernel/dot-authentication
3131
```
3232

33-
Please note that usually this package will be installed as a dependency to a concrete implementation, so usually you won't need to add this to you project manually.
33+
Please note that usually this package will be installed as a dependency to a concrete implementation, so usually you won't need to add this to your project manually.
3434

3535
## AuthenticationInterface
3636

37-
Defines the interface that should be implemented by any authentication service, in order to work with Dotkernel applications.
38-
This is a result of the fact that the default packages used by Dotkernel applications, that need access to the authentication service are type-hinted against this interface.
37+
Defines the interface that should be implemented by any authentication service to work with Dotkernel applications.
38+
This is a result of the fact that the default packages used by Dotkernel applications that need access to the authentication service are type-hinted against this interface.
3939

4040
Also, concrete implementations should be registered in the service manager using this interface's FQN.
4141

@@ -47,14 +47,14 @@ public function authenticate(ServerRequestInterface $request): AuthenticationRes
4747

4848
This method is the implementation of the actual authentication process.
4949

50-
It should extract credentials from the `$request` object (Authorization header, custom request attributes etc.).
50+
It should extract credentials from the `$request` object (Authorization header, custom request attributes, etc.).
5151
It should return an `AuthenticationResult` object, defined in this package, which carry the authentication status and identity on success.
5252

5353
```php
5454
public function challenge(ServerRequestInterface $request): ResponseInterface;
5555
```
5656

57-
This method should return a valid PSR-7 `ResponseInterface` used to notify the client or browser that it needs to authenticate first(usually using the `WWW-Authenticate` header - useful for HTTP basic and digest authentication).
57+
This method should return a valid PSR-7 `ResponseInterface` used to notify the client or browser that it needs to authenticate first (usually using the `WWW-Authenticate` header - useful for HTTP basic and digest authentication).
5858

5959
```php
6060
public function hasIdentity(): bool;
@@ -63,12 +63,12 @@ public function setIdentity(IdentityInterface $identity);
6363
public function clearIdentity();
6464
```
6565

66-
These methods are used to check if authenticated, get the authenticated identity object, force set an identity(maybe useful for auto-login) or clear an identity(logout)
66+
These methods are used to check if authenticated, get the authenticated identity object, force set an identity (maybe useful for auto-login) or clear an identity (logout).
6767

6868
## IdentityInterface
6969

7070
You can use any object to represent an authenticated identity(user) as long as it implements this interface.
71-
It requires 2 methods, `getId()` which should return the unique identifier of the identity, and `getName(): string` which should return a string representation of the identity(for display purposes, usually the email or username).
71+
It requires two methods, `getId()` which should return the unique identifier of the identity, and `getName(): string` which should return a string representation of the identity (for display purposes, usually the email or username).
7272

7373
## AuthenticationResult
7474

@@ -77,7 +77,7 @@ It composes one of the predefined authentication codes, which describes the auth
7777

7878
## UnauthorizedException
7979

80-
Exception to be thrown when accessing content that need authentication first.
81-
This can be used within an application to trigger an error and do a custom action(like redirecting to a login page).
82-
There is not a predefined way to handle this, Dotkernel packages use this exception paired with a custom error handler to handle unauthorized errors.
80+
Exception to be thrown when accessing content that needs authentication first.
81+
This can be used within an application to trigger an error and do a custom action (like redirecting to a login page).
82+
There is not a predefined way to handle this; Dotkernel packages use this exception paired with a custom error handler to handle unauthorized errors.
8383
When using the frontend or admin applications, this is already setup among the authentication/authorization packages, and throwing an UnauthorizedException from anywhere your application, it will redirect to the login page by default.

SECURITY.md

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

33
## Supported Versions
44

5-
65
| Version | Supported | PHP Version |
76
|---------|--------------------|--------------------------------------------------------------------------------------------------------------------|
8-
| 2.x | :white_check_mark: | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-authentication/2.3.4) |
7+
| 2.x | :white_check_mark: | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-authentication/2.7.0) |
98
| <= 1.x | :x: | |
109

1110
## Reporting Potential Security Issues
@@ -23,7 +22,7 @@ When reporting issues, please provide the following information:
2322
We request that you contact us via the email address above and give the
2423
project contributors a chance to resolve the vulnerability and issue a new
2524
release prior to any public exposure; this helps protect the project's
26-
users, and provides them with a chance to upgrade and/or update in order to
25+
users and provides them with a chance to upgrade and/or update to
2726
protect their applications.
2827

2928

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
],
1212
"require": {
13-
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
13+
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
1414
"psr/http-message": "^1.0 || ^2.0"
1515
},
1616
"require-dev": {
@@ -44,7 +44,7 @@
4444
],
4545
"cs-check": "phpcs",
4646
"cs-fix": "phpcbf",
47-
"test": "phpunit --colors=always",
48-
"static-analysis": "phpstan analyse --memory-limit 1G"
47+
"static-analysis": "phpstan analyse --memory-limit 1G",
48+
"test": "phpunit --colors=always"
4949
}
5050
}

docs/book/v2/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Configuration
22

3-
Please note that usually this package will be installed as a dependency to a concrete implementation, so usually you won't need to add this to you project manually.
3+
Please note that usually this package will be installed as a dependency to a concrete implementation, so usually you won't need to add this to your project manually.

docs/book/v2/overview.md

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

33
Core interfaces for authentication implementations.
44

5-
`dot-authentication` is Dotkernel's authentication base package which define interfaces for authentication services to be used with Dotkernel applications.
5+
`dot-authentication` is Dotkernel's authentication base package that defines interfaces for authentication services to be used with Dotkernel applications.
66

77
## Badges
88

99
![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/dot-authentication)
10-
![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-authentication/2.6.0)
10+
![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-authentication/2.7.0)
1111

1212
[![GitHub issues](https://img.shields.io/github/issues/dotkernel/dot-authentication)](https://github.com/dotkernel/dot-authentication/issues)
1313
[![GitHub forks](https://img.shields.io/github/forks/dotkernel/dot-authentication)](https://github.com/dotkernel/dot-authentication/network)

docs/book/v2/usage.md

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

33
## AuthenticationInterface
44

5-
Defines the interface that should be implemented by any authentication service, in order to work with Dotkernel applications.
6-
This is a result of the fact that the default packages used by Dotkernel applications, that need access to the authentication service are type-hinted against this interface.
5+
Defines the interface that should be implemented by any authentication service to work with Dotkernel applications.
6+
This is a result of the fact that the default packages used by Dotkernel applications that need access to the authentication service are type-hinted against this interface.
77

88
Also, concrete implementations should be registered in the service manager using this interface's FQN.
99

@@ -15,14 +15,14 @@ public function authenticate(ServerRequestInterface $request): AuthenticationRes
1515

1616
This method is the implementation of the actual authentication process.
1717

18-
It should extract credentials from the `$request` object (Authorization header, custom request attributes etc.).
18+
It should extract credentials from the `$request` object (Authorization header, custom request attributes, etc.).
1919
It should return an `AuthenticationResult` object, defined in this package, which carry the authentication status and identity on success.
2020

2121
```php
2222
public function challenge(ServerRequestInterface $request): ResponseInterface;
2323
```
2424

25-
This method should return a valid PSR-7 `ResponseInterface` used to notify the client or browser that it needs to authenticate first(usually using the `WWW-Authenticate` header - usefull for HTTP basic and digest authentication)
25+
This method should return a valid PSR-7 `ResponseInterface` used to notify the client or browser that it needs to authenticate first (usually using the `WWW-Authenticate` header - usefully for HTTP basic and digest authentication).
2626

2727
```php
2828
public function hasIdentity(): bool;
@@ -31,12 +31,12 @@ public function setIdentity(IdentityInterface $identity);
3131
public function clearIdentity();
3232
```
3333

34-
These methods are used to check if authenticated, get the authenticated identity object, force set an identity(maybe useful for auto-login) or clear an identity(logout).
34+
These methods are used to check if authenticated, get the authenticated identity object, force set an identity (maybe useful for auto-login) or clear an identity (logout).
3535

3636
## IdentityInterface
3737

3838
You can use any object to represent an authenticated identity(user) as long as it implements this interface.
39-
It requires 2 methods, `getId()` which should return the unique identifier of the identity, and `getName(): string` which should return a string representation of the identity(for display purposes, usually the email or username)
39+
It requires two methods, `getId()` which should return the unique identifier of the identity, and `getName(): string` which should return a string representation of the identity (for display purposes, usually the email or username).
4040

4141
## AuthenticationResult
4242

@@ -45,7 +45,7 @@ It composes one of the predefined authentication codes, which describes the auth
4545

4646
## UnauthorizedException
4747

48-
Exception to be thrown when accessing content that need authentication first.
49-
This can be used within an application to trigger an error and do a custom action(like redirecting to a login page).
50-
There is not a predefined way to handle this, Dotkernel packages use this exception paired with a custom error handler to handle unauthorized errors.
48+
Exception to be thrown when accessing content that needs authentication first.
49+
This can be used within an application to trigger an error and do a custom action (like redirecting to a login page).
50+
There is not a predefined way to handle this; Dotkernel packages use this exception paired with a custom error handler to handle unauthorized errors.
5151
When using the frontend or admin applications, this is already setup among the authentication/authorization packages, and throwing an UnauthorizedException from anywhere your application, it will redirect to the login page by default.

0 commit comments

Comments
 (0)