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

v1.0.0 2023-05-20 11:26 UTC

This package is auto-updated.

Last update: 2024-04-19 15:06:14 UTC


README

Introduction

This bundle allows developers to encrypt its keys ans store them using redis as a vault

Requirements

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)