定制 th0masso/ssacc-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

th0masso/ssacc-bundle

最新稳定版本:v1.0.0

Composer 安装命令:

composer require th0masso/ssacc-bundle

包简介

Symfony Security Access Control Checker

README 文档

README

SSACC is a Symfony bundle that list all your project's routes that do not have permission checks.

The bundle will check if certain functions are called on the first line of the controller's action.

You can learn more about how to ensure that all the routes on my Symfony app have access control with this article.

Table of contents

Installation

composer require --dev ssacc/ssacc-bundle

Configuration

You should create a config file like this one:

ssacc-config:
  project_path: "./"
  controllers_path: "src/"
  exclude_all_routes_that_start_with:
    - "web_profiler"
    - "twig"
  exclude_full_routes:
    - "error_controller::preview"
  security_requirement:
    - "$this->denyAccessUnlessGranted"
    - "!$this->isGranted"

Those are the default values, you can change them as you wish.

You can use ssacc-config.dist.yaml as a template.

The default config path is ./ssacc-config.yaml, but you can change it in the next step.

Description of the options

  • project_path: The path to the root of your project.
  • controllers_path: The path to the controllers directory.
  • exclude_all_routes_that_start_with: An array of strings. All routes that start with any of those strings will be excluded.
  • exclude_full_routes: An array of strings. All routes that match any of those strings will be excluded.
  • security_requirement: An array of strings. All routes functions that do not have any of those strings on the first line of the controller's action will be listed.

Usage

The only argument is the relative path to the config file you created in the previous step.

It is optional and the default value is ssacc-config.yaml (root of your project).

php bin/console security:check-access-control myConfigDir/my-config-file.yaml

Example

Example

TODO: add the example code to this repo.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-15