PHPackages                             codenamephp/platform.secretsmanager.base - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. codenamephp/platform.secretsmanager.base

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

codenamephp/platform.secretsmanager.base
========================================

1.2.0(2y ago)06382Apache-2.0PHPPHP ^8.1CI passing

Since Mar 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/codenamephp/platform.secretsManager.base)[ Packagist](https://packagist.org/packages/codenamephp/platform.secretsmanager.base)[ RSS](/packages/codenamephp-platformsecretsmanagerbase/feed)WikiDiscussions release Synced yesterday

READMEChangelog (4)DependenciesVersions (6)Used By (2)

platform.secretsManager.base
============================

[](#platformsecretsmanagerbase)

[![Packagist Version](https://camo.githubusercontent.com/cfd6435bbad19f729b8bb15e0f8e581563bbdb40e52a34f38249bd8c8e7d3583/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f64656e616d657068702f6465706c6f7965722e736563726574732e62617365)](https://camo.githubusercontent.com/cfd6435bbad19f729b8bb15e0f8e581563bbdb40e52a34f38249bd8c8e7d3583/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f64656e616d657068702f6465706c6f7965722e736563726574732e62617365)[![Packagist PHP Version Support](https://camo.githubusercontent.com/0553726500fc0ec2c8549ee1099e850dfeac53eaec2832d00a89341cc5b33ada/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f636f64656e616d657068702f6465706c6f7965722e736563726574732e62617365)](https://camo.githubusercontent.com/0553726500fc0ec2c8549ee1099e850dfeac53eaec2832d00a89341cc5b33ada/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f636f64656e616d657068702f6465706c6f7965722e736563726574732e62617365)[![Lines of code](https://camo.githubusercontent.com/cd62766043014798959183682a0017d56cc67d7a66e81fa9c4e5f7187256e7e1/68747470733a2f2f696d672e736869656c64732e696f2f746f6b65692f6c696e65732f6769746875622f636f64656e616d657068702f6465706c6f7965722e736563726574732e62617365)](https://camo.githubusercontent.com/cd62766043014798959183682a0017d56cc67d7a66e81fa9c4e5f7187256e7e1/68747470733a2f2f696d672e736869656c64732e696f2f746f6b65692f6c696e65732f6769746875622f636f64656e616d657068702f6465706c6f7965722e736563726574732e62617365)[![GitHub code size in bytes](https://camo.githubusercontent.com/7c3494d36efa20e947ba4015e6335add3280a4c49278bce7cc98c49ed93ebf76/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f636f64656e616d657068702f6465706c6f7965722e736563726574732e62617365)](https://camo.githubusercontent.com/7c3494d36efa20e947ba4015e6335add3280a4c49278bce7cc98c49ed93ebf76/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f636f64656e616d657068702f6465706c6f7965722e736563726574732e62617365)[![CI](https://github.com/codenamephp/deployer.secrets.base/workflows/CI/badge.svg)](https://github.com/codenamephp/deployer.secrets.base/workflows/CI/badge.svg)[![Packagist Downloads](https://camo.githubusercontent.com/bd0f9e9087605bf2c3f0dc3a0a00c84b05dc38a49fa2449d1bc9e73355ac35b7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f64656e616d657068702f6465706c6f7965722e736563726574732e62617365)](https://camo.githubusercontent.com/bd0f9e9087605bf2c3f0dc3a0a00c84b05dc38a49fa2449d1bc9e73355ac35b7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f64656e616d657068702f6465706c6f7965722e736563726574732e62617365)[![GitHub](https://camo.githubusercontent.com/9cdf14e599adbe9de8ed7482a379f421c1a2b19731b05ff154164ba5eaf21795/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f636f64656e616d657068702f6465706c6f7965722e736563726574732e62617365)](https://camo.githubusercontent.com/9cdf14e599adbe9de8ed7482a379f421c1a2b19731b05ff154164ba5eaf21795/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f636f64656e616d657068702f6465706c6f7965722e736563726574732e62617365)

A base package to provide common interface for secret manager integration with the intent to make them easily exchangeable.

Installation
------------

[](#installation)

Easiest way is via composer. Just run `composer require codenamephp/platform.secretsmanager.base` in your cli which should install the latest version for you.

Usage
-----

[](#usage)

This package provides the basic interfaces for secrets, payloads and a client. Use this package in your actual implementation and just build implementations against services.

### Proxy

[](#proxy)

There is a simple, lightweight proxy system in place. This is used to load secrets lazily and ideally only once.

Example:

```
use de\codenamephp\platform\secretsManager\base\Secret\Proxy\String\Factory\WithClientAsClassMemberFactory;
use de\codenamephp\platform\secretsManager\base\Secret\Sealed;

$client = new SomeClientImplementation();
$factory = new WithClientAsClassMemberFactory($client);

$secret = $factory->build(new Sealed('someSecretName', 'some-project'));
$multipleSecrets = $factory->buildMultiple(
  another: new Sealed('anotherSecretName', 'some-project'),
  more: new Sealed('moreSecretName', 'some-project'),
); //remember you can use parameter names as array keys for variadic

$allSecrets = [
  'some' => $secret,
  ...$multipleSecrets, //simple spread is possible
];
```

The proxy interface extends \\Stringable so it should be usable wherever a string would have been used.

#### A not when using with Deployer

[](#a-not-when-using-with-deployer)

Because of the way deployer fetches the secrets you should wrap the values in closures. This is because when fetching the configs Deployer does checks for closures and return them "as is". But the else path just passes the value to preg\_replace and assumes an array callable so this will return null in the end.

```
$deployerFunctions->host('production')
  ->setHostname('some-host.com')
  ->set('database', static fn() => [ //this closure fixes the issue
    'name' => 'some-db',
    ...$stringProxyFactory->buildMultiple(
      user: new Sealed('db_user', 'my-project'),
      password: new Sealed('db_password', 'my-project')
    ),
  ]);
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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 ~60 days

Total

4

Last Release

1033d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6865819?v=4)[Bastian Schwarz](/maintainers/bastianschwarz)[@bastianschwarz](https://github.com/bastianschwarz)

---

Top Contributors

[![bastianschwarz](https://avatars.githubusercontent.com/u/6865819?v=4)](https://github.com/bastianschwarz "bastianschwarz (32 commits)")

### Embed Badge

![Health badge](/badges/codenamephp-platformsecretsmanagerbase/health.svg)

```
[![Health](https://phpackages.com/badges/codenamephp-platformsecretsmanagerbase/health.svg)](https://phpackages.com/packages/codenamephp-platformsecretsmanagerbase)
```

###  Alternatives

[imanghafoori/laravel-middlewarize

Use laravel middlewares on any method calls in your app

1124.5k1](/packages/imanghafoori-laravel-middlewarize)

PHPackages © 2026

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