Download the PHP package prooph/service-bus-zfc-rbac-bridge without Composer

On this page you can find all versions of the php package prooph/service-bus-zfc-rbac-bridge. 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 service-bus-zfc-rbac-bridge

service-bus-zfc-rbac-bridge

Marry Service Bus with ZfcRbac

Build Status Coverage Status Gitter

Important

This library will receive support until December 31, 2019 and will then be deprecated.

For further information see the official announcement here: https://www.sasaprolic.com/2018/08/the-future-of-prooph-components.html

Installation

  1. Add "prooph/service-bus-zfc-rbac-bridge": "~1.0" as requirement to your composer.json.
  2. In the config folder you will find a configuration skeleton. The configuration is a simple PHP array flavored with some comments to help you understand the structure.

Requirements

  1. Your Inversion of Control container must implement the interop-container interface.
  2. ZfcRbac's authorization service should be registered in the container under the ZfcRbac\Service\AuthorizationService key.

Note: Don't worry, if your environment doesn't provide the requirements. You can always bootstrap the authorization service by hand. Just look at the factories for inspiration in this case.

Sample

Assuming a TestQuery with message name test and you want to use the route guard and finalize guard together with an assertion (TestAssertion), your config should look like this:

return [
    'prooph' => [
        'service_bus' => [
            'query_bus' => [
                'plugins' => [
                    \Prooph\ServiceBus\RouteGuard::class,
                    \Prooph\ServiceBus\FinalizeGuard::class,
                ]
            ]
        ]
    ],
    'zfc_rbac' => [
        'assertion_manager' => [
            'TestAssertion' => 'TestAssertion',
        ],
        'assertion_map' => [
            'test' => 'TestAssertion'
        ],
        'role_provider' => [
            'ZfcRbac\Role\InMemoryRoleProvider' => [
                'user' => [
                    'permissions' => [
                        'test'
                    ]
                ]
            ]
        ]
    ]
];

And your TestAssertion should look like this:

class TestAssertion implements \ZfcRbac\Assertion\AssertionInterface
{
    public function assert(AuthorizationService $authorizationService, $context = null)
    {
        // return true, if no context present, otherwise your route guard will always fail, because the result is not yet known.
        if (null === $context) {
            return true;
        }

        return ($context['owner'] == $authorizationService->getIdentity());
    }
}

Support

Contribute

Please feel free to fork and extend existing or add new features and send a pull request with your changes! To establish a consistent code quality, please provide unit tests for all your changes and may adapt the documentation.

License

Released under the New BSD License.


All versions of service-bus-zfc-rbac-bridge with dependencies

PHP Build Version
Package Version
Requires php Version ~5.5|~7.0
prooph/service-bus Version >=4.3 <6.0
zf-commons/zfc-rbac Version ^2.5.2
zfr/rbac Version ^1.2
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 prooph/service-bus-zfc-rbac-bridge contains the following files

Loading the files please wait ....