Skip to content

Commit 66bf0f3

Browse files
committedJun 11, 2015
Merge pull request #31 from codebendercc/auth_key_rename
Rename parameter `auth_key` to `authorizationKey`
2 parents b64215d + 1eb193e commit 66bf0f3

File tree

10 files changed

+33
-33
lines changed

10 files changed

+33
-33
lines changed
 

‎Symfony/app/config/parameters.yml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ parameters:
1818
arduino_cores_dir: "/opt/codebender/codebender-arduino-core-files"
1919
external_core_files: "/opt/codebender/external-core-files"
2020

21-
auth_key: "youMustChangeThis"
21+
authorizationKey: "youMustChangeThis"
2222

2323
# Paths to various executables used by the compiler. These depend on the
2424
# distribution used and the method of installation. Linking is performed by

‎Symfony/src/Acme/DemoBundle/Resources/config/routing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ _demo_secured:
99
_demo:
1010
resource: "@AcmeDemoBundle/Controller/DemoController.php"
1111
type: annotation
12-
prefix: /demo
12+
prefix: /demo

‎Symfony/src/Codebender/CompilerBundle/Controller/DefaultController.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ public function statusAction()
2323
return new Response(json_encode(array("success" => true, "status" => "OK")));
2424
}
2525

26-
public function testAction($auth_key)
26+
public function testAction($authorizationKey)
2727
{
2828
$params = $this->generateParameters();
2929

30-
if ($auth_key !== $params["auth_key"])
30+
if ($authorizationKey !== $params["authorizationKey"])
3131
{
3232
return new Response(json_encode(array("success" => false, "step" => 0, "message" => "Invalid authorization key.")));
3333
}
@@ -43,11 +43,11 @@ public function testAction($auth_key)
4343
return new Response(json_encode(array("success" => (bool) !$return_val, "message" => implode("\n", $output))));
4444
}
4545

46-
public function indexAction($auth_key, $version)
46+
public function indexAction($authorizationKey, $version)
4747
{
4848
$params = $this->generateParameters();
4949

50-
if ($auth_key !== $params["auth_key"])
50+
if ($authorizationKey !== $params["authorizationKey"])
5151
{
5252
return new Response(json_encode(array("success" => false, "step" => 0, "message" => "Invalid authorization key.")));
5353
}
@@ -69,9 +69,9 @@ public function indexAction($auth_key, $version)
6969
}
7070
}
7171

72-
public function deleteAllObjectsAction($auth_key, $version)
72+
public function deleteAllObjectsAction($authorizationKey, $version)
7373
{
74-
if ($this->container->getParameter('auth_key') != $auth_key)
74+
if ($this->container->getParameter('authorizationKey') != $authorizationKey)
7575
return new Response(json_encode(array("success" => false, "step" => 0, "message" => "Invalid authorization key.")));
7676

7777
if ($version != "v1")
@@ -122,9 +122,9 @@ public function deleteAllObjectsAction($auth_key, $version)
122122
array("Files not deleted" => $undeletedFiles))));
123123
}
124124

125-
public function deleteSpecificObjectsAction($auth_key, $version, $option, $to_delete)
125+
public function deleteSpecificObjectsAction($authorizationKey, $version, $option, $to_delete)
126126
{
127-
if ($this->container->getParameter('auth_key') != $auth_key)
127+
if ($this->container->getParameter('authorizationKey') != $authorizationKey)
128128
return new Response(json_encode(array("success" => false, "step" => 0, "message" => "Invalid authorization key.")));
129129

130130
if ($version != "v1")
@@ -188,7 +188,7 @@ public function deleteSpecificObjectsAction($auth_key, $version, $option, $to_de
188188
*/
189189
private function generateParameters()
190190
{
191-
$parameters = array("binutils", "python", "clang", "logdir", "temp_dir", "archive_dir", "autocompletion_dir", "autocompleter", "cflags", "cppflags", "asflags", "arflags", "ldflags", "ldflags_tail", "clang_flags", "objcopy_flags", "size_flags", "output", "arduino_cores_dir", "external_core_files", "auth_key");
191+
$parameters = array("binutils", "python", "clang", "logdir", "temp_dir", "archive_dir", "autocompletion_dir", "autocompleter", "cflags", "cppflags", "asflags", "arflags", "ldflags", "ldflags_tail", "clang_flags", "objcopy_flags", "size_flags", "output", "arduino_cores_dir", "external_core_files", "authorizationKey");
192192

193193
$compiler_config = array();
194194

‎Symfony/src/Codebender/CompilerBundle/Handler/MCUHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,4 @@ class MCUHandler
206206
"attiny20" => "__AVR_ATtiny20__",
207207
"attiny40" => "__AVR_ATtiny40__");
208208

209-
}
209+
}

‎Symfony/src/Codebender/CompilerBundle/Handler/PostprocessingHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,4 @@ function ansi_to_html($text)
120120

121121
return $text;
122122
}
123-
}
123+
}

‎Symfony/src/Codebender/CompilerBundle/Handler/PreprocessingHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,4 +293,4 @@ function validate_input($request)
293293
// Request is valid.
294294
return $request;
295295
}
296-
}
296+
}

‎Symfony/src/Codebender/CompilerBundle/Handler/UtilityHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,4 @@ function debug_exec($command, /** @noinspection PhpUnusedParameterInspection */
142142
echo "$ $command\n";
143143
passthru("$command 2>&1");
144144
}
145-
}
145+
}

‎Symfony/src/Codebender/CompilerBundle/Resources/config/routing.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ codebender_compiler_status_check:
33
defaults: { _controller: CodebenderCompilerBundle:Default:status }
44

55
codebender_compiler_test:
6-
pattern: /{auth_key}/test/
6+
pattern: /{authorizationKey}/test/
77
defaults: { _controller: CodebenderCompilerBundle:Default:test }
88

99
codebender_compiler_homepage:
10-
pattern: /{auth_key}/{version}
10+
pattern: /{authorizationKey}/{version}
1111
defaults: { _controller: CodebenderCompilerBundle:Default:index }
1212

1313
codebender_compiler_delete_all:
14-
pattern: /{auth_key}/{version}/delete/all/
14+
pattern: /{authorizationKey}/{version}/delete/all/
1515
defaults: { _controller: CodebenderCompilerBundle:Default:deleteAllObjects }
1616

1717
codebender_compiler_delete_specific:
18-
pattern: /{auth_key}/{version}/delete/{option}/{to_delete}
18+
pattern: /{authorizationKey}/{version}/delete/{option}/{to_delete}
1919
defaults: { _controller: CodebenderCompilerBundle:Default:deleteSpecificObjects }
2020

2121

@@ -25,4 +25,4 @@ root:
2525
defaults:
2626
_controller: FrameworkBundle:Redirect:urlRedirect
2727
path: /status
28-
permanent: true
28+
permanent: true

‎Symfony/src/Codebender/CompilerBundle/Resources/config/services.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ services:
2525
- [pushHandler, [@compiler_log_handler]]
2626
compiler_log_handler:
2727
class: Monolog\Handler\StreamHandler
28-
arguments: [%kernel.logs_dir%/compiler.log]
28+
arguments: [%kernel.logs_dir%/compiler.log]

‎Symfony/src/Codebender/CompilerBundle/Tests/Controller/DefaultControllerTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ public function testInvalidAPI()
3030
{
3131
$client = static::createClient();
3232

33-
$auth_key = $client->getContainer()->getParameter("auth_key");
33+
$authorizationKey = $client->getContainer()->getParameter("authorizationKey");
3434

35-
$client->request('GET', '/'.$auth_key.'/v666');
35+
$client->request('GET', '/'.$authorizationKey.'/v666');
3636

3737
$this->assertEquals($client->getResponse()->getContent(), '{"success":false,"step":0,"message":"Invalid API version."}');
3838

@@ -42,9 +42,9 @@ public function testInvalidInput()
4242
{
4343
$client = static::createClient();
4444

45-
$auth_key = $client->getContainer()->getParameter("auth_key");
45+
$authorizationKey = $client->getContainer()->getParameter("authorizationKey");
4646

47-
$client->request('GET', '/'.$auth_key.'/v1');
47+
$client->request('GET', '/'.$authorizationKey.'/v1');
4848

4949
$this->assertEquals($client->getResponse()->getContent(), '{"success":false,"step":0,"message":"Invalid input."}');
5050

@@ -62,9 +62,9 @@ public function testBlinkUnoSyntaxCheck()
6262

6363
$client = static::createClient();
6464

65-
$auth_key = $client->getContainer()->getParameter("auth_key");
65+
$authorizationKey = $client->getContainer()->getParameter("authorizationKey");
6666

67-
$client->request('POST', '/'.$auth_key.'/v1', array(),array(),array(),$data);
67+
$client->request('POST', '/'.$authorizationKey.'/v1', array(),array(),array(),$data);
6868

6969
$response = json_decode($client->getResponse()->getContent(), true);
7070

@@ -85,9 +85,9 @@ public function testBlinkUnoCompile()
8585

8686
$client = static::createClient();
8787

88-
$auth_key = $client->getContainer()->getParameter("auth_key");
88+
$authorizationKey = $client->getContainer()->getParameter("authorizationKey");
8989

90-
$client->request('POST', '/'.$auth_key.'/v1', array(), array(), array(), $data);
90+
$client->request('POST', '/'.$authorizationKey.'/v1', array(), array(), array(), $data);
9191

9292
$response = json_decode($client->getResponse()->getContent(), true);
9393

@@ -110,9 +110,9 @@ public function testBlinkUnoSyntaxCheckError()
110110

111111
$client = static::createClient();
112112

113-
$auth_key = $client->getContainer()->getParameter("auth_key");
113+
$authorizationKey = $client->getContainer()->getParameter("authorizationKey");
114114

115-
$client->request('POST', '/'.$auth_key.'/v1', array(), array(), array(), $data);
115+
$client->request('POST', '/'.$authorizationKey.'/v1', array(), array(), array(), $data);
116116

117117
$response = json_decode($client->getResponse()->getContent(), true);
118118

@@ -138,9 +138,9 @@ public function testBlinkUnoCompileError()
138138

139139
$client = static::createClient();
140140

141-
$auth_key = $client->getContainer()->getParameter("auth_key");
141+
$authorizationKey = $client->getContainer()->getParameter("authorizationKey");
142142

143-
$client->request('POST', '/'.$auth_key.'/v1', array(), array(), array(), $data);
143+
$client->request('POST', '/'.$authorizationKey.'/v1', array(), array(), array(), $data);
144144

145145
$response = json_decode($client->getResponse()->getContent(), true);
146146

0 commit comments

Comments
 (0)
Please sign in to comment.