wakeonweb/kong-oauth2-firewall-bundle
Composer 安装命令:
composer require wakeonweb/kong-oauth2-firewall-bundle
包简介
Kong OAuth2 Firewall Bundle
README 文档
README
Note: The bundle handle the authentication of user when used behind a Kong API Gateway. Be sure to isolate your application from the outside world. Kong transform user credentials into a set of headers that are used to authenticate the user. An attacker can fake them with a direct access to your app.
Configuration
/config/packages/security.yaml
security:
providers:
trusted:
id: WakeOnWeb\Bundle\KongOAuth2FirewallBundle\Security\TrustedUserProvider
# OR USE YOUR OWN PROVIDER
# in_memory:
# memory:
# users:
# 66ce7c7d-ef0a-47f9-b952-a7dd44ebc7cc: ~
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
kong:
consumer_ids:
- 8ca2548f-3b97-4a03-847e-9e42c150e644
anonymous_consumer_ids:
- 836b6e33-fd83-43b6-ab77-74390873d7b6
access_control:
- { path: ^/me, roles: IS_AUTHENTICATED_FULLY }
- { path: ^/ping, roles: IS_AUTHENTICATED_ANONYMOUSLY }
The authentication mechanism use a combination of headers provided by kong. An authenticated user will have the
following two headers X-Consumer-ID and X-Authenticated-UserID. An anonymous user will only have the header
X-Anonymous-Consumer.
It appears that the X-Authenticated-UserID header is not reliable at all. The firewall could only trust the
X-Consumer-ID and the X-Anonymous-Consumer. That's why both the IDs should appears in the firewall configuration.
Todo
- Add an HTTP Client / Guzzle Middleware that forwards the kong authentication headers when communicating with other local microservices.
wakeonweb/kong-oauth2-firewall-bundle 适用场景与选型建议
wakeonweb/kong-oauth2-firewall-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 215 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 11 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 wakeonweb/kong-oauth2-firewall-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 wakeonweb/kong-oauth2-firewall-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 215
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-11-07