servicecore/shield
Composer 安装命令:
composer require servicecore/shield
包简介
A constant response time library
README 文档
README
A constant response time library.
Timing attacks are a common threat vector for online services. Using a constant code execution-time greatly reduces the risk.
The shield libary will sleep the application for the difference between the actual execution time and the desired execution time:
use ServiceCore\Shield\Ready as Shield;
// ... in a controller or resource somewhere
// instantiate a new shield
$shield = new Shield();
// start the shield with a 500 millisecond *desired* execution time
$shield = $shield->start(500);
// ... do something sensitive like authenticate a password
// stop the shield...
// this will sleep the application for the difference between the *actual* execution
// time and the *desired* execution time
//
$shield = $shield->stop();
Usage
A shield has three states: ready, started, and stopped.
You can instantiate a Ready shield:
use ServiceCore\Shield\Ready as Shield;
$shield = new Shield();
You can start a Ready shield with a desired execution time in milliseconds:
// ... continued from the example above
$shield = $shield->start(500);
The start() method will return a Started shield.
You can stop a Started shield:
// ... continued from the example above
$shield = $shield->stop();
The stop() method will sleep for the difference between the actual execution time and the desired execution time. The actual execution time is considered to be the time between the calls to the shield's start() method and stop() method.
The stop() method will return a Stopped shield.
Finally, you can reset a Stopped shield:
// ... continued from the example above
$shield = $shield->reset();
The reset() method will return a Ready shield.
Version
0.1.1, March 7, 2016
- Fix dependency on
obg/timerfromdev-masterto~0.1.
0.1.0, March 7, 2016
- Initial release
servicecore/shield 适用场景与选型建议
servicecore/shield 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 11 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 servicecore/shield 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 servicecore/shield 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2020-11-02