Skip to content

Commit

Permalink
TASK: Add hidden configuration 'allow_ssl_downgrade'
Browse files Browse the repository at this point in the history
  • Loading branch information
MCStreetguy committed Sep 9, 2019
1 parent 974852b commit d42b68c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Json/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ class Repository extends AbstractClass
*/
protected $options;

/**
* @var bool
*/
protected $allowSslDowngrade;

/**
* @var ComposerJson|null
*/
Expand All @@ -44,6 +49,7 @@ public function __construct(array $data = [])
$this->type = (array_key_exists('type', $data) ? $data['type'] : '');
$this->url = (array_key_exists('url', $data) ? $data['url'] : '');
$this->options = (array_key_exists('options', $data) ? $data['options'] : []);
$this->allowSslDowngrade = (array_key_exists('allow_ssl_downgrade', $data) ? $data['allow_ssl_downgrade'] : false);

$this->package = (array_key_exists('package', $data) ? new ComposerJson($data['package']) : null);
}
Expand Down Expand Up @@ -75,6 +81,16 @@ public function getOptions() : array
return $this->options;
}

/**
* Get if ssl may be downgraded for this repository.
* @see https://github.com/composer/composer/blob/0fe200d6d950b0774688713be3153bb410eb70b8/src/Composer/Repository/ComposerRepository.php#L87-L89
* @return bool
*/
public function isSslDowngradeAllowed() : bool
{
return $this->allowSslDowngrade;
}

/**
* Gets the parsed "package" key of the repository.
* @return ComposerJson|null
Expand Down

0 comments on commit d42b68c

Please sign in to comment.