Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
This repository is part of the [codebender.cc](http://www.codebender.cc) maker and artist web platform.

[![Build Status](https://travis-ci.org/codebendercc/compiler.svg?branch=master)](https://travis-ci.org/codebendercc/compiler) [![Coverage Status](https://img.shields.io/coveralls/codebendercc/compiler.svg)](https://coveralls.io/r/codebendercc/compiler?branch=master)
[![Build Status](https://travis-ci.org/codebendercc/compiler.svg?branch=master)](https://travis-ci.org/codebendercc/compiler)
[![Coverage Status](https://coveralls.io/repos/codebendercc/compiler/badge.svg?branch=master)](https://coveralls.io/r/codebendercc/compiler?branch=master)

## And what's that?

Expand Down
2 changes: 1 addition & 1 deletion Symfony/app/config/parameters.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ parameters:
arduino_cores_dir: "/opt/codebender/codebender-arduino-core-files"
external_core_files: "/opt/codebender/external-core-files"

auth_key: "youMustChangeThis"
authorizationKey: "youMustChangeThis"

# Paths to various executables used by the compiler. These depend on the
# distribution used and the method of installation. Linking is performed by
Expand Down
2 changes: 1 addition & 1 deletion Symfony/src/Acme/DemoBundle/Resources/config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ _demo_secured:
_demo:
resource: "@AcmeDemoBundle/Controller/DemoController.php"
type: annotation
prefix: /demo
prefix: /demo
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ public function statusAction()
return new Response(json_encode(array("success" => true, "status" => "OK")));
}

public function testAction($auth_key)
public function testAction($authorizationKey)
{
$params = $this->generateParameters();

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

public function indexAction($auth_key, $version)
public function indexAction($authorizationKey, $version)
{
$params = $this->generateParameters();

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

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

if ($version != "v1")
Expand Down Expand Up @@ -122,9 +122,9 @@ public function deleteAllObjectsAction($auth_key, $version)
array("Files not deleted" => $undeletedFiles))));
}

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

if ($version != "v1")
Expand Down Expand Up @@ -188,7 +188,7 @@ public function deleteSpecificObjectsAction($auth_key, $version, $option, $to_de
*/
private function generateParameters()
{
$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");
$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");

$compiler_config = array();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,4 @@ class MCUHandler
"attiny20" => "__AVR_ATtiny20__",
"attiny40" => "__AVR_ATtiny40__");

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ function ansi_to_html($text)

return $text;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,4 @@ function validate_input($request)
// Request is valid.
return $request;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,4 @@ function debug_exec($command, /** @noinspection PhpUnusedParameterInspection */
echo "$ $command\n";
passthru("$command 2>&1");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ codebender_compiler_status_check:
defaults: { _controller: CodebenderCompilerBundle:Default:status }

codebender_compiler_test:
pattern: /{auth_key}/test/
pattern: /{authorizationKey}/test/
defaults: { _controller: CodebenderCompilerBundle:Default:test }

codebender_compiler_homepage:
pattern: /{auth_key}/{version}
pattern: /{authorizationKey}/{version}
defaults: { _controller: CodebenderCompilerBundle:Default:index }

codebender_compiler_delete_all:
pattern: /{auth_key}/{version}/delete/all/
pattern: /{authorizationKey}/{version}/delete/all/
defaults: { _controller: CodebenderCompilerBundle:Default:deleteAllObjects }

codebender_compiler_delete_specific:
pattern: /{auth_key}/{version}/delete/{option}/{to_delete}
pattern: /{authorizationKey}/{version}/delete/{option}/{to_delete}
defaults: { _controller: CodebenderCompilerBundle:Default:deleteSpecificObjects }


Expand All @@ -25,4 +25,4 @@ root:
defaults:
_controller: FrameworkBundle:Redirect:urlRedirect
path: /status
permanent: true
permanent: true
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ services:
- [pushHandler, [@compiler_log_handler]]
compiler_log_handler:
class: Monolog\Handler\StreamHandler
arguments: [%kernel.logs_dir%/compiler.log]
arguments: [%kernel.logs_dir%/compiler.log]
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public function testInvalidAPI()
{
$client = static::createClient();

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

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

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

Expand All @@ -42,9 +42,9 @@ public function testInvalidInput()
{
$client = static::createClient();

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

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

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

Expand All @@ -62,9 +62,9 @@ public function testBlinkUnoSyntaxCheck()

$client = static::createClient();

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

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

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

Expand All @@ -85,9 +85,9 @@ public function testBlinkUnoCompile()

$client = static::createClient();

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

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

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

Expand All @@ -110,9 +110,9 @@ public function testBlinkUnoSyntaxCheckError()

$client = static::createClient();

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

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

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

Expand All @@ -138,9 +138,9 @@ public function testBlinkUnoCompileError()

$client = static::createClient();

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

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

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

Expand Down