PHP Classes

PHP Redis Credential Manager: Manage credentials stored in a Redis server

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2023-12-02 (10 months ago) RSS 2.0 feedNot enough user ratingsTotal: 32 All time: 11,079 This week: 46Up
Version License PHP version Categories
credential-manager-p 6.0.0Custom (specified...7Networking, User Management, Security, P...
Description 

Author

This package can manage credentials stored in a Redis server.

It can connect to a given Redis server and perform several types of operations on service credentials.

Currently, it can, get, set and deleter credentials for a given origin and service.

Innovation Award
PHP Programming Innovation award nominee
December 2023
Number 3
Credentials are usually used to authenticate users, for instance, using a username and a password to access a database server.

When credentials are set to a fixed value, developers often store them in a PHP configuration script.

Now, when the credentials may be changed, it is better to store them in central storage that can be accessed by different parts of the application that need those credentials.

This package uses a Redis server to store and retrieve credentials for different services.

Manuel Lemos
Picture of Leonardo Di Sarli
  Performance   Level  
Name: Leonardo Di Sarli <contact>
Classes: 11 packages by
Country: Brazil Brazil
Age: ???
All time rank: 3841309 in Brazil Brazil
Week rank: 197 Up16 in Brazil Brazil Up
Innovation award
Innovation award
Nominee: 5x

Winner: 2x

Example

<?php

require_once __DIR__ . '/../vendor/autoload.php';

use
CredentialManager\Credential;

$redisConfig = [
   
'host' => 'localhost',
   
'port' => 6379,
];

$credential = new Credential($redisConfig);

$credential->setCredential(
   
'originName',
   
'serviceName',
   
'CredentialSample'
);

$getCredential = $credential->getCredential('originName', 'serviceName');

print_r($getCredential);
echo
PHP_EOL;


Details

PHP Credential Manager

Latest Version codecov CI Build Downloads Old Downloads PRs Welcome Packagist License (custom server)

PHP library for search credential in redis with Predis.

Installation

Release 7.0.0 Requires PHP 8.3

Release 6.0.0 Requires PHP 8.2

Release 5.0.0 Requires PHP 8.1

Release 4.0.0 Requires PHP 7.4

Release 3.0.0 Requires PHP 7.3

Release 2.0.0 Requires PHP 7.2

Release 1.0.0 Requires PHP 7.1

The recommended way to install is through Composer.

composer require not-empty/credential-manager-php-lib

Usage

Setting a credential

use CredentialManager\Credential;
$redisConfig = [
    'host' => 'localhost',
    'port' => 6379,
];
$credential = new Credential($redisConfig);
$credential->setCredential(
    'originName',
    'serviceName',
    'CredentialSample'
);
$getCredential = $credential->getCredential('originName', 'serviceName');
var_dump($getCredential);

if you want an environment to run or test it, you can build and install dependences like this

docker build --build-arg PHP_VERSION=8.3-rc-cli -t not-empty/credential-manager-php-lib:php83 -f contrib/Dockerfile .

Access the container

docker run -v ${PWD}/:/var/www/html -it not-empty/credential-manager-php-lib:php83 bash

Verify if all dependencies is installed

composer install --no-dev --prefer-dist

and run

php sample/credential-sample.php

Development

Want to contribute? Great!

The project using a simple code. Make a change in your file and be careful with your updates! Any new code will only be accepted with all validations.

To ensure that the entire project is fine:

First you need to building a correct environment to install all dependences

docker build --build-arg PHP_VERSION=8.3-rc-cli -t not-empty/credential-manager-php-lib:php83 -f contrib/Dockerfile .

Access the container

docker run -v ${PWD}/:/var/www/html -it not-empty/credential-manager-php-lib:php83 bash

Install all dependences

composer install --dev --prefer-dist

Run all validations

composer check

Not Empty Foundation - Free codes, full minds


  Files folder image Files (15)  
File Role Description
Files folder image.github (1 directory)
Files folder imagecontrib (4 files)
Files folder imagesample (1 file)
Files folder imagesrc (1 file)
Files folder imagetests (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpcs.xml Data Auxiliary data
Accessible without login Plain text file phpmd.xml Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (15)  /  .github  
File Role Description
Files folder imageworkflows (1 file)

  Files folder image Files (15)  /  .github  /  workflows  
File Role Description
  Accessible without login Plain text file php.yml Data Auxiliary data

  Files folder image Files (15)  /  contrib  
File Role Description
  Accessible without login Plain text file coverage-checker.php Example Example script
  Accessible without login Plain text file Dockerfile Data Auxiliary data
  Accessible without login Plain text file pre-commit Data Auxiliary data
  Accessible without login Plain text file setup.sh Data Auxiliary data

  Files folder image Files (15)  /  sample  
File Role Description
  Accessible without login Plain text file credential-sample.php Example Example script

  Files folder image Files (15)  /  src  
File Role Description
  Plain text file Credential.php Class Class source

  Files folder image Files (15)  /  tests  
File Role Description
  Plain text file CredentialTest.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:32
This week:0
All time:11,079
This week:46Up