Download the PHP package gromnan/composer-keychain-auth without Composer

On this page you can find all versions of the php package gromnan/composer-keychain-auth. 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 composer-keychain-auth

Composer Keychain Auth

Store your Composer authentication credentials in the system keychain instead of a plain text auth.json file.

Supported stores:

Why

Composer stores credentials for private package repositories, GitHub, GitLab, Bitbucket and Forgejo in ~/.composer/auth.json. These files hold plain text tokens and passwords. This plugin moves that data into the encrypted keychain of the machine, so no secret ever sits on disk in the clear.

Installation

Install the plugin globally so every Composer command uses it:

Add the plugin package to the allow-plugins list of your global Composer configuration if Composer asks for permission.

Usage

Migrate an existing auth.json into the keychain, then remove the file:

Store a credential:

Once a credential is stored, running composer install or composer update uses it transparently, without prompting and without writing any auth.json.

Manage the stored credentials:

If several developers share a machine, or you need to move credentials to another machine, composer keychain:export writes a standard auth.json that plain Composer can read.

How it works

Write path

At plugin activation the Config auth sources of Composer are replaced with a ConfigSourceInterface implementation that persists in the keychain. Every credential write goes through those sources: the interactive prompt storage in AuthHelper, and the GitHub, GitLab, Bitbucket and Forgejo OAuth flows. The default store-auths setting is kept as-is, persistence simply lands in the keychain.

When Composer prompts for a login interactively, for example a GitHub token, the token is validated by Composer and then stored directly in the keychain through those same sources. No auth.json file is written.

Read path

When running on a Composer version with the AuthenticationProvider capability, the plugin provides that capability and credentials are fetched from the keychain on demand.

On Composer versions before that capability, the plugin falls back to preloading every keychain credential into the Composer IO instance at activation. Both paths cover HTTP downloads, dist archives and git clone operations.

Credentials are stored per host origin as the exact per-origin values Composer would read from an auth.json, keyed under the service composer-auth with the origin as account.

Precedence

Credentials are resolved in this order, from highest to lowest priority:

  1. COMPOSER_AUTH environment variable
  2. project auth.json
  3. global auth.json
  4. system keychain
  5. nothing, Composer prompts interactively

Because auth.json files are read before plugins activate, a reversed auth.json still wins over the keychain. Use composer keychain:import --delete after migrating to avoid this.

Known limitations

Development

This repository is under development against the AuthenticationProvider capability PR. Its dev composer/composer dependency is resolved from the user fork repository declared in composer.json, which carries the capability branch. After the PR is merged into Composer, switch the require-dev constraint back to a released composer/composer version.

The integration tests touch the real keychain and are opt-in:


All versions of composer-keychain-auth with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
composer-plugin-api Version ^2.8
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 gromnan/composer-keychain-auth contains the following files

Loading the files please wait ...