yard/brave-csp

Content Security Policy for Brave sites

Installs: 12

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 3

Type:package

pkg:composer/yard/brave-csp

v1.1.5 2025-12-05 12:06 UTC

This package is auto-updated.

Last update: 2025-12-05 12:10:04 UTC


README

Installation

composer require yard/brave-csp

Features

This repository contains a basic Content Security Policy (CSP):

Yard\Csp\Policies\Basic::class

This Policy extends:

Spatie\Csp\Policies\Policy::class

Usage

This policy can be registered in the csp config file provided by the spatie/laravel-csp package:

<?php

declare(strict_types=1);

return [

    /*
     * A policy will determine which CSP headers will be set. A valid CSP policy is
     * any class that extends `Spatie\Csp\Policies\Policy`
     */
    'policy' => Yard\Csp\Policies\Basic::class,
    
    ...
];

It can also be extended to create a custom policy:

<?php

declare(strict_types=1);

namespace App\Csp;

use Yard\Csp\Policies\Basic;

class Policy extends Basic
{
    public function configure()
    {
        parent::configure();

        // Add site specific csp directives below
    }
}

In this case the policy config should point to this custom policy:

<?php

declare(strict_types=1);

return [

    /*
     * A policy will determine which CSP headers will be set. A valid CSP policy is
     * any class that extends `Spatie\Csp\Policies\Policy`
     */
    'policy' => App\Csp\Policy::class,

    ...
];

About us

banner