starburst/encrypted-config-loader
最新稳定版本:1.0.0
Composer 安装命令:
composer require starburst/encrypted-config-loader
包简介
Expanded config loader for stefna/config
README 文档
README
Load encrypted config files with support for key rotation
Requirements
PHP 8.2 or higher.
Installation
composer require starburst/encrypted-config-loader
Setup cli commands
The package provides 4 cli commands that can be used to make it easier to work with the secrets.
config:decryptconfig:encryptconfig:generate-secretconfig:rotate-secrets
Setup in starburst
It's on purpose that we don't provide a default Bootloader for these since most project should add their own logic
for key resolving and key rotating
So you need to write your own Bootloader but here is a basic example:
class EncryptionConfigCliBootloader implements \Starburst\Contracts\Bootloader, \Starburst\Contracts\Extensions\CliCommandProvider, \Starburst\Contracts\Extensions\DefinitionProvider { public function createDefinitionSource(): \Stefna\DependencyInjection\Definition\DefinitionSource { return new \Stefna\DependencyInjection\Definition\DefinitionArray([ \Starburst\EncryptedConfigLoader\KeyResolver::class => fn () => new \Starburst\EncryptedConfigLoader\FileKeyResolver(), // if you store the key in an external system you need to write your own KeyResolver. This can also be used to provide a default key for the cli commands \Starburst\EncryptedConfigLoader\KeyLoader::class => fn () => new KeyCollection(), // if you have multiple keys \ParagonIE\Halite\Symmetric\EncryptionKey::class => fn () => \ParagonIE\Halite\KeyFactory::loadEncryptionKey('path to encryption key'), // if you only have one key this is the way to go \Starburst\EncryptedConfigLoader\Crypto::class => fn (\Psr\Container\ContainerInterface $c) => new \Starburst\EncryptedConfigLoader\DefaultCrypto( $c->get(\Starburst\EncryptedConfigLoader\KeyLoader::class), $c->get(\ParagonIE\Halite\Symmetric\EncryptionKey::class), ), ]); } }
Contribute
We are always happy to receive bug/security reports and bug/security fixes
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 488
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-02