ict / secrets
Manage, encode ans store your secrets easily
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.1
- ext-ctype: *
- ext-iconv: *
- symfony/console: 6.*
- symfony/dotenv: 6.*
- symfony/flex: ^2
- symfony/framework-bundle: 6.*
- symfony/runtime: 6.*
- symfony/yaml: 6.*
README
Introduction
This bundle allows developers to encrypt its keys ans store them using redis as a vault
Requirements
- This bundle requires sodium extension and predis to be installed.
Installation
Install it using composer:
composer require ict/secrets:dev-main
Configuration
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.
How to use it
Inject Vault service:
use Ict\Secrets\Vault\VaultStorageInterface; .......... public function __construct( private readonly VaultStorageInterface $vaultStorage )
Store a secret
$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
Retrieve a secret
$secretVal = $this->vaultStorage->getSecret($secretKey)
Remove a secret
$secretVal = $this->vaultStorage->removeSecret($secretKey)