diff --git a/application/libraries/Metadata_validator.php b/application/libraries/Metadata_validator.php index 8bec02a01..550ae4594 100644 --- a/application/libraries/Metadata_validator.php +++ b/application/libraries/Metadata_validator.php @@ -4,12 +4,18 @@ class Metadata_validator { + protected $rootSchemaFile; function __construct() { $this->ci = &get_instance(); $this->em = $this->ci->doctrine->em; $this->ci->load->helper('metadata_elements'); + $this->rootSchemaFile = $this->ci->config->item('rootSchemaFile'); + if(empty($this->rootSchemaFile)) + { + $this->rootSchemaFile = 'saml-schema-metadata-2.0.xsd'; + } } public function validateWithSchema($metadata = null) @@ -40,11 +46,11 @@ function ($public, $system, $context) use ($mapping) { throw new RuntimeException($message); } ); - $schemaLocation = 'schemas/new/saml-schema-metadata-2.0.xsd'; + $schemaLocation = 'schemas/new/'.$this->rootSchemaFile; } else { - $schemaLocation = 'schemas/old/saml-schema-metadata-2.0.xsd'; + $schemaLocation = 'schemas/old/'.$this->rootSchemaFile; } diff --git a/application/libraries/Xmlvalidator.php b/application/libraries/Xmlvalidator.php index bebd157ed..af45262c7 100644 --- a/application/libraries/Xmlvalidator.php +++ b/application/libraries/Xmlvalidator.php @@ -7,6 +7,7 @@ class Xmlvalidator private $xmlDOM; private $pubKey; + private $rootSchemaFile; function __construct() { @@ -18,6 +19,11 @@ function __construct() $this->xmlDOM = new \DOMDocument(); $this->xmlDOM->strictErrorChecking = FALSE; $this->xmlDOM->WarningChecking = FALSE; + $this->rootSchemaFile = $this->ci->config->item('rootSchemaFile'); + if(empty($this->rootSchemaFile)) + { + $this->rootSchemaFile = 'saml-schema-metadata-2.0.xsd'; + } } public function validateMetadata($xml, $signed = FALSE, $pubkey = FALSE) @@ -48,7 +54,7 @@ public function validateMetadata($xml, $signed = FALSE, $pubkey = FALSE) } if ($signed === FALSE) { - $result = $this->xmlDOM->schemaValidate('schemas/old/saml-schema-metadata-2.0.xsd'); + $result = $this->xmlDOM->schemaValidate('schemas/old/'.$this->rootSchemaFile.''); $errors = libxml_get_errors(); if ($result === TRUE) { @@ -118,7 +124,7 @@ public function validateMetadata($xml, $signed = FALSE, $pubkey = FALSE) } else { - $result = $this->xmlDOM->schemaValidate('schemas/old/saml-schema-metadata-2.0.xsd'); + $result = $this->xmlDOM->schemaValidate('schemas/old/'.$this->rootSchemaFile.''); $errors = libxml_get_errors(); if ($result === TRUE) { diff --git a/schemas/new/oasis-200401-wss-wssecurity-utility-1.0.xsd b/schemas/new/oasis-200401-wss-wssecurity-utility-1.0.xsd new file mode 100644 index 000000000..f8d74e9c6 --- /dev/null +++ b/schemas/new/oasis-200401-wss-wssecurity-utility-1.0.xsd @@ -0,0 +1,108 @@ + + + + + + + +This type defines the fault code value for Timestamp message expiration. + + + + + + + + + + +This global attribute supports annotating arbitrary elements with an ID. + + + + + + +Convenience attribute group used to simplify this schema. + + + + + + + + + +This type is for elements whose [children] is a psuedo-dateTime and can have arbitrary attributes. + + + + + + + + + + + +This type is for elements whose [children] is an anyURI and can have arbitrary attributes. + + + + + + + + + + + + +This complex type ties together the timestamp related elements into a composite type. + + + + + + + + + + + + + + +This element allows Timestamps to be applied anywhere element wildcards are present, +including as a SOAP header. + + + + + + + +This element allows an expiration time to be applied anywhere element wildcards are present. + + + + + + +This element allows a creation time to be applied anywhere element wildcards are present. + + + + diff --git a/schemas/new/ws-addr.xsd b/schemas/new/ws-addr.xsd new file mode 100644 index 000000000..47362edbe --- /dev/null +++ b/schemas/new/ws-addr.xsd @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/schemas/old/oasis-200401-wss-wssecurity-utility-1.0.xsd b/schemas/old/oasis-200401-wss-wssecurity-utility-1.0.xsd new file mode 100644 index 000000000..f8d74e9c6 --- /dev/null +++ b/schemas/old/oasis-200401-wss-wssecurity-utility-1.0.xsd @@ -0,0 +1,108 @@ + + + + + + + +This type defines the fault code value for Timestamp message expiration. + + + + + + + + + + +This global attribute supports annotating arbitrary elements with an ID. + + + + + + +Convenience attribute group used to simplify this schema. + + + + + + + + + +This type is for elements whose [children] is a psuedo-dateTime and can have arbitrary attributes. + + + + + + + + + + + +This type is for elements whose [children] is an anyURI and can have arbitrary attributes. + + + + + + + + + + + + +This complex type ties together the timestamp related elements into a composite type. + + + + + + + + + + + + + + +This element allows Timestamps to be applied anywhere element wildcards are present, +including as a SOAP header. + + + + + + + +This element allows an expiration time to be applied anywhere element wildcards are present. + + + + + + +This element allows a creation time to be applied anywhere element wildcards are present. + + + + diff --git a/schemas/old/ws-addr.xsd b/schemas/old/ws-addr.xsd new file mode 100644 index 000000000..47362edbe --- /dev/null +++ b/schemas/old/ws-addr.xsd @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +