Download the PHP package kakaprodo/presigned-action without Composer

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

Presigned Action

Presigned Action is a Laravel package for securely authorizing actions on an Eloquent model without requiring the requesting person or service to have a local user account.

It is useful when one service authenticates a user and another service owns the resource being accessed.

Installation

The package registers its service provider through Laravel package discovery. By default, its migrations are loaded automatically. Publish the configuration with:

Generate an access key

Use the facade with an accessible Eloquent model:

The generation options are:

Option Required Description
accessible Yes Eloquent model the key grants access to.
whoami Yes Identifier of the person or service receiving access.
expires_at No A Carbon expiration time. Defaults to key_expires_after minutes from now.
origin No Identifies the system or integration that generated the key.
scopes No Array of scope names granted to the key.
permissions No Array of permission names granted to the key.
settings No Additional application-specific JSON data.

The public response contains an encrypted key and its expiration timestamp:

Key reuse and renewal

When generating a key, the package looks for an existing non-expired key with the same accessible model, whoami, and origin. It reuses that key only when its scopes and permissions also match.

Scopes and permissions are treated as unordered values when comparing keys.

Validate incoming requests

Apply VerifyAccessKeyMiddleware to routes that require a valid access key:

The middleware expects these headers by default:

The verified model is available from the facade or the request:

Configure different header names in config/presigned-action.php under access_key_validation.

Scopes and permissions

Use PresignedActionScopeMiddleware to require one or more scopes. Scope arguments may be comma- or pipe-separated:

The middleware allows the request when at least one requested scope is granted. The access key model also provides helpers for application-level checks:

Register the middleware aliases in your application's HTTP kernel:

Then require an origin or permission on a route:

Artisan command

Generate a key interactively with:

Remove expired keys with:

Custom validators

Validators can be registered from any service provider and are called with the current temporary access key as their first argument:

You can call a given validator using the check method:

If a validator returns false, check() throws a PresignedActionException with Permission denied by default. Pass a third argument to customize the error message:

Configuration

key_expires_after is expressed in minutes. The database migration creates the temporary_access_keys table with nullable JSON permissions and nullable string origin columns.

Why Presigned Action?

In a microservice architecture, a user may be authenticated and authorized by a core service while the entity they need to access belongs to another service. Presigned Action provides controlled cross-service access without duplicating users, roles, or permissions across services.

Official documentation on Yupidoc


All versions of presigned-action with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
laravel/framework Version >=8.0
kakaprodo/custom-data Version >=2.3.5 || dev-develop
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 kakaprodo/presigned-action contains the following files

Loading the files please wait ...