Download the PHP package vartroth/secrets-manager without Composer

On this page you can find all versions of the php package vartroth/secrets-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package secrets-manager

Secrets Manager for PHP

A robust PHP package for managing Docker secrets and environment variables with caching, flexible configuration, and a clean API.

Features

Installation

Quick Start

Basic Usage

Static Facade

Configuration

Using SecretsConfig

Configuration Options

Option Description Default
secretsPath Path to Docker secrets directory /run/secrets
enableCache Enable in-memory caching true
envPrefix Prefix for environment variables '' (none)
envPrecedence Environment variables take precedence true

How It Works

The SecretsManager follows this lookup order (when envPrecedence is true):

  1. Environment Variables: Checks $_ENV, $_SERVER, and getenv()
  2. Docker Secrets: Reads from files in the secrets directory
  3. Default Value: Returns provided default or throws exception

When envPrecedence is false, Docker secrets are checked first.

Environment Variables

With prefix APP_:

Without prefix:

Docker Secrets

Secrets are read from files in the configured directory:

API Reference

SecretsManager

Core Methods

Cache Management

Configuration Getters

Secrets (Static Facade)

Docker Integration

Docker Compose Example

Dockerfile

Error Handling

The package throws specific exceptions for different error conditions:

Testing

PHPUnit Example

Mock Secrets

Security Considerations

  1. Path Traversal Protection: The package validates that secret paths stay within the configured directory
  2. File Permissions: Ensures secret files are readable before attempting to read them
  3. No Logging: Secret values are never logged or exposed in error messages
  4. Memory Management: Secrets can be cleared from memory when no longer needed

Performance

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/new-feature
  3. Make your changes and add tests
  4. Run tests: composer test
  5. Run static analysis: composer analyse
  6. Submit a pull request

Requirements

License

MIT License. See LICENSE file for details.

Changelog

v0.1.0


All versions of secrets-manager with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vartroth/secrets-manager contains the following files

Loading the files please wait ...