delboy1978uk/bone-firewall 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

delboy1978uk/bone-firewall

最新稳定版本:v1.4.0

Composer 安装命令:

composer require delboy1978uk/bone-firewall

包简介

Firewall package for Bone Framework

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License
build status Code Coverage Scrutinizer Code Quality

Firewall package for controlling Bone Framework vendor package routes.

installation

Use Composer

composer require delboy1978uk/bone-firewall

usage

Simply add to the config/packages.php

<?php

// use statements here
use Bone\Firewall\Firewall\FirewallPackage;

return [
    'packages' => [
        // packages here...,
        FirewallPackage::class,
    ],
    // ...
];

blocking routes

And add a list of blockedRoutes to your config. As an example here, package delboy1978uk/bone-user has an endpoint for a visitor to register a user account. If you don't want endpoints like these exposed you can add the path that is configured in the package's addRoutes(Container $c, Router $router) method that adds the routes, you can use the wildcard strings too as shown here.

<?php

return [
    'blockedRoutes' => [
        '/user/register',
        '/user/lost-password/{email}',
    ],
];

adding middleware

Sometimes you might want to add middleware to a route coming from a vendor package, you can do this also by adding the following config key. Each key can hold either an actual instance of the middleware, a string representing the middleware which would be found in the container, or an array of either if you wish to add multiple middlewares.

return [
    'blockedRoutes' => [
        // etc
    ],
    'routeMiddleware' => [
        '/api/some/endpoint' => SomeMiddleware::class,
        '/api/another/endpoint' => new AwesomeMiddleware(),
        '/api/yet/another/endpoint' => [
            new AwesomeMiddleware(),
            SomeMidlleware::class,
        ],
    ],
];

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固