2017 © Pedro Peláez
 

library apisecurity

Protects API routes with a token

image

japseyz/apisecurity

Protects API routes with a token

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 4 % Grown

The README.md

API SECURITY BY JAPSEYZ

Install by running composer require JapSeyz/ApiSecurity and adding \JapSeyz\ApiSecurity\LaravelServiceProvider::class, to config/app.php, (*1)

Three Environment variables are included, one of them is optional, (*2)

JAPSEYZ_API_TOKEN: which is the API Token used to secure the routes, (*3)

JAPSEYZ_APISECURITY_CHECK_AUTH: Which skips authentication if the user is already authenticated. JAPSEYZ_APISECURITY_DISABLE_IN_DEVELOPMENT which skips authentication if the app is set to local environment, (*4)

Add the "api.check" middleware to any routes that needs to be protected, (*5)

Send along a header "X-server-token" with every request to the middleware; This headers value should equal the JAPSEYZ_API_TOKEN environment variable., (*6)

Add the following route to your api.php if you cant access the one built into the package.

Route::get('/api/timestamp', function () {
  return response()->json([
      'timestamp' => time(),
  ]);
});

The Versions

06/02 2017

dev-master

9999999-dev

Protects API routes with a token

  Sources   Download

MIT

by Jesper Jacobsen

06/02 2017

1.0.12

1.0.12.0

Protects API routes with a token

  Sources   Download

MIT

by Jesper Jacobsen

08/01 2017

1.0.11

1.0.11.0

Protects API routes with a token

  Sources   Download

MIT

by Jesper Jacobsen

31/08 2016

1.0.10

1.0.10.0

Protects API routes with a token

  Sources   Download

MIT

by Jesper Jacobsen

02/08 2016

1.0.8

1.0.8.0

Protects API routes with a token

  Sources   Download

MIT

by Jesper Jacobsen

02/08 2016

1.0.6

1.0.6.0

Protects API routes with a token

  Sources   Download

MIT

by Jesper Jacobsen

02/08 2016

1.0.1

1.0.1.0

Protects API routes with a token

  Sources   Download

MIT

by Jesper Jacobsen