Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added the auth scheme name to the authentication result * Added policy name to AuthorizationResult * Fixed missing arg * Fixed Psalm errors * Renamed a class and method * Fixed misleading comment * WIP * Fixed scheme name usage * Fixed a bunch of Psalm errors * Fixed tests * Ran linter * Fixed more Psalm issues * Updated CHANGELOG * Updated Authenticator to accept multiple scheme names, still need to refactor middleware to use that and to actually set user in accessor * Fixed tests
- Loading branch information
1 parent
ffbd3cc
commit f0440aa
Showing
27 changed files
with
586 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/Authentication/src/AggregateAuthenticationException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
/** | ||
* Aphiria | ||
* | ||
* @link https://www.aphiria.com | ||
* @copyright Copyright (C) 2023 David Young | ||
* @license https://github.com/aphiria/aphiria/blob/1.x/LICENSE.md | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Aphiria\Authentication; | ||
|
||
use Exception; | ||
|
||
/** | ||
* Defines an exception that aggregates multiple authentication exceptions | ||
*/ | ||
final class AggregateAuthenticationException extends Exception | ||
{ | ||
/** @var list<Exception> The list of exceptions that created this exception */ | ||
public readonly array $innerExceptions; | ||
|
||
/** | ||
* @param string $message The message to set | ||
* @param Exception|list<Exception> $exceptions The exception or list of exceptions to aggregate | ||
*/ | ||
public function __construct(string $message, Exception|array $exceptions) | ||
{ | ||
parent::__construct($message); | ||
|
||
$this->innerExceptions = $exceptions instanceof Exception ? [$exceptions] : $exceptions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.