This repository has been archived by the owner on Mar 1, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
danielbannert
committed
Sep 3, 2018
1 parent
a266c7e
commit 6dfe897
Showing
9 changed files
with
117 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
declare(strict_types=1); | ||
namespace Narrowspark\Automatic\Contract; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
interface Crawler | ||
{ | ||
/** | ||
* Checks a Composer lock file. | ||
* | ||
* @param string $lock The path to the composer.lock file | ||
* | ||
* @return array An array of two items: the number of vulnerabilities and an array of vulnerabilities | ||
*/ | ||
public function check(string $lock): array; | ||
|
||
/** | ||
* @param int $timeout | ||
* | ||
* @return void | ||
*/ | ||
public function setTimeout(int $timeout): void; | ||
|
||
/** | ||
* @param string $endPoint | ||
* | ||
* @return void | ||
*/ | ||
public function setEndPoint(string $endPoint): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
declare(strict_types=1); | ||
namespace Narrowspark\Automatic\Security\Checker; | ||
|
||
class Checker | ||
{ | ||
public function check(string $lock): array | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
declare(strict_types=1); | ||
namespace Narrowspark\Automatic\Security\Command; | ||
|
||
use Composer\Command\BaseCommand; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Input\InputOption; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
class AuditCommand extends BaseCommand | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function configure(): void | ||
{ | ||
$this | ||
->setName('audit') | ||
->setDefinition(array( | ||
new InputOption('format', '', InputOption::VALUE_REQUIRED, 'The output format', 'text'), | ||
new InputOption('endpoint', '', InputOption::VALUE_REQUIRED, 'The security checker server URL'), | ||
new InputOption('timeout', '', InputOption::VALUE_REQUIRED, 'The HTTP timeout in seconds'), | ||
)) | ||
->setDescription('Checks security issues in your project dependencies') | ||
->setHelp(<<<EOF | ||
The <info>%command.name%</info> command looks for security issues in the | ||
project dependencies: | ||
<info>%command.full_name%</info> | ||
EOF | ||
) | ||
; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
declare(strict_types=1); | ||
namespace Narrowspark\Automatic\Security\Command; | ||
|
||
use Composer\Plugin\Capability\CommandProvider; | ||
|
||
class AuditCommandProvider implements CommandProvider | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getCommands(): array | ||
{ | ||
return array(new AuditCommand()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
declare(strict_types=1); | ||
namespace Narrowspark\Automatic\Security\Crawler; |
Empty file.
Empty file.
Empty file.