diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..7375406 --- /dev/null +++ b/CHANGELOG.md @@ -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 diff --git a/Plugin.php b/Plugin.php index 7b1d540..76b073c 100644 --- a/Plugin.php +++ b/Plugin.php @@ -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 { @@ -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 diff --git a/README.md b/README.md index 6f31d69..499eb2d 100644 --- a/README.md +++ b/README.md @@ -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 `` section: diff --git a/composer.json b/composer.json index 10114d4..1faf35f 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,6 @@ ], "require": { "php": "^7.4 || ^8.0", - "composer/installers": "^1.0" + "composer/installers": "^1.0 || ^2.0" } } diff --git a/ServiceProvider.php b/serviceproviders/CsrfServiceProvider.php similarity index 80% rename from ServiceProvider.php rename to serviceproviders/CsrfServiceProvider.php index fae6dfa..6f52dfe 100644 --- a/ServiceProvider.php +++ b/serviceproviders/CsrfServiceProvider.php @@ -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; @@ -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 diff --git a/updates/version.yaml b/updates/version.yaml index 1ab17cf..0d32145 100644 --- a/updates/version.yaml +++ b/updates/version.yaml @@ -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"