Download the PHP package kinetis/authorization without Composer

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

kinetis/authorization
Ability-based authorization for Kinetis

Packagist Version Packagist Downloads PHP Version License CI


Part of Kinetis, a non-blocking PHP framework for API-first applications, developed in the kinetis-dev/kinetis monorepo.

Kinetis is deliberately unopinionated about how your application organizes authorization checks — there's no required Policy convention, no ability-name registry, and nothing here inspects an object's class to decide which code answers a check. Gate is a small, generic wrapper: hand it any callable and it normalizes the result into an allow/deny decision.

$this->postPolicy->update(...) is PHP's own first-class callable syntax — PostPolicy is a plain, constructor-injected class with plain methods, resolved and called exactly like any other service. Gate never sees PostPolicy exist as a concept.

Provides

Nothing to register. AuthorizationException declares its own 403 through core's Kinetis\Http\Exception\HttpStatusExceptionInterface, so ExceptionHandlerMiddleware — included unconditionally — returns a denied Gate::authorize() call as that response from any route.

Gate itself needs no explicit binding either: it has no constructor dependencies, so plain autowiring resolves it wherever a controller constructor-injects it.

Nothing else. There's no middleware, no attribute to discover, no registry, and no "Policy" concept this package enforces — PostPolicy above is only a name a developer chose.

The three methods

Neither allows() nor denies() catches anything the check itself throws — a check that fails outright is a failure, not a denial.

$check is any callable(CurrentUserInterface, mixed...): bool|AuthorizationResponse — a first-class callable reference to a method, a plain closure, or a Gate::allows()-independent function. Returning a plain bool covers the ordinary case; returning AuthorizationResponse::deny('a specific reason') lets a denial carry a message more useful than the generic default.

$check may also be typed against a concrete CurrentUserInterface implementation richer than the interface itself — kinetis/auth-jwt's JwtUser, say, whose claim()/claims() already carry everything the token decoded, with no query needed. Gate's methods are generic over the user type (@template TUser of CurrentUserInterface) precisely so this type-checks correctly. See kinetis.dev/docs/authorization.html.

Installation

Requires PHP 8.4 or later and kinetis/framework. Documentation: kinetis.dev/docs/authorization.html

License

MIT — see LICENSE.


All versions of authorization with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
kinetis/framework Version ^1.19.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 kinetis/authorization contains the following files

Loading the files please wait ...