承接 jennchen/duckpatrol 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jennchen/duckpatrol

最新稳定版本:v1.0.3

Composer 安装命令:

composer require jennchen/duckpatrol

包简介

DuckPatrol is a PHP library designed to automatically protect your web applications from Cross-Site Request Forgery (CSRF) attacks.

README 文档

README

Overview

DuckPatrol is a PHP library developed to protect your plain PHP web applications from Cross-Site Request Forgery (CSRF) attacks. It offers a simple way to integrate CSRF protection into your projects by using Composer and providing a script for automation.

Requirements

  • PHP 7.4 or higher
  • Composer installation
  • Forms to be protected must be sent using the POST-method
  • To run the script, the PHP-process on the target system must have the required write permissions

Installation

Install DuckPatrol with Composer:

composer require jennchen/duckpatrol

Usage

There are two ways to initialize the DuckPatrol library.

Manual Initialization

One way is to manually integrate DuckPatrol into all pages you want to protect from CSRF attacks. You can do this by including the bootstrap.php file:

require_once 'path/to/vendor/jennchen/duckpatrol/bootstrap.php';

Automatic Initialization

The other way is to use the init_script.php. This script searches your entire project for PHP files that contain an HTML form with the POST method. In all these files, the bootstrap.php file will be automatically included.

To run the script, you need to navigate to the DuckPatrol folder, which is located in the vendor directory under 'jennchen'. Once you are in the library directory, you can run the script as follows:

php init_script.php

Script Configuration

If you want to set a custom root directory or exclude certain files from the script's process, you can do this in the config.php. All information on this can be found in the configuration file itself.

Acknowledgements

Thanks to everyone who supported me greatly during the creation of this library. A special thanks goes to:

  • Michael Kraftl
  • Michael Wagner
  • and everyone who helped with the name search <3

Author

Jennifer Kraftl - Developer - GitHub

License

This library is open-source software licensed under the MIT License.

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-22