Download the PHP package torchlighttechnology/api-security-plugin without Composer

On this page you can find all versions of the php package torchlighttechnology/api-security-plugin. 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 api-security-plugin

ApiGateway plugin for CakePHP

Description

This CakePHP 3 plugin allows the user to specify which controller/methods are used as API endpoints through a basic UI, and enforce AWS APIGateway request parameters. For the endpoints which are specified, the plugin checks for the 'x-api-key' header in the request and verifies the value is an enabled API Key in your AWS APIGateway account. Invalid requests result in a Cake\Controller\Exception\AuthSecurityException being thrown.

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

Configuration

Load the plugin in the host app's config/bootstrap.php file:

Add the namespace into the host app's composer.json file, in the autoload-dev section:

Add the AwsAuthenticator Component in the host app's src/Controller/AppController.php:

Run the ApiGateway migrations:

Environment variables

ApiGateway plugin uses the AWS API to retrieve the valid AWS API Gateway keys, and it uses Redis for caching method names and API calls. The plugin relies on environment variables to make the connection to Redis and AWS. The AWS environment variables you need to set are:

The Redis environment variables you need to set are:

The default value for REDIS_SERVER is localhost. If you don't want to use Redis you can use File caching by setting REDIS_ENGINE env variable to 'File' (REDIS_SERVER var will then be ignored).

Setup

Once you have properly configured the plugin, navigate to http://yourapp.local/api-gateway/end-points. Click on 'Configure End Points'. You should see a list of controller names with their method names as checkboxes. Select the methods that you want the plugin to protect. There is also a Clear AWS API Cache button. This will invalidate the Redis cache, and on the next call to a protected endpoint, it will refresh with the latest API Keys from AWS APIGateway.


All versions of api-security-plugin with dependencies

PHP Build Version
Package Version
Requires cakephp/cakephp Version 4.3.*
aws/aws-sdk-php Version ^3.55
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 torchlighttechnology/api-security-plugin contains the following files

Loading the files please wait ....