This bundle allows developers to encrypt its keys ans store them using redis as a vault
- This bundle requires sodium extension and predis to be installed.
Install it using composer:
composer require ict/secrets:dev-main
Bundle requires the following configuration:
ict_secrets:
hash_alg: 'sha512' # Any type supported by php hash function
encoder: sodium
store:
type: redis
config:
uri: 'your redis uri connection'
At the moment, only sodium encoder and redis vault are allowed.
use Ict\Secrets\Vault\VaultStorageInterface;
..........
public function __construct(
private readonly VaultStorageInterface $vaultStorage
)
$this->vaultStorage->storeKeys('your_encription_keys_name')->storeSecret('your_secret_name', 'your_secret_value');
your_encription_keys_name is used to store the encription keys by which your secrets will be encripted
$secretVal = $this->vaultStorage->getSecret($secretKey)
$secretVal = $this->vaultStorage->removeSecret($secretKey)