chippyash/authentication-manager

Generic authentication management of identities

2.0.3 2016-06-08 16:22 UTC

README

Quality Assurance

PHP 5.5 PHP 5.6 PHP 7 Build Status Test Coverage Code Climate

What?

Provides base for creating managers that manage identity entries in some back end authentication system.

The single one provided at present is an HTTP Basic Digest Manager.

The library is released under the GNU GPL V3 or later license

When?

If you want more, either suggest it, or better still, fork it and provide a pull request.

How?

You can find the API documentation here

You will find the Test Contract in the docs directory alongside an example Symfony DI container definition.

Coding Basics

Construction

    use Chippyash\Authentication\Manager\DigestManager;
    use Chippyash\Authentication\Manager\Encoder\BasicEncoder;
    use Chippyash\Authentication\Manager\Digest\BasicDigestCollection;
    use Chippyash\Type\String\StringType;

    $realm = new StringType('realm');
    $digestFileName = new StringType('/path/to/my/file');

    $encoder = new BasicEncoder();
    $encoder->setRealm($realm);

    $collection = new BasicDigestCollection($encoder, $digestFileName);
    $collection->setRealm($realm);

    $this->authManager = new DigestManager($collection);

Adding new manager types

Implement the Chippyash\Authentication\Manager\ManagerInterface to create new types of Authentication Managers.

Changing the library

  1. fork it
  2. write the test
  3. amend it
  4. do a pull request

Found a bug you can't figure out?

  1. fork it
  2. write the test
  3. do a pull request

NB. Make sure you rebase to HEAD before your pull request

Where?

The library is hosted at Github. It is available at Packagist.org

Installation

Install Composer

For production

    "chippyash/authentication-manager": "~2.0"

to your composer.json "requires" section

For development

Clone this repo, and then run Composer in local repo root to pull in dependencies

    git clone git@github.com:chippyash/Authentication-Manager.git AuthMan
    cd AuthMan
    composer install

To run the tests:

    cd AuthMan
    vendor/bin/phpunit -c test/phpunit.xml test/

If you have Testdox Converter installed you can rebuild the Test Contract by running build.sh on *nix systems.

Other stuff

Check out ZF4 Packages for more packages

License

This software library is released under the GNU GPL V3 or later license

This software library is Copyright (c) 2014-2016, Ashley Kitson, UK

A commercial license is available for this software library, please contact the author. It is normally free to deserving causes, but gets you around the limitation of the GPL license, which does not allow unrestricted inclusion of this code in commercial works.

History

V0... pre releases

V1.0.0 Initial version tagged

V1.0.1 Amends for CI

V1.0.2 Typos in dic example

V1.0.3 Self initialise the manager

V2.0.0 BC Break: change namespace from chippyash\Authentication to Chippyash\Authentication

V2.0.1 Add link to packages

V2.0.2 Verify PHP7 compatibility

V2.0.3 Move coverage to codeclimate