From cc51f7f34e6cd824376ff2b92b864cef0f7198c9 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Wed, 19 Jun 2019 04:06:16 +0000 Subject: [PATCH] Use findBy to find the api user using the api_key. #224 --- .../Security/APIKeyUserProvider.php | 2 +- composer.lock | 84 ++++++++++--------- 2 files changed, 46 insertions(+), 40 deletions(-) diff --git a/catalyst/api-bundle/Security/APIKeyUserProvider.php b/catalyst/api-bundle/Security/APIKeyUserProvider.php index 1521a390..742e8d63 100644 --- a/catalyst/api-bundle/Security/APIKeyUserProvider.php +++ b/catalyst/api-bundle/Security/APIKeyUserProvider.php @@ -21,7 +21,7 @@ class APIKeyUserProvider implements UserProviderInterface public function getUserByAPIKey($api_key) { - $user = $this->em->getRepository(User::class)->find($api_key); + $user = $this->em->getRepository(User::class)->findOneBy(array('api_key' => $api_key)); return $user; } diff --git a/composer.lock b/composer.lock index 2e4fae65..0529081c 100644 --- a/composer.lock +++ b/composer.lock @@ -1,7 +1,7 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "60a481bcfc7c5465c831c26c20d2d7f6", @@ -12,12 +12,12 @@ "source": { "type": "git", "url": "https://gitlab.com/jankstudio-catalyst/auth-bundle.git", - "reference": "156cf4d31aeb3de5e4f948b7dd608ac5545d1fc2" + "reference": "ed143d15debfae3b909c46e40c080201e4aa0fda" }, "dist": { "type": "zip", - "url": "https://gitlab.com/api/v4/projects/jankstudio-catalyst%2Fauth-bundle/repository/archive.zip?sha=156cf4d31aeb3de5e4f948b7dd608ac5545d1fc2", - "reference": "156cf4d31aeb3de5e4f948b7dd608ac5545d1fc2", + "url": "https://gitlab.com/api/v4/projects/jankstudio-catalyst%2Fauth-bundle/repository/archive.zip?sha=ed143d15debfae3b909c46e40c080201e4aa0fda", + "reference": "ed143d15debfae3b909c46e40c080201e4aa0fda", "shasum": "" }, "require": { @@ -41,7 +41,7 @@ "email": "kc@jankstudio.com" } ], - "time": "2019-06-05T16:44:31+00:00" + "time": "2019-06-14T17:44:18+00:00" }, { "name": "catalyst/menu-bundle", @@ -49,12 +49,12 @@ "source": { "type": "git", "url": "https://gitlab.com/jankstudio-catalyst/menu-bundle.git", - "reference": "f2c9131b0e810f32d769febb7a39b01d4018a526" + "reference": "2cf9a05862fcc6f956da4b095962915e07f14f64" }, "dist": { "type": "zip", - "url": "https://gitlab.com/api/v4/projects/jankstudio-catalyst%2Fmenu-bundle/repository/archive.zip?sha=f2c9131b0e810f32d769febb7a39b01d4018a526", - "reference": "f2c9131b0e810f32d769febb7a39b01d4018a526", + "url": "https://gitlab.com/api/v4/projects/jankstudio-catalyst%2Fmenu-bundle/repository/archive.zip?sha=2cf9a05862fcc6f956da4b095962915e07f14f64", + "reference": "2cf9a05862fcc6f956da4b095962915e07f14f64", "shasum": "" }, "require": { @@ -78,7 +78,7 @@ "email": "kc@jankstudio.com" } ], - "time": "2019-06-08T07:13:56+00:00" + "time": "2019-06-14T09:43:30+00:00" }, { "name": "creof/doctrine2-spatial", @@ -510,16 +510,16 @@ }, { "name": "doctrine/collections", - "version": "v1.6.1", + "version": "v1.6.2", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "d2ae4ef05e25197343b6a39bae1d3c427a2f6956" + "reference": "c5e0bc17b1620e97c968ac409acbff28b8b850be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/d2ae4ef05e25197343b6a39bae1d3c427a2f6956", - "reference": "d2ae4ef05e25197343b6a39bae1d3c427a2f6956", + "url": "https://api.github.com/repos/doctrine/collections/zipball/c5e0bc17b1620e97c968ac409acbff28b8b850be", + "reference": "c5e0bc17b1620e97c968ac409acbff28b8b850be", "shasum": "" }, "require": { @@ -576,7 +576,7 @@ "iterators", "php" ], - "time": "2019-03-25T19:03:48+00:00" + "time": "2019-06-09T13:48:14+00:00" }, { "name": "doctrine/common", @@ -1185,21 +1185,24 @@ }, { "name": "doctrine/lexer", - "version": "v1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8", + "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8", "shasum": "" }, "require": { "php": ">=5.3.2" }, + "require-dev": { + "phpunit/phpunit": "^4.5" + }, "type": "library", "extra": { "branch-alias": { @@ -1207,8 +1210,8 @@ } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Lexer\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" } }, "notification-url": "https://packagist.org/downloads/", @@ -1229,13 +1232,16 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "http://www.doctrine-project.org", + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", "keywords": [ + "annotations", + "docblock", "lexer", - "parser" + "parser", + "php" ], - "time": "2014-09-09T13:34:57+00:00" + "time": "2019-06-08T11:03:04+00:00" }, { "name": "doctrine/migrations", @@ -3079,16 +3085,16 @@ }, { "name": "symfony/flex", - "version": "v1.2.6", + "version": "v1.2.7", "source": { "type": "git", "url": "https://github.com/symfony/flex.git", - "reference": "5ed49091eb73f912dd23dab92bf07c0180cfb009" + "reference": "8618b243d44bac71e4006062f245d807d84f7a6c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/flex/zipball/5ed49091eb73f912dd23dab92bf07c0180cfb009", - "reference": "5ed49091eb73f912dd23dab92bf07c0180cfb009", + "url": "https://api.github.com/repos/symfony/flex/zipball/8618b243d44bac71e4006062f245d807d84f7a6c", + "reference": "8618b243d44bac71e4006062f245d807d84f7a6c", "shasum": "" }, "require": { @@ -3124,7 +3130,7 @@ } ], "description": "Composer plugin for Symfony", - "time": "2019-06-05T14:26:30+00:00" + "time": "2019-06-15T07:15:42+00:00" }, { "name": "symfony/framework-bundle", @@ -5097,16 +5103,16 @@ }, { "name": "twig/twig", - "version": "v2.11.2", + "version": "v2.11.3", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "84a463403da1c81afbcedda8f0e788c78bd25a79" + "reference": "699ed2342557c88789a15402de5eb834dedd6792" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/84a463403da1c81afbcedda8f0e788c78bd25a79", - "reference": "84a463403da1c81afbcedda8f0e788c78bd25a79", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/699ed2342557c88789a15402de5eb834dedd6792", + "reference": "699ed2342557c88789a15402de5eb834dedd6792", "shasum": "" }, "require": { @@ -5160,7 +5166,7 @@ "keywords": [ "templating" ], - "time": "2019-06-05T11:17:07+00:00" + "time": "2019-06-18T15:37:11+00:00" }, { "name": "zendframework/zend-code", @@ -5333,16 +5339,16 @@ }, { "name": "doctrine/doctrine-fixtures-bundle", - "version": "3.2.0", + "version": "3.2.2", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineFixturesBundle.git", - "reference": "13b2e8e1af099bc06f8611497fe079a4e0b4e497" + "reference": "90e4a4f968b2dae40e290a6ee516957af043f16c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/13b2e8e1af099bc06f8611497fe079a4e0b4e497", - "reference": "13b2e8e1af099bc06f8611497fe079a4e0b4e497", + "url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/90e4a4f968b2dae40e290a6ee516957af043f16c", + "reference": "90e4a4f968b2dae40e290a6ee516957af043f16c", "shasum": "" }, "require": { @@ -5393,7 +5399,7 @@ "Fixture", "persistence" ], - "time": "2019-06-07T11:21:53+00:00" + "time": "2019-06-12T12:03:37+00:00" }, { "name": "symfony/dotenv",