Download the PHP package macpaw/composer-authenticated-repository-plugin without Composer

On this page you can find all versions of the php package macpaw/composer-authenticated-repository-plugin. 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-authenticated-repository-plugin

Composer Authenticated Repository Plugin

A Composer plugin that provides automatic authentication support for GitHub repositories and HTTP basic auth when downloading packages. The plugin intercepts file downloads and adds authentication headers as needed.

Features

Installation

Option 1: Install as a Composer Plugin

Option 2: Manual Installation

  1. Clone this repository to your project
  2. Add the plugin to your composer.json:

Configuration

1. Configure Authentication

First, configure your authentication credentials in Composer:

GitHub Token Authentication

HTTP Basic Authentication

2. Configure Repository Matching

Add configuration to composer extra section to specify which repositories should receive authentication:

Important: The owner and name fields are required and must match the GitHub repository owner and name exactly.

How It Works

1. Plugin Activation

The plugin activates during Composer initialization and:

2. Download Interception

When Composer attempts to download a file, the plugin:

3. Repository Matching

The plugin matches URLs against configured repositories:

4. Authentication Header Injection

For matching URLs, the plugin adds appropriate headers:

Environment Variables

For security, use environment variables:

Or use Composer's environment variable substitution:

Debug Mode

Enable debug logging to see what the plugin is doing:

The plugin will output debug information including:

Security Considerations

Troubleshooting

Common Issues

  1. 401 Authentication Errors:

    • Verify your tokens/credentials are correctly configured
    • Check that the repository is configured in the plugin's extra section
    • Ensure the owner and name match the GitHub repository exactly
  2. Repository Not Found:

    • Ensure the repository URL is accessible with your credentials
    • Verify the repository is listed in the plugin configuration
  3. Package Not Found:

    • Check that the package is listed in the repository manifest
    • Verify download URLs are accessible with authentication
  4. Permission Denied:
    • Verify your GitHub token has the required scopes
    • Check repository visibility and access permissions

Debug Steps

  1. Check authentication configuration:

  2. Enable verbose output:

  3. Test repository access:

  4. Verify plugin configuration: Check that your composer.json has the correct extra.composer-authenticated-plugin.repositories configuration.

Development

Building the Plugin

Running Tests

Plugin Structure

License

MIT License - see LICENSE file for details.

Support

For issues and questions, please create an issue in the GitHub repository.

Current State and Recent Updates

Implementation Overview

The plugin currently implements authentication support through:

  1. PreFileDownloadEvent Hook: Intercepts all file downloads and adds authentication headers as needed
  2. Repository Matching: Only adds authentication for URLs matching configured repositories
  3. Debug Logging: Comprehensive debug output for troubleshooting
  4. GitHub Token Support: Automatic token injection for GitHub URLs
  5. HTTP Basic Auth: Support for HTTP basic authentication

Key Features

Recent Changes

Known Limitations

Future Enhancements


All versions of composer-authenticated-repository-plugin with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
composer-plugin-api Version ^2.0
composer/composer Version ^2.0
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 macpaw/composer-authenticated-repository-plugin contains the following files

Loading the files please wait ...