Skip to content

Commit

Permalink
Fix few mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Feb 10, 2019
1 parent 7b0af8c commit 4722283
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
15 changes: 8 additions & 7 deletions lib/Aggregator.php
Expand Up @@ -3,12 +3,13 @@
namespace SimpleSAML\Module\aggregator2;

use \SimpleSAML\Error\Exception;
use \SimpleSAML\Utils\Configuration;
use \SimpleSAML\Utils\Logger;
use \SimpleSAML\Configuration;
use \SimpleSAML\Logger;
use \SimpleSAML\Utils\System;

use \SAML2\Const;
use \SAML2\SignedElement;
use \SAML2_Utils;
use \SAML2\Utils;
use \SAML2\XML\md\EntitiesDescriptor;
use \SAML2\XML\md\EntityDescriptor;
use \SAML2\XML\mdrpi\RegistrationInfo;
Expand Down Expand Up @@ -102,7 +103,7 @@ class Aggregator
*
* Values will be true if enabled, false otherwise.
*
* @var string[]|null
* @var array|null
*/
protected $protocols;

Expand All @@ -115,7 +116,7 @@ class Aggregator
*
* Values will be true if enabled, false otherwise.
*
* @var string[]|null
* @var array|null
*/
protected $roles;

Expand Down Expand Up @@ -567,7 +568,7 @@ protected function exclude(EntitiesDescriptor $descriptor)
*
* @return SAML2_XML_md_EntitiesDescriptor The EntitiesDescriptor with only the entities filtered.
*/
protected function filter(SAML2_XML_md_EntitiesDescriptor $descriptor)
protected function filter(EntitiesDescriptor $descriptor)
{
if ($this->roles === null || $this->protocols === null) {
return $descriptor;
Expand Down Expand Up @@ -644,7 +645,7 @@ public function setFilters($set)

// configure filters
$this->protocols = [
SAML2_Const::NS_SAMLP => true,
Const::NS_SAMLP => true,
'urn:oasis:names:tc:SAML:1.1:protocol' => true,
];
$this->roles = [
Expand Down
8 changes: 5 additions & 3 deletions lib/EntitySource.php
Expand Up @@ -12,6 +12,8 @@
use \SAML2\XML\md\EntitiesDescriptor;
use \SAML2\XML\md\EntityDescriptor;

use \RobRichards\XMLSecLibs\XMLSecurityKey;

/**
* Class for loading metadata from files and URLs.
*
Expand All @@ -29,7 +31,7 @@ class EntitySource
/**
* The aggregator we belong to.
*
* @var sspmod_aggregator2_Aggregator
* @var \SimpleSAML\Module\aggregator2\Aggregator
*/
protected $aggregator;

Expand Down Expand Up @@ -119,7 +121,7 @@ private function downloadMetadata()
$context = ['ssl' => []];
if ($this->sslCAFile !== null) {
$context['ssl']['cafile'] = Config::getCertPath($this->sslCAFile);
SimpleSAML\Logger::debug($this->logLoc.'Validating https connection against CA certificate(s) found in '.
Logger::debug($this->logLoc.'Validating https connection against CA certificate(s) found in '.
var_export($context['ssl']['cafile'], true));
$context['ssl']['verify_peer'] = true;
$context['ssl']['CN_match'] = parse_url($this->url, PHP_URL_HOST);
Expand All @@ -131,7 +133,7 @@ private function downloadMetadata()
return null;
}

$doc = new DOMDocument();
$doc = new \DOMDocument();
$res = $doc->loadXML($data);
if (!$res) {
Logger::error($this->logLoc.'Error parsing XML from '.var_export($this->url, true));
Expand Down
2 changes: 1 addition & 1 deletion www/get.php
Expand Up @@ -32,7 +32,7 @@
}

if ($mimetype === 'text/plain') {
$xml = \SimpleSAML\Utils\XML::::formatXMLString($xml);
$xml = \SimpleSAML\Utils\XML::formatXMLString($xml);
}

header('Content-Type: '.$mimetype);
Expand Down

0 comments on commit 4722283

Please sign in to comment.