Download the PHP package hunomina/http-auth-router-php without Composer

On this page you can find all versions of the php package hunomina/http-auth-router-php. 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 http-auth-router-php

Http Authentication Router PHP

Build Status codecov

Description : Implementation of Http Router classes for PHP7.1 or higher with authentication.

This library is mainly composed of 8 classes.

AuthRouter

The AuthRouter class extends from the [hunomina\Routing\Router]() class.

Therefore it can handle request by calling the request(string $method, string $url) method which must return a route action response.

Read this documentation in order to understand how the base routing system works.

This class can be instantiated by passing a route file, an AuthenticationCheckerInterface instance and a type (json, yaml... extend if you want to add new ones).

The route file syntax is identical to the hunomina\Routing\Router route file syntax.

Examples here.

AuthenticationCheckerInterface

The AuthenticationCheckerInterface has three methods :

In order for the AuthRouter to work with your application, you have to create a class that implements the AuthenticationCheckerInterface interface and her methods.

You absolutely can add some methods if needed.

UserInterface

The UserInterface must be implemented by all user entities that will log into your application.

This interface has two methods :

SecurityContext

Allow to define role based rules for specific routes.

This class loads the security context from a configuration file, check his validity and instantiate multiple Role and Rule objects according to the configuration file.

You can then use the security context object in your AuthenticationChecker application instance to check users rights.

This class is abstract and has two methods that you have to implement :

This package comes with two built-in SecurityContext implementation :

If you want to add a new SecurityConext type, you'll have to create two classes :

Role

A Role is just a name with child roles.

This class has two properties :

And one method :

Rule

A Rule has 3 properties :

Those three properties are passed to the constructor. Make sure all of them are valid (e.g. valid pseudo regular expression for $_path property)

YamlSecurityContext

The YamlSecurityContext is a built-in SecurityContext implementation.

It allow you to use Yaml configuration file for your application AuthRouter SecurityContext. If you use this SecurityContext class you must follow this simple configuration file syntax :

Each rule is composed of :

Each role is composed of :

Example here (Yaml)

JsonSecurityContext

The JsonSecurityContext is a built-in SecurityContext implementation too.

It allow you to use Json configuration file for your application AuthRouter SecurityContext.

For this SecurityContext class, the configuration file syntax is the same as the YamlSecurityContext.

Example here (Json)

Examples

For more examples, check those here


All versions of http-auth-router-php with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
ext-json Version *
hunomina/http-router-php Version ^1.3
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 hunomina/http-auth-router-php contains the following files

Loading the files please wait ....