segrax/opa-policy-generator
Composer 安装命令:
composer require segrax/opa-policy-generator
包简介
Convert OpenAPI 3 specs to OPA Policies
README 文档
README
Convert an OpenAPI 3 specification to an OPA policy.
Warning
While this tool will produce a file representing a policy, it is advised a manual review of every line is performed prior to using the policy.
Items such as API-Keys must be manually set, and any other security related items not definable in a spec.
Early Development
This tool is under development and may not support all OpenAPI3 features, please open feature requests if you find features missing that you require.
How to use
The easiest way to use opapg is via docker, mounting a folder with a spec in as a volume
docker run --volume d:/projects/myapi:/srv/app segrax/opapg from-openapi openapi.yaml --output=mypolicy
This will produce a policy and a set of tests for the policy (in the mounted volume) and will output the results of an 'opa test' command to the console
data.name.api.test_locat_id_oauth2_allowed: PASS (537.7µs) data.name.api.test_locat_id_oauth2_denied: PASS (401.6µs) data.name.api.test_locat_id_apiKey1_allowed: PASS (352.5µs) data.name.api.test_locat_id_apiKey1_denied: PASS (293.5µs) data.name.api.test_locations_near_allowed: PASS (280.2µs) data.name.api.test_locations_get_allowed: PASS (849.6µs) data.name.api.test_locations_create_bearerAuth_allowed: PASS (707.1µs) data.name.api.test_locations_create_bearerAuth_denied: PASS (346.1µs) data.name.api.test_media_get_allowed: PASS (398µs) data.name.api.test_media_list_allowed: PASS (343.1µs) data.name.api.test_media_upload_bearerAuth_allowed: PASS (314.3µs) data.name.api.test_media_upload_bearerAuth_denied: PASS (447.2µs) -------------------------------------------------------------------------------- PASS: 12/12
Todo
Lots of features remain to be added, please submit ideas/feature requests to the issue tracker.
License
The MIT License (MIT). Please see License File for more information.
segrax/opa-policy-generator 适用场景与选型建议
segrax/opa-policy-generator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 887 次下载、GitHub Stars 达 3, 最近一次更新时间为 2019 年 12 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Policy」 「openapi」 「authz」 「opa」 「rego」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 segrax/opa-policy-generator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 segrax/opa-policy-generator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 segrax/opa-policy-generator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Simple and configurable SilverStripe module to notify users about cookie policies
A module for CSP headers in Silverstripe.
Open Policy Agent client and PSR-7, PSR-15 Authorization Middleware
TYPO3 Access Control Component.
webman casbin permission plugin
The following pages give you some general information on how to use our APIs.<br/>The actual API services documentation then follows further below. You can use the menu to jump between API sections.<br/><br/>This page has a built-in HTTP(S) client, so you can test the services directly from within t
统计信息
- 总下载量: 887
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 31
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-12-21