PHPackages                             xp-forge/credentials - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. xp-forge/credentials

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

xp-forge/credentials
====================

Credentials

v3.1.0(2y ago)010.6k↓50%1[1 issues](https://github.com/xp-forge/credentials/issues)BSD-3-ClausePHPPHP &gt;=7.0.0

Since Sep 29Pushed 2y ago1 watchersCompare

[ Source](https://github.com/xp-forge/credentials)[ Packagist](https://packagist.org/packages/xp-forge/credentials)[ Docs](http://xp-framework.net/)[ RSS](/packages/xp-forge-credentials/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (27)Used By (0)

Credentials
===========

[](#credentials)

[![Build status on GitHub](https://github.com/xp-forge/credentials/workflows/Tests/badge.svg)](https://github.com/xp-forge/credentials/actions)[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)[![Requires PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.svg)](http://php.net/)[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/4302d88da7ea056da5581ffbcca8a870fb42c413a5779449b76fd63032e7f811/68747470733a2f2f706f7365722e707567782e6f72672f78702d666f7267652f63726564656e7469616c732f76657273696f6e2e706e67)](https://packagist.org/packages/xp-forge/credentials)

Credentials storage

Backends
--------

[](#backends)

This API supports the following backends:

- [Files](https://github.com/xp-forge/credentials#files)
- [Environment variables](https://github.com/xp-forge/credentials#environment-variables)
- [Hashicorp's Vault](https://github.com/xp-forge/credentials#hashicorps-vault)
- [KeePass databases](https://github.com/xp-forge/credentials#keepass-databases)
- [Docker Secrets](https://github.com/xp-forge/credentials#docker-secrets)

### Files

[](#files)

Via the `FromFile` class. Files are expected to have the following format:

```
rest_password=abcdefg
ldap_password=qwertzu

```

### Environment variables

[](#environment-variables)

Via the `FromEnvironment` class. Credential names map to environment variables by uppercasing them and replacing forward slashes by two underscores:

```
use security\credentials\{Credentials, FromEnvironment};

$credentials= new Credentials(new FromEnvironment());
$secret= $credentials->named('ldap_password');     // Reads $ENV{LDAP_PASSWORD} => util.Secret
```

### Hashicorp's Vault

[](#hashicorps-vault)

Via the `FromVault` class. Credentials are read from the backend mounted at `/secret`.

```
use security\credentials\{Credentials, FromVault};

// Set token to NULL to use VAULT_TOKEN from environment
$token= new Secret('72698676-4988-94a4-...');

$credentials= new Credentials(new FromVault('http://127.0.0.1:8200', $token));
$secret= $credentials->named('ldap_password');     // Reads ldap_password key from /secret

$credentials= new Credentials(new FromVault('http://127.0.0.1:8200', $token, 'vendor/name'));
$secret= $credentials->named('mysql');             // Reads mysql key from /secret/vendor/name
```

### KeePass databases

[](#keepass-databases)

Via the `KeePass` class.

```
use security\credentials\{Credentials, FromKeePass};
use util\Secret;

$secret= new Secret('key');

$credentials= new Credentials(new FromKeePass('database.kdbx', $secret));
$secret= $credentials->named('ldap_password');     // Reads top-level entry ldap_password

$credentials= new Credentials(new FromKeePass('database.kdbx', $secret, 'vendor/name'));
$secret= $credentials->named('mysql');             // Reads mysql entry in vendor/name subfolder
```

### Docker secrets

[](#docker-secrets)

See . Uses Docker's default locations on both Windows and Un\*x systems if constructed without argument.

```
use security\credentials\{Credentials, FromDockerSecrets};
use util\Secret;

$credentials= new Credentials(new FromDockerSecrets());
$secret= $credentials->named('ldap_password');     // Reads top-level entry ldap_password
```

See also
--------

[](#see-also)

[xp-framework/rfc#316](https://github.com/xp-framework/rfc/issues/316)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~113 days

Recently: every ~210 days

Total

25

Last Release

786d ago

Major Versions

v0.8.5 → v1.0.02019-01-26

v1.0.1 → v2.0.02020-04-05

v2.1.0 → v3.0.02024-02-04

PHP version history (2 changes)v0.1.0PHP &gt;=5.6.0

v2.0.0PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/07d18d882c8b4aaf3466432f64018214f2771eda333202175431ee7233795376?d=identicon)[thekid](/maintainers/thekid)

---

Top Contributors

[![thekid](https://avatars.githubusercontent.com/u/696742?v=4)](https://github.com/thekid "thekid (91 commits)")

---

Tags

hashicorp-vaultkeepass-databasepassword-storephp7php8secretsxp-frameworkmodulexp

### Embed Badge

![Health badge](/badges/xp-forge-credentials/health.svg)

```
[![Health](https://phpackages.com/badges/xp-forge-credentials/health.svg)](https://phpackages.com/packages/xp-forge-credentials)
```

###  Alternatives

[filsh/yii2-oauth2-server

OAuth2 Server for PHP

331523.9k12](/packages/filsh-yii2-oauth2-server)[lm-commons/lmc-rbac-mvc

Laminas Framework MVC Module that provides a layer of features of Laminas\\Permissions\\Rbac

12401.0k7](/packages/lm-commons-lmc-rbac-mvc)[silverstripe/mfa

Enable multi-factor authentication with fallback codes

10346.1k8](/packages/silverstripe-mfa)[org_heigl/hybridauth

Lightweight Authentication Module for Zend-Framework 2 using the hybridauth-library

211.9k](/packages/org-heigl-hybridauth)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
