2017 © Pedro Peláez
 

library api-guardian

Protect your API with a token (objective-php)

image

yoctu/api-guardian

Protect your API with a token (objective-php)

  • Monday, April 16, 2018
  • by Neofox
  • Repository
  • 2 Watchers
  • 0 Stars
  • 323 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 750 % Grown

The README.md

API guardian

Build Status, (*1)

Protect your pages with a token!, (*2)

Prerequisites

You will need a project running Objective-PHP to use this package., (*3)

If you want to use the user token feauture, you'll need a user with the attribute apiToken With yoctu/connect you'll need at least connect-common v2.2.3, (*4)

Installing

The package should be easy to install. You just need to add this repository to your composer.json, (*5)

composer require yoctu/api-guardian

And add the package to your Application.php with filter(s) if needed., (*6)

$this->getStep('auth')
    ->plug(Apiguardian::class, new UrlFilter('/api/*'))->as('api-guardian')
;

Using the package

Now that the package has been plugged on your application you can setup the one or more token to be used in the configuration., (*7)

return [
    new Param('api-keys', ['api_key_one', 'api_key_two'])
];

You'll now need to add a token to your request to pass the middleware, (*8)

GET / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Authorization: api_key_one
Connection: keep-alive

Running the tests

./vendor/bin/phpunit --bootstrap vendor/autoload.php tests, (*9)

License

This project is licensed under the GNU GPL 3.0 License - see the LICENSE file for details, (*10)

The Versions

16/04 2018

dev-master

9999999-dev

Protect your API with a token (objective-php)

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires

by Jerome Schaeffer

16/04 2018

v1.0.1

1.0.1.0

Protect your API with a token (objective-php)

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires

by Jerome Schaeffer

16/04 2018

v1.0.0

1.0.0.0

Protect your API with a token (objective-php)

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires

by Jerome Schaeffer