Created rest route to perform authentication

This commit is contained in:
Alejandro Celaya
2016-07-04 14:45:18 +02:00
parent 56b2bd3d56
commit dfc5bfd0f2
9 changed files with 263 additions and 0 deletions

View File

@@ -13,6 +13,12 @@ return [
],
// Rest
[
'name' => 'rest-authenticate',
'path' => '/rest/authenticate',
'middleware' => Rest\AuthenticateMiddleware::class,
'allowed_methods' => ['POST'],
],
[
'name' => 'rest-create-shortcode',
'path' => '/rest/short-codes',

View File

@@ -38,6 +38,7 @@ return [
Service\UrlShortener::class => AnnotatedFactory::class,
Service\VisitsTracker::class => AnnotatedFactory::class,
Service\ShortUrlService::class => AnnotatedFactory::class,
Service\RestTokenService::class => AnnotatedFactory::class,
Cache::class => CacheFactory::class,
// Cli commands
@@ -45,6 +46,7 @@ return [
// Middleware
Middleware\Routable\RedirectMiddleware::class => AnnotatedFactory::class,
Middleware\Rest\AuthenticateMiddleware::class => AnnotatedFactory::class,
Middleware\Rest\CreateShortcodeMiddleware::class => AnnotatedFactory::class,
Middleware\Rest\ResolveUrlMiddleware::class => AnnotatedFactory::class,
Middleware\Rest\GetVisitsMiddleware::class => AnnotatedFactory::class,