secretary/secretary-bundle
Composer 安装命令:
composer require secretary/secretary-bundle
包简介
Secrets Manager Bundle for Symfony
README 文档
README
This Bundle Experimental!
Secrets are an important aspect of most applications you can build. How you store them, and keep them "secret" is a challenge. Luckily, there are tools you can use to keep them all safe.
Secretary is a tool to integrate your PHP application with these tools.
You can find more information about the underlying library over at the main docs.
Installation
$ composer require secretary/symfony
Configuration
# config/packages/secretary.yamlg services: Symfony\Component\Cache\Adapter\ApcuAdapter: arguments: ['secrets', 300000] secretary: adapters: json: adapter: Secretary\Adapter\Local\JSONFile\LocalJSONFileAdapter config: file: '%kernel.root_dir%/config/secrets.json' aws: adapter: Secretary\Adapter\AWS\SecretsManager\AWSSecretsManagerAdapter config: region: 'us-east-1' version: 'latest' credentials: key: "%env(API_AWS_ACCESS_KEY_ID)%" secret: "%env(API_AWS_SECRET_ACCESS_KEY)%" default: # chain adapter adapter: Secretary\Adapter\Chain\ChainAdapter config: - @secretary.adapter.json - @secretary.adapter.aws cache: enabled: true type: psr6 service_id: cache.secrets
Resolving secrets in env vars
parameters: db_pass: '%env(secretary:default:DB_PASS)%' # scalar secret db_conf: '%env(secretaryArray:default:DB_CONFIG)%' # array secret
Missing secrets
By default, a missing secret throws Symfony's EnvNotFoundException (with the manager name and
secret key in the message, and the original SecretNotFoundException as previous).
To resolve null instead — with a warning logged through the default logger — you can either
opt in per reference with the secretaryOptional: / secretaryArrayOptional: prefixes:
parameters: feature_key: '%env(secretaryOptional:default:FEATURE_KEY)%'
or globally via the bundle config:
secretary: allow_missing_secrets: true # defaults to false
Symfony's built-in default: processor also composes, if you want a fallback parameter instead:
parameters: fallback: 'some-default' db_pass: '%env(default:fallback:secretary:default:DB_PASS)%'
Only missing secrets are handled this way — network, auth, and other adapter errors always bubble up.
secretary/secretary-bundle 适用场景与选型建议
secretary/secretary-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 92.12k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2019 年 04 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「secrets」 「vault」 「keyvault」 「secretary」 「secretsmanager」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 secretary/secretary-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 secretary/secretary-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 secretary/secretary-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Secrets Manager for PHP
PSR-6 Cache Adapter for Secretary
PHP Library to work with Azure KeyVault using managed identity
A simple wrapper for the Azure RM Key Vault API.
A PHP library to encrypt/decrypt secrets using OpenSSL.
A simple wrapper for the Azure RM Key Vault API.
统计信息
- 总下载量: 92.12k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2019-04-17