marko/security

Security middleware for Marko Framework -- CSRF protection, CORS handling, and security headers

Maintainers

Package info

github.com/marko-php/marko-security

Type:marko-module

pkg:composer/marko/security

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

0.0.1 2026-03-25 17:53 UTC

This package is auto-updated.

Last update: 2026-03-25 21:07:32 UTC


README

CSRF protection, CORS handling, and security headers middleware -- secure your routes with drop-in middleware.

Installation

composer require marko/security

Quick Example

use Marko\Routing\Attributes\Post;
use Marko\Routing\Attributes\Middleware;
use Marko\Security\Middleware\CsrfMiddleware;

class FormController
{
    #[Post('/contact')]
    #[Middleware(CsrfMiddleware::class)]
    public function submit(): Response
    {
        // Token validated automatically
        return new Response('Submitted');
    }
}

Documentation

Full usage, API reference, and examples: marko/security