Download the PHP package archict/firewall without Composer

On this page you can find all versions of the php package archict/firewall. 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 firewall

Firewall

Tests

Control access to your resources

How to use

The majority of the work is inside the config file firewall.yml:

Let's go in details!

User provider

To help firewall to get current user, you need to give it a User provider.

This Brick provides you the interface \Archict\Firewall\UserProvider:

The class you pass in the config must implement this interface. It can have dependencies like a Service, they will be injected during instantiation.

User is an interface also provided by this Brick:

Access control

This config tag must contain an array of rules.

Each rule must have at least the path tag. This tag define the path to match, it can be a pattern with the same rules as in Archict\router.

Then you have the choice between let the firewall check if user can access the resource (the check is based on user roles), or implement your own checker.

Firewall checker

If you choose to use firewall checker, then you must provide these 2 tags:

Then you can define the behavior with one these rules (only one):

Your own checker

To use your own checker, your class must implement this interface:

This method returns true if user is authorized to see resource. It can throw an exception the same way as defined in Archict\router. Implementation of this interface can have some dependencies in its constructor, they will be injected during instantiation.

Then you can provide the class name to your rule with the tag checker:

You can also provide one of the behavior tag (see Firewall checker) in case your method returns false.


All versions of firewall with dependencies

PHP Build Version
Package Version
Requires php Version >= 8.2
archict/brick Version ^0
psr/http-message Version ^2.0
archict/router Version ^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 archict/firewall contains the following files

Loading the files please wait ....