Skip to content

Commit

Permalink
Merge branch 'release/2.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
adrenth committed Sep 14, 2021
2 parents acac849 + e24df9e commit d6837fa
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 7 deletions.
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.2] - 2021-09-14

### Changed
- Location of CsrfServiceProvider to comply to internal plugin standards.
- Update Plugin documentation.
- Change version constraint for package `composer/installers`.

### Added
- Changelog file.

## [2.0.1] - 2021-07-13

### Fixes
- Location of plugin config.php file

## [2.0.0] - 2021-07-13

### Added
- Support for PHP 7.4 or higher.

## [1.1.2] - 2021-05-28

### Changed
- Update plugin dependencies.

## [1.1.1] - 2020-06-08

### Fixes
- Prevent error on CSRF token conversion.

## [1.1.0] - 2019-10-09

### Added
- Added configuration to exclude paths from CSRF validation.

## [1.0.0] - 2019-07-19

- First version of Vdlp.Csrf
3 changes: 2 additions & 1 deletion Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Cms\Classes\CmsController;
use System\Classes\PluginBase;
use Vdlp\Csrf\Middleware\VerifyCsrfTokenMiddleware;
use Vdlp\Csrf\ServiceProviders\CsrfServiceProvider;

final class Plugin extends PluginBase
{
Expand All @@ -30,7 +31,7 @@ public function boot(): void

public function register(): void
{
$this->app->register(ServiceProvider::class);
$this->app->register(CsrfServiceProvider::class);
}

public function registerMarkupTags(): array
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ composer require vdlp/oc-csrf-plugin
Add the plugin configuration to your config folder:

```
php artisan vendor:publish --provider="Vdlp\Csrf\ServiceProvider" --tag="config"
php artisan vendor:publish --provider="Vdlp\Csrf\ServiceProviders\CsrfServiceProvider" --tag="vdlp-csrf-config"
```

Add the CSRF token to the `<head>` section:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
],
"require": {
"php": "^7.4 || ^8.0",
"composer/installers": "^1.0"
"composer/installers": "^1.0 || ^2.0"
}
}
10 changes: 6 additions & 4 deletions ServiceProvider.php → serviceproviders/CsrfServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Vdlp\Csrf;
namespace Vdlp\Csrf\ServiceProviders;

use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Encryption\Encrypter;
Expand All @@ -11,13 +11,15 @@
use October\Rain\Support\ServiceProvider as ServiceProviderBase;
use Vdlp\Csrf\Middleware\VerifyCsrfTokenMiddleware;

final class ServiceProvider extends ServiceProviderBase
final class CsrfServiceProvider extends ServiceProviderBase
{
public function boot(): void
{
$this->publishes([
__DIR__ . '/config.php' => config_path('csrf.php'),
], 'config');
__DIR__ . '/../config.php' => config_path('csrf.php'),
], 'vdlp-csrf-config');

$this->mergeConfigFrom(__DIR__ . '/../config.php', 'csrf');
}

public function register(): void
Expand Down
1 change: 1 addition & 0 deletions updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
1.1.2: "Update plugin dependencies"
2.0.0: "Support for PHP 7.4 or higher"
2.0.1: "Fix location of plugin config.php file"
2.0.2: "Minor improvements -- See: CHANGELOG.md"

0 comments on commit d6837fa

Please sign in to comment.