-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: oauth2 session authentication hook
- Loading branch information
1 parent
ae97156
commit 4576a66
Showing
4 changed files
with
81 additions
and
6 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Distantmagic\Resonance; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Psr\Http\Message\ServerRequestInterface; | ||
|
||
final readonly class OAuth2UserSessionAuthenticated implements HttpInterceptableInterface | ||
{ | ||
private SwooleContextRequestResponseReader $swooleContextRequestResponseReader; | ||
|
||
/** | ||
* @psalm-taint-source file $templatePath | ||
*/ | ||
public function __construct( | ||
?ServerRequestInterface $request = null, | ||
?ResponseInterface $response = null, | ||
) { | ||
$this->swooleContextRequestResponseReader = new SwooleContextRequestResponseReader( | ||
request: $request, | ||
response: $response, | ||
); | ||
} | ||
|
||
public function getResponse(): ResponseInterface | ||
{ | ||
return $this->swooleContextRequestResponseReader->getResponse(); | ||
} | ||
|
||
public function getServerRequest(): ServerRequestInterface | ||
{ | ||
return $this->swooleContextRequestResponseReader->getServerRequest(); | ||
} | ||
} |