-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add samesite csrf protection to sessionMiddleware, csp + cors middleware
- Loading branch information
Showing
11 changed files
with
130 additions
and
12 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
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,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Glued\Mail\Controllers; | ||
|
||
use Psr\Http\Message\ResponseInterface as Response; | ||
use Psr\Http\Message\ServerRequestInterface as Request; | ||
use Glued\Core\Controllers\AbstractTwigController; | ||
use Respect\Validation\Validator as v; | ||
|
||
class MailController extends AbstractTwigController | ||
{ | ||
/** | ||
* @param Request $request | ||
* @param Response $response | ||
* @param array $args | ||
* | ||
* @return Response | ||
*/ | ||
public function __invoke(Request $request, Response $response, array $args = []): Response | ||
{ | ||
return $this->render($response, 'Mail/Views/opera.twig', [ | ||
'pageTitle' => 'Opera', | ||
]); | ||
} | ||
} |
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,21 @@ | ||
{% extends '/Core/Views/templates/default.twig' %} | ||
|
||
{% block content %} | ||
<section class="section"> | ||
<div class="section-header"> | ||
<h1>{{ __('Hello, dear') }} {{ name | default(__('Anonymous')) }}</h1> | ||
</div> | ||
|
||
<div class="section-body"> | ||
{{ __('Let\'s stick together.') }} | ||
<form id="spider_browse_fetch" onsubmit="changeUri()"> | ||
<input type="text" name="uri"> | ||
<input type="submit" value="Fetch"> | ||
</form> | ||
<br /> | ||
uri: <a href="{{ uri }}">{{ uri }}</a> <br /> | ||
uri valid: {{ validate }} <br /> | ||
<img width="300" src="{{ screenshot }}"> | ||
</div> | ||
</section> | ||
{% endblock %} |
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,13 @@ | ||
<?php | ||
use Slim\Routing\RouteCollectorProxy; | ||
use Glued\Mail\Controllers\MailController; | ||
use Glued\Core\Middleware\RedirectIfAuthenticated; | ||
use Glued\Core\Middleware\RedirectIfNotAuthenticated; | ||
use Psr\Http\Message\ResponseInterface as Response; | ||
use Psr\Http\Message\ServerRequestInterface as Request; | ||
|
||
// Define the app routes. | ||
$app->group('/mail', function (RouteCollectorProxy $group) { | ||
$group->get ('/accounts[/{uri}]', MailController::class)->setName('mail.accounts.web'); // ->add(new RedirectIfNotAuthenticated()); | ||
$group->get ('/opera[/{uri}]', MailController::class)->setName('mail.opera.web'); // ->add(new RedirectIfNotAuthenticated()); | ||
}); |
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