Skip to content

Commit a968668

Browse files
committed
Merge pull request #6 from codebendercc/auth_key_rename
Ρename parameters `auth_key` to `authorizationKey`
2 parents 8d9ebc4 + 75e2b5f commit a968668

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

Symfony/app/config/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ swiftmailer:
6363
host: "%mailer_host%"
6464
username: "%mailer_user%"
6565
password: "%mailer_password%"
66-
spool: { type: memory }
66+
spool: { type: memory }

Symfony/app/config/parameters.yml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ parameters:
1515
secret: ThisTokenIsNotSoSecretChangeIt
1616
compiler: 'http://compilerurl.com/'
1717
library: 'http://libraryappurl.com/'
18-
auth_key: authenticationekey
19-
version: version
18+
authorizationKey: authenticationekey
19+
version: version

Symfony/app/config/routing_dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ _configurator:
1111
prefix: /_configurator
1212

1313
_main:
14-
resource: routing.yml
14+
resource: routing.yml

Symfony/src/Codebender/BuilderBundle/Controller/DefaultController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function statusAction()
3535
*/
3636
public function handleRequestAction($authKey, $version)
3737
{
38-
if ($authKey !== $this->container->getParameter('auth_key')) {
38+
if ($authKey !== $this->container->getParameter('authorizationKey')) {
3939
return new Response(json_encode(array("success" => false, "message" => "Invalid authorization key.")));
4040
}
4141

Symfony/src/Codebender/BuilderBundle/Resources/config/services.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ services:
77
# arguments: [@service_id, "plain_value", %parameter%]
88

99
codebender_builder.handler:
10-
class: Codebender\BuilderBundle\Handler\DefaultHandler
10+
class: Codebender\BuilderBundle\Handler\DefaultHandler

Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerFunctionalTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function testStatusAction() {
2424
public function testHandleRequestGet() {
2525
$client = static::createClient();
2626

27-
$authorizationKey = $client->getContainer()->getParameter('auth_key');
27+
$authorizationKey = $client->getContainer()->getParameter('authorizationKey');
2828
$apiVersion = $client->getContainer()->getParameter('version');
2929
$client->request('GET', "/{$authorizationKey}/{$apiVersion}/");
3030

@@ -34,7 +34,7 @@ public function testHandleRequestGet() {
3434
public function testHandleRequestCompile() {
3535
$client = static::createClient();
3636

37-
$authorizationKey = $client->getContainer()->getParameter('auth_key');
37+
$authorizationKey = $client->getContainer()->getParameter('authorizationKey');
3838
$apiVersion = $client->getContainer()->getParameter('version');
3939
$client
4040
->request(
@@ -55,7 +55,7 @@ public function testHandleRequestCompile() {
5555
public function testHandleRequestLibraryFetching() {
5656
$client = static::createClient();
5757

58-
$authorizationKey = $client->getContainer()->getParameter('auth_key');
58+
$authorizationKey = $client->getContainer()->getParameter('authorizationKey');
5959
$apiVersion = $client->getContainer()->getParameter('version');
6060
$client
6161
->request(
@@ -77,7 +77,7 @@ public function testHandleRequestLibraryFetching() {
7777
public function testHandleRequestLibraryKeywords() {
7878
$client = static::createClient();
7979

80-
$authorizationKey = $client->getContainer()->getParameter('auth_key');
80+
$authorizationKey = $client->getContainer()->getParameter('authorizationKey');
8181
$apiVersion = $client->getContainer()->getParameter('version');
8282
$client
8383
->request(
@@ -96,4 +96,4 @@ public function testHandleRequestLibraryKeywords() {
9696
$this->assertArrayHasKey('keywords', $response);
9797
$this->assertTrue(is_array($response['keywords']));
9898
}
99-
}
99+
}

Symfony/src/Codebender/BuilderBundle/Tests/Controller/DefaultControllerUnitTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function testHandleRequestInvalidAuthKey() {
1818

1919
$this->setUpController($controller, $container, $request, $apiHandler);
2020

21-
$container->expects($this->once())->method('getParameter')->with('auth_key')->will($this->returnValue('anAuthKey'));
21+
$container->expects($this->once())->method('getParameter')->with('authorizationKey')->will($this->returnValue('anAuthKey'));
2222

2323
$actionResponse = $controller->handleRequestAction('invalidAuthKey', 'v1');
2424

@@ -29,7 +29,7 @@ public function testHandleRequestInvalidApiVersion() {
2929

3030
$this->setUpController($controller, $container, $request, $apiHandler);
3131

32-
$container->expects($this->at(0))->method('getParameter')->with('auth_key')->will($this->returnValue('anAuthKey'));
32+
$container->expects($this->at(0))->method('getParameter')->with('authorizationKey')->will($this->returnValue('anAuthKey'));
3333
$container->expects($this->at(1))->method('getParameter')->with('version')->will($this->returnValue('v2'));
3434

3535
$actionResponse = $controller->handleRequestAction('anAuthKey', 'v1');
@@ -41,7 +41,7 @@ public function testHandleRequestEmptyRequest() {
4141

4242
$this->setUpController($controller, $container, $request, $apiHandler);
4343

44-
$container->expects($this->at(0))->method('getParameter')->with('auth_key')->will($this->returnValue('anAuthKey'));
44+
$container->expects($this->at(0))->method('getParameter')->with('authorizationKey')->will($this->returnValue('anAuthKey'));
4545
$container->expects($this->at(1))->method('getParameter')->with('version')->will($this->returnValue('v1'));
4646

4747
$controller->expects($this->once())->method('getRequest')->will($this->returnValue($request));
@@ -56,7 +56,7 @@ public function testHandleRequestInvalidJsonDecodesToFalse() {
5656

5757
$this->setUpController($controller, $container, $request, $apiHandler);
5858

59-
$container->expects($this->at(0))->method('getParameter')->with('auth_key')->will($this->returnValue('anAuthKey'));
59+
$container->expects($this->at(0))->method('getParameter')->with('authorizationKey')->will($this->returnValue('anAuthKey'));
6060
$container->expects($this->at(1))->method('getParameter')->with('version')->will($this->returnValue('v1'));
6161

6262
$controller->expects($this->once())->method('getRequest')->will($this->returnValue($request));
@@ -71,7 +71,7 @@ public function testHandleRequestNoDataKeyInRequest() {
7171

7272
$this->setUpController($controller, $container, $request, $apiHandler);
7373

74-
$container->expects($this->at(0))->method('getParameter')->with('auth_key')->will($this->returnValue('anAuthKey'));
74+
$container->expects($this->at(0))->method('getParameter')->with('authorizationKey')->will($this->returnValue('anAuthKey'));
7575
$container->expects($this->at(1))->method('getParameter')->with('version')->will($this->returnValue('v1'));
7676

7777
$controller->expects($this->once())->method('getRequest')->will($this->returnValue($request));
@@ -93,7 +93,7 @@ public function testHandleRequestCompileRequest() {
9393

9494
$controller->setContainer($container);
9595

96-
$container->expects($this->at(0))->method('getParameter')->with('auth_key')->will($this->returnValue('anAuthKey'));
96+
$container->expects($this->at(0))->method('getParameter')->with('authorizationKey')->will($this->returnValue('anAuthKey'));
9797
$container->expects($this->at(1))->method('getParameter')->with('version')->will($this->returnValue('v1'));
9898

9999
$controller->expects($this->once())->method('getRequest')->will($this->returnValue($request));
@@ -117,7 +117,7 @@ public function testHandleRequestLibraryRequest() {
117117

118118
$controller->setContainer($container);
119119

120-
$container->expects($this->at(0))->method('getParameter')->with('auth_key')->will($this->returnValue('anAuthKey'));
120+
$container->expects($this->at(0))->method('getParameter')->with('authorizationKey')->will($this->returnValue('anAuthKey'));
121121
$container->expects($this->at(1))->method('getParameter')->with('version')->will($this->returnValue('v1'));
122122

123123
$controller->expects($this->once())->method('getRequest')->will($this->returnValue($request));

Symfony/src/Codebender/BuilderBundle/Tests/Handler/DefaultHandlerUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ public function testReadLibrariesNoIno() {
6868

6969
$this->assertEquals($handler->readlibraries($projectFiles), array());
7070
}
71-
}
71+
}

0 commit comments

Comments
 (0)