Download the PHP package pbergman/php-docker-token-auth without Composer

On this page you can find all versions of the php package pbergman/php-docker-token-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 php-docker-token-auth

PHP docker registry 2 token authentication

This is a light weight docker token authentication build in php to the specs of the docs.

https://docs.docker.com/registry/spec/auth/token

It can be used to validate push/pull and registration us users for you private registry.

Configuring

property required type description
public_key yes string the private key, should be the content not file location
private_key yes string the public key, should be the content not file location
audience yes string audience that is registered in the registry (server name of registry)
issuer yes string issuer that is registered in the registry (server name of this server)
logger_level no string|array log level[s] to display (example: ['error', 'info'])
logger_file no string log file or fd for logging , if non is given it will use stdout
route_end_point no string The route endpoint to listen to, if non given it will default to /v2/token/
signing_algorithm no string The algoritm used for signing the token, supported: HS256, HS512, HS384, RS256 (but only RS256 tested :D)

the config should be given as argument with the constructor:

Validating

There are some listeners defined in src\DockerToken\Listener that can be used for validation (see) example.php or the tests.

To communicate between handlers you can use the (is|set)Access(Granted|Denied) methods (see LdapAuthListener or YamlAuthListener).

By default the flag is set to abstain en when finished when the flag is not granted it will see it as the authentiaction is not succesfull and throws a InvalidAccessException.

If you want to stop on success you can use the stopPropagation method because from the event because the set methods won`t do that. And on failure you can just call the InvalidAccessException that will resolve in a 401 status.

When using DockerToken\Listener\YamlAuthListener you also need symfony/yaml.

Running

php -S 127.0.0.1:9999 example.php

Keys

to generate keys, see:


All versions of php-docker-token-auth with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
silex/silex Version 1.*@stable
firebase/php-jwt Version 3.*@stable
christian-riesen/base32 Version 1.*@stable
symfony/options-resolver Version 2.*@stable
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 pbergman/php-docker-token-auth contains the following files

Loading the files please wait ....