/** * Create a Scope. * * @param \DOMElement|null $xml The XML element we should load. */ public function __construct(\DOMElement $xml = null) { if ($xml === null) { return; } $this->scope = $xml->textContent; $this->regexp = Utils::parseBoolean($xml, 'regexp', null); }
/** * Initialize an RequestedAttribute. * * @param \DOMElement|null $xml The XML element we should load. */ public function __construct(\DOMElement $xml = null) { parent::__construct($xml); if ($xml === null) { return; } $this->isRequired = Utils::parseBoolean($xml, 'isRequired', null); }
/** * Initialize an IndexedEndpointType. * * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ public function __construct(\DOMElement $xml = null) { parent::__construct($xml); if ($xml === null) { return; } if (!$xml->hasAttribute('index')) { throw new \Exception('Missing index on ' . $xml->tagName); } $this->index = (int) $xml->getAttribute('index'); $this->isDefault = Utils::parseBoolean($xml, 'isDefault', null); }
/** * Initialize a SPSSODescriptor. * * @param \DOMElement|null $xml The XML element we should load. */ public function __construct(\DOMElement $xml = null) { parent::__construct('md:SPSSODescriptor', $xml); if ($xml === null) { return; } $this->AuthnRequestsSigned = Utils::parseBoolean($xml, 'AuthnRequestsSigned', null); $this->WantAssertionsSigned = Utils::parseBoolean($xml, 'WantAssertionsSigned', null); foreach (Utils::xpQuery($xml, './saml_metadata:AssertionConsumerService') as $ep) { $this->AssertionConsumerService[] = new IndexedEndpointType($ep); } foreach (Utils::xpQuery($xml, './saml_metadata:AttributeConsumingService') as $acs) { $this->AttributeConsumingService[] = new AttributeConsumingService($acs); } }
/** * Initialize / parse an AttributeConsumingService. * * @param \DOMElement|null $xml The XML element we should load. * @throws \Exception */ public function __construct(\DOMElement $xml = null) { if ($xml === null) { return; } if (!$xml->hasAttribute('index')) { throw new \Exception('Missing index on AttributeConsumingService.'); } $this->index = (int) $xml->getAttribute('index'); $this->isDefault = Utils::parseBoolean($xml, 'isDefault', null); $this->ServiceName = Utils::extractLocalizedStrings($xml, Constants::NS_MD, 'ServiceName'); if (empty($this->ServiceName)) { throw new \Exception('Missing ServiceName in AttributeConsumingService.'); } $this->ServiceDescription = Utils::extractLocalizedStrings($xml, Constants::NS_MD, 'ServiceDescription'); foreach (Utils::xpQuery($xml, './saml_metadata:RequestedAttribute') as $ra) { $this->RequestedAttribute[] = new RequestedAttribute($ra); } }
/** * Initialize an IDPSSODescriptor. * * @param \DOMElement|null $xml The XML element we should load. */ public function __construct(\DOMElement $xml = null) { parent::__construct('md:IDPSSODescriptor', $xml); if ($xml === null) { return; } $this->WantAuthnRequestsSigned = Utils::parseBoolean($xml, 'WantAuthnRequestsSigned', null); foreach (Utils::xpQuery($xml, './saml_metadata:SingleSignOnService') as $ep) { $this->SingleSignOnService[] = new EndpointType($ep); } foreach (Utils::xpQuery($xml, './saml_metadata:NameIDMappingService') as $ep) { $this->NameIDMappingService[] = new EndpointType($ep); } foreach (Utils::xpQuery($xml, './saml_metadata:AssertionIDRequestService') as $ep) { $this->AssertionIDRequestService[] = new EndpointType($ep); } $this->AttributeProfile = Utils::extractStrings($xml, Constants::NS_MD, 'AttributeProfile'); foreach (Utils::xpQuery($xml, './saml_assertion:Attribute') as $a) { $this->Attribute[] = new Attribute($a); } }
/** * @param \DOMElement $xml * * @throws \Exception */ protected function parseNameIdPolicy(\DOMElement $xml) { $nameIdPolicy = Utils::xpQuery($xml, './saml_protocol:NameIDPolicy'); if (empty($nameIdPolicy)) { return; } $nameIdPolicy = $nameIdPolicy[0]; if ($nameIdPolicy->hasAttribute('Format')) { $this->nameIdPolicy['Format'] = $nameIdPolicy->getAttribute('Format'); } if ($nameIdPolicy->hasAttribute('SPNameQualifier')) { $this->nameIdPolicy['SPNameQualifier'] = $nameIdPolicy->getAttribute('SPNameQualifier'); } if ($nameIdPolicy->hasAttribute('AllowCreate')) { $this->nameIdPolicy['AllowCreate'] = Utils::parseBoolean($nameIdPolicy, 'AllowCreate', false); } }