magex/content-security-policy
Composer 安装命令:
composer require magex/content-security-policy
包简介
Allows to add CSP domains on the Admin
README 文档
README
magex/content-security-policy
As of version 2.3.5, Magento supports CSP headers and provides ways to configure them. (This functionality is defined in the Magento_Csp module.) Magento also provides default configurations at the application level and for individual core modules that require extra configuration. Policies can be configured for adminhtml and storefront areas separately to accommodate different use cases. Magento also permits configuring unique CSPs for specific pages.
Main Functionalities
- This module allows Admin to add external sources to CSP header from Store configuration
Installation
* = in production please use the --keep-generated option
Type 1: Zip file
- Unzip the zip file in
app/code/MagEx - Enable the module by running
php bin/magento module:enable MagEx_ContentSecurityPolicy - Apply database updates by running
php bin/magento setup:upgrade* - Flush the cache by running
php bin/magento cache:flush
Type 2: Composer
- Make the module available in a composer repository for example:
- public repository
packagist.org - public github repository as vcs
- public repository
- Install the module composer by running
composer require magex/content-security-policy - enable the module by running
php bin/magento module:enable MagEx_ContentSecurityPolicy - apply database updates by running
php bin/magento setup:upgrade* - Flush the cache by running
php bin/magento cache:flush
Configuration
- global
Global policy. - default-src
The default policy. - base-uri
Defines which URLs can appear in a page’s <base> element. - child-src
Defines the sources for workers and embedded frame contents. - connect-src
Defines the sources that can be loaded using script interfaces. - font-src
Defines which sources can serve fonts. - form-action
Defines valid endpoints for submission from <form> tags. - frame-ancestors
Defines the sources that can embed the current page. - frame-src
Defines the sources for elements such as <frame> and <iframe>. - img-src
Defines the sources from which images can be loaded. - manifest-src
Defines the allowable contents of web app manifests. - media-src
Defines the sources from which images can be loaded. - object-src
Defines the sources for the <object>, <embed>, and <applet> elements. - script-src
Defines the sources for JavaScript <script> elements. - style-src
Defines the sources for stylesheets.
Specifications
- Config reader
- MagEx\ContentSecurityPolicy\Collector\Config\ScopeConfigPolicyReader
magex/content-security-policy 适用场景与选型建议
magex/content-security-policy 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.37k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 04 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 magex/content-security-policy 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 magex/content-security-policy 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.37k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: OSL-3.0
- 更新时间: 2021-04-25