-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add occ command to download the crl from marketplace + allow to use t…
…he crl from data when checking apps ....
- Loading branch information
1 parent
f0fe5a8
commit 93ed808
Showing
3 changed files
with
69 additions
and
0 deletions.
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,63 @@ | ||
<?php | ||
/** | ||
* @author Thomas Müller <[email protected]> | ||
* | ||
* @copyright Copyright (c) 2016, ownCloud GmbH | ||
* @license AGPL-3.0 | ||
* | ||
* This code is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License, version 3, | ||
* as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License, version 3, | ||
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* | ||
*/ | ||
|
||
namespace OCA\Market\Command; | ||
|
||
use OC\IntegrityCheck\Checker; | ||
use OCA\Market\MarketService; | ||
use OCP\IConfig; | ||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
class UpdateCrl extends Command { | ||
|
||
/** @var MarketService */ | ||
private $marketService; | ||
/** @var IConfig */ | ||
private $config; | ||
/** @var Checker */ | ||
private $checker; | ||
|
||
public function __construct(MarketService $marketService, IConfig $config, Checker $checker) { | ||
parent::__construct(); | ||
$this->marketService = $marketService; | ||
$this->config = $config; | ||
$this->checker = $checker; | ||
} | ||
|
||
protected function configure() { | ||
$this | ||
->setName('market:update-crl') | ||
->setDescription('Downloads the current certificate revocation list from the marketplace'); | ||
} | ||
|
||
protected function execute(InputInterface $input, OutputInterface $output) { | ||
$output->writeln("Downloading certificate revocation list ..."); | ||
$crl = $this->marketService->downloadCrl(); | ||
$output->writeln("Validating certificate revocation list ..."); | ||
$this->checker->validateCrl($crl); | ||
$output->writeln("Writing intermediate.crl.pem ..."); | ||
$target = $this->config->getSystemValue('datadirectory') . '/intermediate.crl.pem'; | ||
file_put_contents($target, $crl); | ||
$output->writeln("Done."); | ||
} | ||
} |
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