repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
simplesamlphp/saml2 | src/SAML2/Assertion.php | Assertion.addAttributeStatement | private function addAttributeStatement(DOMElement $root) : void
{
if (empty($this->attributes)) {
return;
}
$document = $root->ownerDocument;
$attributeStatement = $document->createElementNS(Constants::NS_SAML, 'saml:AttributeStatement');
$root->appendChild($att... | php | private function addAttributeStatement(DOMElement $root) : void
{
if (empty($this->attributes)) {
return;
}
$document = $root->ownerDocument;
$attributeStatement = $document->createElementNS(Constants::NS_SAML, 'saml:AttributeStatement');
$root->appendChild($att... | [
"private",
"function",
"addAttributeStatement",
"(",
"DOMElement",
"$",
"root",
")",
":",
"void",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"attributes",
")",
")",
"{",
"return",
";",
"}",
"$",
"document",
"=",
"$",
"root",
"->",
"ownerDocument",
... | Add an AttributeStatement-node to the assertion.
@param \DOMElement $root The assertion element we should add the subject to.
@return void | [
"Add",
"an",
"AttributeStatement",
"-",
"node",
"to",
"the",
"assertion",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Assertion.php#L1646-L1743 |
simplesamlphp/saml2 | src/SAML2/Assertion.php | Assertion.addEncryptedAttributeStatement | private function addEncryptedAttributeStatement(DOMElement $root) : void
{
if ($this->getRequiredEncAttributes() === false) {
return;
}
Assert::notNull($this->encryptionKey);
$document = $root->ownerDocument;
$attributeStatement = $document->createElementNS(Cons... | php | private function addEncryptedAttributeStatement(DOMElement $root) : void
{
if ($this->getRequiredEncAttributes() === false) {
return;
}
Assert::notNull($this->encryptionKey);
$document = $root->ownerDocument;
$attributeStatement = $document->createElementNS(Cons... | [
"private",
"function",
"addEncryptedAttributeStatement",
"(",
"DOMElement",
"$",
"root",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"getRequiredEncAttributes",
"(",
")",
"===",
"false",
")",
"{",
"return",
";",
"}",
"Assert",
"::",
"notNull",
"(",
... | Add an EncryptedAttribute Statement-node to the assertion.
@param \DOMElement $root The assertion element we should add the Encrypted Attribute Statement to.
@return void | [
"Add",
"an",
"EncryptedAttribute",
"Statement",
"-",
"node",
"to",
"the",
"assertion",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Assertion.php#L1752-L1820 |
simplesamlphp/saml2 | src/SAML2/Compat/Ssp/Logger.php | Logger.emergency | public function emergency($message, array $context = []) : void
{
/** @psalm-suppress UndefinedClass */
SspLogger::emergency($message.($context ? " ".var_export($context, true) : ""));
} | php | public function emergency($message, array $context = []) : void
{
/** @psalm-suppress UndefinedClass */
SspLogger::emergency($message.($context ? " ".var_export($context, true) : ""));
} | [
"public",
"function",
"emergency",
"(",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
":",
"void",
"{",
"/** @psalm-suppress UndefinedClass */",
"SspLogger",
"::",
"emergency",
"(",
"$",
"message",
".",
"(",
"$",
"context",
"?",
"\" \"",
... | System is unusable.
@param string $message
@param array $context
@return void
Type hint not possible due to upstream method signature | [
"System",
"is",
"unusable",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Compat/Ssp/Logger.php#L24-L28 |
simplesamlphp/saml2 | src/SAML2/Compat/Ssp/Logger.php | Logger.alert | public function alert($message, array $context = []) : void
{
/** @psalm-suppress UndefinedClass */
SspLogger::alert($message.($context ? " ".var_export($context, true) : ""));
} | php | public function alert($message, array $context = []) : void
{
/** @psalm-suppress UndefinedClass */
SspLogger::alert($message.($context ? " ".var_export($context, true) : ""));
} | [
"public",
"function",
"alert",
"(",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
":",
"void",
"{",
"/** @psalm-suppress UndefinedClass */",
"SspLogger",
"::",
"alert",
"(",
"$",
"message",
".",
"(",
"$",
"context",
"?",
"\" \"",
".",
... | Action must be taken immediately.
Example: Entire website down, database unavailable, etc. This should
trigger the SMS alerts and wake you up.
@param string $message
@param array $context
@return void
Type hint not possible due to upstream method signature | [
"Action",
"must",
"be",
"taken",
"immediately",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Compat/Ssp/Logger.php#L43-L47 |
simplesamlphp/saml2 | src/SAML2/Compat/Ssp/Logger.php | Logger.critical | public function critical($message, array $context = []) : void
{
/** @psalm-suppress UndefinedClass */
SspLogger::critical($message.($context ? " ".var_export($context, true) : ""));
} | php | public function critical($message, array $context = []) : void
{
/** @psalm-suppress UndefinedClass */
SspLogger::critical($message.($context ? " ".var_export($context, true) : ""));
} | [
"public",
"function",
"critical",
"(",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
":",
"void",
"{",
"/** @psalm-suppress UndefinedClass */",
"SspLogger",
"::",
"critical",
"(",
"$",
"message",
".",
"(",
"$",
"context",
"?",
"\" \"",
... | Critical conditions.
Example: Application component unavailable, unexpected exception.
@param string $message
@param array $context
@return void
Type hint not possible due to upstream method signature | [
"Critical",
"conditions",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Compat/Ssp/Logger.php#L61-L65 |
simplesamlphp/saml2 | src/SAML2/Compat/Ssp/Logger.php | Logger.error | public function error($message, array $context = []) : void
{
/** @psalm-suppress UndefinedClass */
SspLogger::error($message.($context ? " ".var_export($context, true) : ""));
} | php | public function error($message, array $context = []) : void
{
/** @psalm-suppress UndefinedClass */
SspLogger::error($message.($context ? " ".var_export($context, true) : ""));
} | [
"public",
"function",
"error",
"(",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
":",
"void",
"{",
"/** @psalm-suppress UndefinedClass */",
"SspLogger",
"::",
"error",
"(",
"$",
"message",
".",
"(",
"$",
"context",
"?",
"\" \"",
".",
... | Runtime errors that do not require immediate action but should typically
be logged and monitored.
@param string $message
@param array $context
@return void
Type hint not possible due to upstream method signature | [
"Runtime",
"errors",
"that",
"do",
"not",
"require",
"immediate",
"action",
"but",
"should",
"typically",
"be",
"logged",
"and",
"monitored",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Compat/Ssp/Logger.php#L78-L82 |
simplesamlphp/saml2 | src/SAML2/Compat/Ssp/Logger.php | Logger.warning | public function warning($message, array $context = []) : void
{
/** @psalm-suppress UndefinedClass */
SspLogger::warning($message.($context ? " ".var_export($context, true) : ""));
} | php | public function warning($message, array $context = []) : void
{
/** @psalm-suppress UndefinedClass */
SspLogger::warning($message.($context ? " ".var_export($context, true) : ""));
} | [
"public",
"function",
"warning",
"(",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
":",
"void",
"{",
"/** @psalm-suppress UndefinedClass */",
"SspLogger",
"::",
"warning",
"(",
"$",
"message",
".",
"(",
"$",
"context",
"?",
"\" \"",
".... | Exceptional occurrences that are not errors.
Example: Use of deprecated APIs, poor use of an API, undesirable things
that are not necessarily wrong.
@param string $message
@param array $context
@return void
Type hint not possible due to upstream method signature | [
"Exceptional",
"occurrences",
"that",
"are",
"not",
"errors",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Compat/Ssp/Logger.php#L97-L101 |
simplesamlphp/saml2 | src/SAML2/Compat/Ssp/Logger.php | Logger.notice | public function notice($message, array $context = []) : void
{
/** @psalm-suppress UndefinedClass */
SspLogger::notice($message.($context ? " ".var_export($context, true) : ""));
} | php | public function notice($message, array $context = []) : void
{
/** @psalm-suppress UndefinedClass */
SspLogger::notice($message.($context ? " ".var_export($context, true) : ""));
} | [
"public",
"function",
"notice",
"(",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
":",
"void",
"{",
"/** @psalm-suppress UndefinedClass */",
"SspLogger",
"::",
"notice",
"(",
"$",
"message",
".",
"(",
"$",
"context",
"?",
"\" \"",
".",... | Normal but significant events.
@param string $message
@param array $context
@return void
Type hint not possible due to upstream method signature | [
"Normal",
"but",
"significant",
"events",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Compat/Ssp/Logger.php#L113-L117 |
simplesamlphp/saml2 | src/SAML2/Compat/Ssp/Logger.php | Logger.info | public function info($message, array $context = []) : void
{
/** @psalm-suppress UndefinedClass */
SspLogger::info($message.($context ? " ".var_export($context, true) : ""));
} | php | public function info($message, array $context = []) : void
{
/** @psalm-suppress UndefinedClass */
SspLogger::info($message.($context ? " ".var_export($context, true) : ""));
} | [
"public",
"function",
"info",
"(",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
":",
"void",
"{",
"/** @psalm-suppress UndefinedClass */",
"SspLogger",
"::",
"info",
"(",
"$",
"message",
".",
"(",
"$",
"context",
"?",
"\" \"",
".",
"... | Interesting events.
Example: User logs in, SQL logs.
@param string $message
@param array $context
@return void
Type hint not possible due to upstream method signature | [
"Interesting",
"events",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Compat/Ssp/Logger.php#L131-L135 |
simplesamlphp/saml2 | src/SAML2/Compat/Ssp/Logger.php | Logger.debug | public function debug($message, array $context = []) : void
{
/** @psalm-suppress UndefinedClass */
SspLogger::debug($message.($context ? " ".var_export($context, true) : ""));
} | php | public function debug($message, array $context = []) : void
{
/** @psalm-suppress UndefinedClass */
SspLogger::debug($message.($context ? " ".var_export($context, true) : ""));
} | [
"public",
"function",
"debug",
"(",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
":",
"void",
"{",
"/** @psalm-suppress UndefinedClass */",
"SspLogger",
"::",
"debug",
"(",
"$",
"message",
".",
"(",
"$",
"context",
"?",
"\" \"",
".",
... | Detailed debug information.
@param string $message
@param array $context
@return void
Type hint not possible due to upstream method signature | [
"Detailed",
"debug",
"information",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Compat/Ssp/Logger.php#L147-L151 |
simplesamlphp/saml2 | src/SAML2/XML/ecp/Response.php | Response.setAssertionConsumerServiceURL | public function setAssertionConsumerServiceURL(string $assertionConsumerServiceURL) : void
{
if (!filter_var($assertionConsumerServiceURL, FILTER_VALIDATE_URL)) {
throw new InvalidArgumentException('AssertionConsumerServiceURL is not a valid URL.');
}
$this->AssertionConsumerServ... | php | public function setAssertionConsumerServiceURL(string $assertionConsumerServiceURL) : void
{
if (!filter_var($assertionConsumerServiceURL, FILTER_VALIDATE_URL)) {
throw new InvalidArgumentException('AssertionConsumerServiceURL is not a valid URL.');
}
$this->AssertionConsumerServ... | [
"public",
"function",
"setAssertionConsumerServiceURL",
"(",
"string",
"$",
"assertionConsumerServiceURL",
")",
":",
"void",
"{",
"if",
"(",
"!",
"filter_var",
"(",
"$",
"assertionConsumerServiceURL",
",",
"FILTER_VALIDATE_URL",
")",
")",
"{",
"throw",
"new",
"Inval... | Set the value of the AssertionConsumerServiceURL-property
@param string $assertionConsumerServiceURL
@throws InvalidArgumentException
@return void | [
"Set",
"the",
"value",
"of",
"the",
"AssertionConsumerServiceURL",
"-",
"property"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/ecp/Response.php#L76-L82 |
simplesamlphp/saml2 | src/SAML2/XML/ecp/Response.php | Response.toXML | public function toXML(DOMElement $parent) : DOMElement
{
if (!is_string($this->getAssertionConsumerServiceURL())) {
throw new InvalidArgumentException("AssertionConsumerServiceURL must be a string");
}
$doc = $parent->ownerDocument;
$response = $doc->createElementNS(Cons... | php | public function toXML(DOMElement $parent) : DOMElement
{
if (!is_string($this->getAssertionConsumerServiceURL())) {
throw new InvalidArgumentException("AssertionConsumerServiceURL must be a string");
}
$doc = $parent->ownerDocument;
$response = $doc->createElementNS(Cons... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"this",
"->",
"getAssertionConsumerServiceURL",
"(",
")",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"... | Convert this ECP Response to XML.
@param \DOMElement $parent The element we should append this element to.
@throws InvalidArgumentException
@return \DOMElement | [
"Convert",
"this",
"ECP",
"Response",
"to",
"XML",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/ecp/Response.php#L92-L108 |
simplesamlphp/saml2 | src/SAML2/XML/md/IndexedEndpointType.php | IndexedEndpointType.toXML | public function toXML(DOMElement $parent, string $name) : DOMElement
{
$e = parent::toXML($parent, $name);
$e->setAttribute('index', strval($this->index));
if (is_bool($this->isDefault)) {
$e->setAttribute('isDefault', $this->isDefault ? 'true' : 'false');
}
ret... | php | public function toXML(DOMElement $parent, string $name) : DOMElement
{
$e = parent::toXML($parent, $name);
$e->setAttribute('index', strval($this->index));
if (is_bool($this->isDefault)) {
$e->setAttribute('isDefault', $this->isDefault ? 'true' : 'false');
}
ret... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
",",
"string",
"$",
"name",
")",
":",
"DOMElement",
"{",
"$",
"e",
"=",
"parent",
"::",
"toXML",
"(",
"$",
"parent",
",",
"$",
"name",
")",
";",
"$",
"e",
"->",
"setAttribute",
"(",
"... | Add this endpoint to an XML element.
@param \DOMElement $parent The element we should append this endpoint to.
@param string $name The name of the element we should create.
@return \DOMElement | [
"Add",
"this",
"endpoint",
"to",
"an",
"XML",
"element",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/IndexedEndpointType.php#L109-L119 |
simplesamlphp/saml2 | src/SAML2/ArtifactResponse.php | ArtifactResponse.toUnsignedXML | public function toUnsignedXML() : DOMElement
{
$root = parent::toUnsignedXML();
if (isset($this->any)) {
$node = $root->ownerDocument->importNode($this->any, true);
$root->appendChild($node);
}
return $root;
} | php | public function toUnsignedXML() : DOMElement
{
$root = parent::toUnsignedXML();
if (isset($this->any)) {
$node = $root->ownerDocument->importNode($this->any, true);
$root->appendChild($node);
}
return $root;
} | [
"public",
"function",
"toUnsignedXML",
"(",
")",
":",
"DOMElement",
"{",
"$",
"root",
"=",
"parent",
"::",
"toUnsignedXML",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"any",
")",
")",
"{",
"$",
"node",
"=",
"$",
"root",
"->",
"owner... | Convert the response message to an XML element.
@return \DOMElement This response. | [
"Convert",
"the",
"response",
"message",
"to",
"an",
"XML",
"element",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/ArtifactResponse.php#L77-L86 |
simplesamlphp/saml2 | src/SAML2/Utilities/File.php | File.getFileContents | public static function getFileContents(string $file) : string
{
if (!is_readable($file)) {
throw new RuntimeException(sprintf(
'File "%s" does not exist or is not readable',
$file
));
}
$contents = file_get_contents($file);
if ... | php | public static function getFileContents(string $file) : string
{
if (!is_readable($file)) {
throw new RuntimeException(sprintf(
'File "%s" does not exist or is not readable',
$file
));
}
$contents = file_get_contents($file);
if ... | [
"public",
"static",
"function",
"getFileContents",
"(",
"string",
"$",
"file",
")",
":",
"string",
"{",
"if",
"(",
"!",
"is_readable",
"(",
"$",
"file",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"sprintf",
"(",
"'File \"%s\" does not exist or is ... | @param string $file full absolute path to the file
@return string | [
"@param",
"string",
"$file",
"full",
"absolute",
"path",
"to",
"the",
"file"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Utilities/File.php#L20-L38 |
simplesamlphp/saml2 | src/SAML2/XML/mdui/Logo.php | Logo.setUrl | public function setUrl(string $url) : void
{
if (!filter_var(trim($url), FILTER_VALIDATE_URL) && substr(trim($url), 0, 5) !== 'data:') {
throw new \InvalidArgumentException('mdui:Logo is not a valid URL.');
}
$this->url = $url;
} | php | public function setUrl(string $url) : void
{
if (!filter_var(trim($url), FILTER_VALIDATE_URL) && substr(trim($url), 0, 5) !== 'data:') {
throw new \InvalidArgumentException('mdui:Logo is not a valid URL.');
}
$this->url = $url;
} | [
"public",
"function",
"setUrl",
"(",
"string",
"$",
"url",
")",
":",
"void",
"{",
"if",
"(",
"!",
"filter_var",
"(",
"trim",
"(",
"$",
"url",
")",
",",
"FILTER_VALIDATE_URL",
")",
"&&",
"substr",
"(",
"trim",
"(",
"$",
"url",
")",
",",
"0",
",",
... | Set the value of the url-property
@param string $url
@return void | [
"Set",
"the",
"value",
"of",
"the",
"url",
"-",
"property"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/mdui/Logo.php#L93-L99 |
simplesamlphp/saml2 | src/SAML2/XML/mdui/Logo.php | Logo.toXML | public function toXML(DOMElement $parent) : DOMElement
{
$doc = $parent->ownerDocument;
$e = $doc->createElementNS(Common::NS, 'mdui:Logo');
$e->appendChild($doc->createTextNode($this->url));
$e->setAttribute('width', strval($this->width));
$e->setAttribute('height', strval(... | php | public function toXML(DOMElement $parent) : DOMElement
{
$doc = $parent->ownerDocument;
$e = $doc->createElementNS(Common::NS, 'mdui:Logo');
$e->appendChild($doc->createTextNode($this->url));
$e->setAttribute('width', strval($this->width));
$e->setAttribute('height', strval(... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"$",
"doc",
"=",
"$",
"parent",
"->",
"ownerDocument",
";",
"$",
"e",
"=",
"$",
"doc",
"->",
"createElementNS",
"(",
"Common",
"::",
"NS",
",",
"'mdui:Logo'",
... | Convert this Logo to XML.
@param \DOMElement $parent The element we should append this Logo to.
@return \DOMElement | [
"Convert",
"this",
"Logo",
"to",
"XML",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/mdui/Logo.php#L177-L191 |
simplesamlphp/saml2 | src/SAML2/XML/md/ContactPerson.php | ContactPerson.getStringElements | private static function getStringElements(\DOMElement $parent, string $name) : array
{
$e = Utils::xpQuery($parent, './saml_metadata:'.$name);
$ret = [];
foreach ($e as $i) {
$ret[] = $i->textContent;
}
return $ret;
} | php | private static function getStringElements(\DOMElement $parent, string $name) : array
{
$e = Utils::xpQuery($parent, './saml_metadata:'.$name);
$ret = [];
foreach ($e as $i) {
$ret[] = $i->textContent;
}
return $ret;
} | [
"private",
"static",
"function",
"getStringElements",
"(",
"\\",
"DOMElement",
"$",
"parent",
",",
"string",
"$",
"name",
")",
":",
"array",
"{",
"$",
"e",
"=",
"Utils",
"::",
"xpQuery",
"(",
"$",
"parent",
",",
"'./saml_metadata:'",
".",
"$",
"name",
")... | Retrieve the value of a child \DOMElements as an array of strings.
@param \DOMElement $parent The parent element.
@param string $name The name of the child elements.
@return array The value of the child elements. | [
"Retrieve",
"the",
"value",
"of",
"a",
"child",
"\\",
"DOMElements",
"as",
"an",
"array",
"of",
"strings",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/ContactPerson.php#L121-L131 |
simplesamlphp/saml2 | src/SAML2/XML/md/ContactPerson.php | ContactPerson.getStringElement | private static function getStringElement(\DOMElement $parent, string $name) : ?string
{
$e = self::getStringElements($parent, $name);
if (empty($e)) {
return null;
}
if (count($e) > 1) {
throw new \Exception('More than one '.$name.' in '.$parent->tagName);
... | php | private static function getStringElement(\DOMElement $parent, string $name) : ?string
{
$e = self::getStringElements($parent, $name);
if (empty($e)) {
return null;
}
if (count($e) > 1) {
throw new \Exception('More than one '.$name.' in '.$parent->tagName);
... | [
"private",
"static",
"function",
"getStringElement",
"(",
"\\",
"DOMElement",
"$",
"parent",
",",
"string",
"$",
"name",
")",
":",
"?",
"string",
"{",
"$",
"e",
"=",
"self",
"::",
"getStringElements",
"(",
"$",
"parent",
",",
"$",
"name",
")",
";",
"if... | Retrieve the value of a child \DOMElement as a string.
@param \DOMElement $parent The parent element.
@param string $name The name of the child element.
@throws \Exception
@return string|null The value of the child element. | [
"Retrieve",
"the",
"value",
"of",
"a",
"child",
"\\",
"DOMElement",
"as",
"a",
"string",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/ContactPerson.php#L142-L153 |
simplesamlphp/saml2 | src/SAML2/XML/md/ContactPerson.php | ContactPerson.addContactPersonAttributes | public function addContactPersonAttributes(string $attr, string $value) : void
{
$this->ContactPersonAttributes[$attr] = $value;
} | php | public function addContactPersonAttributes(string $attr, string $value) : void
{
$this->ContactPersonAttributes[$attr] = $value;
} | [
"public",
"function",
"addContactPersonAttributes",
"(",
"string",
"$",
"attr",
",",
"string",
"$",
"value",
")",
":",
"void",
"{",
"$",
"this",
"->",
"ContactPersonAttributes",
"[",
"$",
"attr",
"]",
"=",
"$",
"value",
";",
"}"
] | Add the key/value of the ContactPersonAttributes-property
@param string $attr
@param string $value
@return void | [
"Add",
"the",
"key",
"/",
"value",
"of",
"the",
"ContactPersonAttributes",
"-",
"property"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/ContactPerson.php#L383-L386 |
simplesamlphp/saml2 | src/SAML2/XML/md/ContactPerson.php | ContactPerson.toXML | public function toXML(DOMElement $parent) : DOMElement
{
$doc = $parent->ownerDocument;
$e = $doc->createElementNS(Constants::NS_MD, 'md:ContactPerson');
$parent->appendChild($e);
$e->setAttribute('contactType', $this->getContactType());
foreach ($this->getContactPersonAtt... | php | public function toXML(DOMElement $parent) : DOMElement
{
$doc = $parent->ownerDocument;
$e = $doc->createElementNS(Constants::NS_MD, 'md:ContactPerson');
$parent->appendChild($e);
$e->setAttribute('contactType', $this->getContactType());
foreach ($this->getContactPersonAtt... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"$",
"doc",
"=",
"$",
"parent",
"->",
"ownerDocument",
";",
"$",
"e",
"=",
"$",
"doc",
"->",
"createElementNS",
"(",
"Constants",
"::",
"NS_MD",
",",
"'md:Conta... | Convert this ContactPerson to XML.
@param \DOMElement $parent The element we should add this contact to.
@return \DOMElement The new ContactPerson-element. | [
"Convert",
"this",
"ContactPerson",
"to",
"XML",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/ContactPerson.php#L395-L427 |
simplesamlphp/saml2 | src/SAML2/XML/md/PDPDescriptor.php | PDPDescriptor.toXML | public function toXML(DOMElement $parent) : DOMElement
{
Assert::notEmpty($this->AuthzService);
$e = parent::toXML($parent);
foreach ($this->AuthzService as $ep) {
$ep->toXML($e, 'md:AuthzService');
}
foreach ($this->AssertionIDRequestService as $ep) {
... | php | public function toXML(DOMElement $parent) : DOMElement
{
Assert::notEmpty($this->AuthzService);
$e = parent::toXML($parent);
foreach ($this->AuthzService as $ep) {
$ep->toXML($e, 'md:AuthzService');
}
foreach ($this->AssertionIDRequestService as $ep) {
... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"Assert",
"::",
"notEmpty",
"(",
"$",
"this",
"->",
"AuthzService",
")",
";",
"$",
"e",
"=",
"parent",
"::",
"toXML",
"(",
"$",
"parent",
")",
";",
"foreach",... | Add this PDPDescriptor to an EntityDescriptor.
@param \DOMElement $parent The EntityDescriptor we should append this IDPSSODescriptor to.
@return \DOMElement | [
"Add",
"this",
"PDPDescriptor",
"to",
"an",
"EntityDescriptor",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/PDPDescriptor.php#L178-L195 |
simplesamlphp/saml2 | src/SAML2/Utilities/ArrayCollection.php | ArrayCollection.remove | public function remove($element) : void
{
$key = array_search($element, $this->elements);
if ($key === false) {
return;
}
unset($this->elements[$key]);
} | php | public function remove($element) : void
{
$key = array_search($element, $this->elements);
if ($key === false) {
return;
}
unset($this->elements[$key]);
} | [
"public",
"function",
"remove",
"(",
"$",
"element",
")",
":",
"void",
"{",
"$",
"key",
"=",
"array_search",
"(",
"$",
"element",
",",
"$",
"this",
"->",
"elements",
")",
";",
"if",
"(",
"$",
"key",
"===",
"false",
")",
"{",
"return",
";",
"}",
"... | @param mixed $element
@return void | [
"@param",
"mixed",
"$element"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Utilities/ArrayCollection.php#L83-L90 |
simplesamlphp/saml2 | src/SAML2/XML/md/Organization.php | Organization.toXML | public function toXML(DOMElement $parent) : DOMElement
{
Assert::notEmpty($this->OrganizationName);
Assert::notEmpty($this->OrganizationDisplayName);
Assert::notEmpty($this->OrganizationURL);
$doc = $parent->ownerDocument;
$e = $doc->createElementNS(Constants::NS_MD, 'md:Or... | php | public function toXML(DOMElement $parent) : DOMElement
{
Assert::notEmpty($this->OrganizationName);
Assert::notEmpty($this->OrganizationDisplayName);
Assert::notEmpty($this->OrganizationURL);
$doc = $parent->ownerDocument;
$e = $doc->createElementNS(Constants::NS_MD, 'md:Or... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"Assert",
"::",
"notEmpty",
"(",
"$",
"this",
"->",
"OrganizationName",
")",
";",
"Assert",
"::",
"notEmpty",
"(",
"$",
"this",
"->",
"OrganizationDisplayName",
")"... | Convert this Organization to XML.
@param \DOMElement $parent The element we should add this organization to.
@return \DOMElement This Organization-element. | [
"Convert",
"this",
"Organization",
"to",
"XML",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/Organization.php#L196-L214 |
simplesamlphp/saml2 | src/SAML2/Signature/Validator.php | Validator.hasValidSignature | public function hasValidSignature(
SignedElement $signedElement,
CertificateProvider $configuration
) : bool {
// should be DI
$validator = new ValidatorChain(
$this->logger,
[
new PublicKeyValidator($this->logger, new KeyLoader())
... | php | public function hasValidSignature(
SignedElement $signedElement,
CertificateProvider $configuration
) : bool {
// should be DI
$validator = new ValidatorChain(
$this->logger,
[
new PublicKeyValidator($this->logger, new KeyLoader())
... | [
"public",
"function",
"hasValidSignature",
"(",
"SignedElement",
"$",
"signedElement",
",",
"CertificateProvider",
"$",
"configuration",
")",
":",
"bool",
"{",
"// should be DI",
"$",
"validator",
"=",
"new",
"ValidatorChain",
"(",
"$",
"this",
"->",
"logger",
","... | @param SignedElement $signedElement
@param CertificateProvider $configuration
@return bool | [
"@param",
"SignedElement",
"$signedElement",
"@param",
"CertificateProvider",
"$configuration"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Signature/Validator.php#L41-L54 |
simplesamlphp/saml2 | src/SAML2/XML/md/KeyDescriptor.php | KeyDescriptor.toXML | public function toXML(DOMElement $parent) : DOMElement
{
if ($this->KeyInfo === null) {
throw new \Exception('Cannot convert KeyDescriptor to XML without KeyInfo set.');
}
$doc = $parent->ownerDocument;
$e = $doc->createElementNS(Constants::NS_MD, 'md:KeyDescriptor');
... | php | public function toXML(DOMElement $parent) : DOMElement
{
if ($this->KeyInfo === null) {
throw new \Exception('Cannot convert KeyDescriptor to XML without KeyInfo set.');
}
$doc = $parent->ownerDocument;
$e = $doc->createElementNS(Constants::NS_MD, 'md:KeyDescriptor');
... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"if",
"(",
"$",
"this",
"->",
"KeyInfo",
"===",
"null",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Cannot convert KeyDescriptor to XML without KeyInfo set.'",
... | Convert this KeyDescriptor to XML.
@param \DOMElement $parent The element we should append this KeyDescriptor to.
@return \DOMElement | [
"Convert",
"this",
"KeyDescriptor",
"to",
"XML",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/KeyDescriptor.php#L167-L189 |
simplesamlphp/saml2 | src/SAML2/SOAP.php | SOAP.send | public function send(Message $message) : void
{
header('Content-Type: text/xml', true);
$xml = $this->getOutputToSend($message);
if ($xml !== false) {
Utils::getContainer()->debugMessage($xml, 'out');
echo $xml;
}
// DOMDocument::saveXML() returned f... | php | public function send(Message $message) : void
{
header('Content-Type: text/xml', true);
$xml = $this->getOutputToSend($message);
if ($xml !== false) {
Utils::getContainer()->debugMessage($xml, 'out');
echo $xml;
}
// DOMDocument::saveXML() returned f... | [
"public",
"function",
"send",
"(",
"Message",
"$",
"message",
")",
":",
"void",
"{",
"header",
"(",
"'Content-Type: text/xml'",
",",
"true",
")",
";",
"$",
"xml",
"=",
"$",
"this",
"->",
"getOutputToSend",
"(",
"$",
"message",
")",
";",
"if",
"(",
"$",... | Send a SAML 2 message using the SOAP binding.
Note: This function never returns.
@param \SAML2\Message $message The message we should send.
@return void | [
"Send",
"a",
"SAML",
"2",
"message",
"using",
"the",
"SOAP",
"binding",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/SOAP.php#L79-L91 |
simplesamlphp/saml2 | src/SAML2/SOAP.php | SOAP.receive | public function receive() : Message
{
$postText = $this->getInputStream();
if ($postText === false) {
throw new \Exception('Invalid message received to AssertionConsumerService endpoint.');
}
$document = DOMDocumentFactory::fromString($postText);
$xml = $documen... | php | public function receive() : Message
{
$postText = $this->getInputStream();
if ($postText === false) {
throw new \Exception('Invalid message received to AssertionConsumerService endpoint.');
}
$document = DOMDocumentFactory::fromString($postText);
$xml = $documen... | [
"public",
"function",
"receive",
"(",
")",
":",
"Message",
"{",
"$",
"postText",
"=",
"$",
"this",
"->",
"getInputStream",
"(",
")",
";",
"if",
"(",
"$",
"postText",
"===",
"false",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Invalid message rece... | Receive a SAML 2 message sent using the HTTP-POST binding.
@throws \Exception If unable to receive the message
@return \SAML2\Message The received message. | [
"Receive",
"a",
"SAML",
"2",
"message",
"sent",
"using",
"the",
"HTTP",
"-",
"POST",
"binding",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/SOAP.php#L100-L115 |
simplesamlphp/saml2 | src/SAML2/XML/alg/SigningMethod.php | SigningMethod.toXML | public function toXML(DOMElement $parent) : DOMElement
{
Assert::stringNotEmpty($this->Algorithm, 'Cannot convert SigningMethod to XML without an Algorithm set.');
Assert::nullOrInteger($this->MinKeySize);
Assert::nullOrInteger($this->MaxKeySize);
$doc = $parent->ownerDocument;
... | php | public function toXML(DOMElement $parent) : DOMElement
{
Assert::stringNotEmpty($this->Algorithm, 'Cannot convert SigningMethod to XML without an Algorithm set.');
Assert::nullOrInteger($this->MinKeySize);
Assert::nullOrInteger($this->MaxKeySize);
$doc = $parent->ownerDocument;
... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"Assert",
"::",
"stringNotEmpty",
"(",
"$",
"this",
"->",
"Algorithm",
",",
"'Cannot convert SigningMethod to XML without an Algorithm set.'",
")",
";",
"Assert",
"::",
"nu... | Convert this element to XML.
@param \DOMElement $parent The element we should append to.
@return \DOMElement
@throws \Exception | [
"Convert",
"this",
"element",
"to",
"XML",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/alg/SigningMethod.php#L147-L167 |
simplesamlphp/saml2 | src/SAML2/XML/md/RequestedAttribute.php | RequestedAttribute.toXML | public function toXML(DOMElement $parent) : DOMElement
{
$e = $this->toXMLInternal($parent, Constants::NS_MD, 'md:RequestedAttribute');
if (is_bool($this->isRequired)) {
$e->setAttribute('isRequired', $this->isRequired ? 'true' : 'false');
}
return $e;
} | php | public function toXML(DOMElement $parent) : DOMElement
{
$e = $this->toXMLInternal($parent, Constants::NS_MD, 'md:RequestedAttribute');
if (is_bool($this->isRequired)) {
$e->setAttribute('isRequired', $this->isRequired ? 'true' : 'false');
}
return $e;
} | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"$",
"e",
"=",
"$",
"this",
"->",
"toXMLInternal",
"(",
"$",
"parent",
",",
"Constants",
"::",
"NS_MD",
",",
"'md:RequestedAttribute'",
")",
";",
"if",
"(",
"is... | Convert this RequestedAttribute to XML.
@param \DOMElement $parent The element we should append this RequestedAttribute to.
@return \DOMElement | [
"Convert",
"this",
"RequestedAttribute",
"to",
"XML",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/RequestedAttribute.php#L74-L83 |
simplesamlphp/saml2 | src/SAML2/XML/md/IDPSSODescriptor.php | IDPSSODescriptor.toXML | public function toXML(DOMElement $parent) : DOMElement
{
$e = parent::toXML($parent);
if (is_bool($this->WantAuthnRequestsSigned)) {
$e->setAttribute('WantAuthnRequestsSigned', $this->WantAuthnRequestsSigned ? 'true' : 'false');
}
foreach ($this->SingleSignOnService as ... | php | public function toXML(DOMElement $parent) : DOMElement
{
$e = parent::toXML($parent);
if (is_bool($this->WantAuthnRequestsSigned)) {
$e->setAttribute('WantAuthnRequestsSigned', $this->WantAuthnRequestsSigned ? 'true' : 'false');
}
foreach ($this->SingleSignOnService as ... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"$",
"e",
"=",
"parent",
"::",
"toXML",
"(",
"$",
"parent",
")",
";",
"if",
"(",
"is_bool",
"(",
"$",
"this",
"->",
"WantAuthnRequestsSigned",
")",
")",
"{",
... | Add this IDPSSODescriptor to an EntityDescriptor.
@param \DOMElement $parent The EntityDescriptor we should append this IDPSSODescriptor to.
@return \DOMElement | [
"Add",
"this",
"IDPSSODescriptor",
"to",
"an",
"EntityDescriptor",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/IDPSSODescriptor.php#L303-L330 |
simplesamlphp/saml2 | src/SAML2/Assertion/Processor.php | Processor.decryptAssertions | public function decryptAssertions(ArrayCollection $assertions)
{
$decrypted = new ArrayCollection();
foreach ($assertions->getIterator() as $assertion) {
$decrypted->add($this->decryptAssertion($assertion));
}
return $decrypted;
} | php | public function decryptAssertions(ArrayCollection $assertions)
{
$decrypted = new ArrayCollection();
foreach ($assertions->getIterator() as $assertion) {
$decrypted->add($this->decryptAssertion($assertion));
}
return $decrypted;
} | [
"public",
"function",
"decryptAssertions",
"(",
"ArrayCollection",
"$",
"assertions",
")",
"{",
"$",
"decrypted",
"=",
"new",
"ArrayCollection",
"(",
")",
";",
"foreach",
"(",
"$",
"assertions",
"->",
"getIterator",
"(",
")",
"as",
"$",
"assertion",
")",
"{"... | Decrypt assertions, or do nothing if assertions are already decrypted.
@param \SAML2\Utilities\ArrayCollection $assertions
@return \SAML2\Utilities\ArrayCollection Collection of processed assertions | [
"Decrypt",
"assertions",
"or",
"do",
"nothing",
"if",
"assertions",
"are",
"already",
"decrypted",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Assertion/Processor.php#L93-L101 |
simplesamlphp/saml2 | src/SAML2/Assertion/Processor.php | Processor.processAssertions | public function processAssertions(ArrayCollection $assertions) : ArrayCollection
{
$processed = new ArrayCollection();
foreach ($assertions->getIterator() as $assertion) {
$processed->add($this->process($assertion));
}
return $processed;
} | php | public function processAssertions(ArrayCollection $assertions) : ArrayCollection
{
$processed = new ArrayCollection();
foreach ($assertions->getIterator() as $assertion) {
$processed->add($this->process($assertion));
}
return $processed;
} | [
"public",
"function",
"processAssertions",
"(",
"ArrayCollection",
"$",
"assertions",
")",
":",
"ArrayCollection",
"{",
"$",
"processed",
"=",
"new",
"ArrayCollection",
"(",
")",
";",
"foreach",
"(",
"$",
"assertions",
"->",
"getIterator",
"(",
")",
"as",
"$",... | @param \SAML2\Utilities\ArrayCollection $assertions Collection of decrypted assertions
@return \SAML2\Utilities\ArrayCollection Collection of processed assertions | [
"@param",
"\\",
"SAML2",
"\\",
"Utilities",
"\\",
"ArrayCollection",
"$assertions",
"Collection",
"of",
"decrypted",
"assertions"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Assertion/Processor.php#L108-L116 |
simplesamlphp/saml2 | src/SAML2/XML/mdui/DiscoHints.php | DiscoHints.toXML | public function toXML(DOMElement $parent) : ?DOMElement
{
if (!empty($this->IPHint)
|| !empty($this->DomainHint)
|| !empty($this->GeolocationHint)
|| !empty($this->children)
) {
$doc = $parent->ownerDocument;
$e = $doc->createElementNS(Common::NS, ... | php | public function toXML(DOMElement $parent) : ?DOMElement
{
if (!empty($this->IPHint)
|| !empty($this->DomainHint)
|| !empty($this->GeolocationHint)
|| !empty($this->children)
) {
$doc = $parent->ownerDocument;
$e = $doc->createElementNS(Common::NS, ... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"?",
"DOMElement",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"IPHint",
")",
"||",
"!",
"empty",
"(",
"$",
"this",
"->",
"DomainHint",
")",
"||",
"!",
"empty",
"(... | Convert this DiscoHints to XML.
@param \DOMElement $parent The element we should append to.
@return \DOMElement|null | [
"Convert",
"this",
"DiscoHints",
"to",
"XML",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/mdui/DiscoHints.php#L183-L207 |
simplesamlphp/saml2 | src/SAML2/Message.php | Message.validateSignature | private function validateSignature(DOMElement $xml) : void
{
try {
/** @var \DOMAttr[] $signatureMethod */
$signatureMethod = Utils::xpQuery($xml, './ds:Signature/ds:SignedInfo/ds:SignatureMethod/@Algorithm');
if (empty($signatureMethod)) {
throw new \Exce... | php | private function validateSignature(DOMElement $xml) : void
{
try {
/** @var \DOMAttr[] $signatureMethod */
$signatureMethod = Utils::xpQuery($xml, './ds:Signature/ds:SignedInfo/ds:SignatureMethod/@Algorithm');
if (empty($signatureMethod)) {
throw new \Exce... | [
"private",
"function",
"validateSignature",
"(",
"DOMElement",
"$",
"xml",
")",
":",
"void",
"{",
"try",
"{",
"/** @var \\DOMAttr[] $signatureMethod */",
"$",
"signatureMethod",
"=",
"Utils",
"::",
"xpQuery",
"(",
"$",
"xml",
",",
"'./ds:Signature/ds:SignedInfo/ds:Sig... | Validate the signature element of a SAML message, and configure this object appropriately to perform the
signature verification afterwards.
Please note this method does NOT verify the signature, it just validates the signature construction and prepares
this object to do the verification.
@param \DOMElement $xml The S... | [
"Validate",
"the",
"signature",
"element",
"of",
"a",
"SAML",
"message",
"and",
"configure",
"this",
"object",
"appropriately",
"to",
"perform",
"the",
"signature",
"verification",
"afterwards",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Message.php#L194-L217 |
simplesamlphp/saml2 | src/SAML2/Message.php | Message.validate | public function validate(XMLSecurityKey $key) : bool
{
if (count($this->validators) === 0) {
return false;
}
$exceptions = [];
foreach ($this->validators as $validator) {
$function = $validator['Function'];
$data = $validator['Data'];
... | php | public function validate(XMLSecurityKey $key) : bool
{
if (count($this->validators) === 0) {
return false;
}
$exceptions = [];
foreach ($this->validators as $validator) {
$function = $validator['Function'];
$data = $validator['Data'];
... | [
"public",
"function",
"validate",
"(",
"XMLSecurityKey",
"$",
"key",
")",
":",
"bool",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"validators",
")",
"===",
"0",
")",
"{",
"return",
"false",
";",
"}",
"$",
"exceptions",
"=",
"[",
"]",
";",
"fo... | Validate this message against a public key.
true is returned on success, false is returned if we don't have any
signature we can validate. An exception is thrown if the signature
validation fails.
@param XMLSecurityKey $key The key we should check against
@throws \Exception
@return bool true on success, false when we... | [
"Validate",
"this",
"message",
"against",
"a",
"public",
"key",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Message.php#L250-L274 |
simplesamlphp/saml2 | src/SAML2/Message.php | Message.toUnsignedXML | public function toUnsignedXML() : DOMElement
{
$this->document = DOMDocumentFactory::create();
$root = $this->document->createElementNS(Constants::NS_SAMLP, 'samlp:'.$this->tagName);
$this->document->appendChild($root);
/* Ugly hack to add another namespace declaration to the root ... | php | public function toUnsignedXML() : DOMElement
{
$this->document = DOMDocumentFactory::create();
$root = $this->document->createElementNS(Constants::NS_SAMLP, 'samlp:'.$this->tagName);
$this->document->appendChild($root);
/* Ugly hack to add another namespace declaration to the root ... | [
"public",
"function",
"toUnsignedXML",
"(",
")",
":",
"DOMElement",
"{",
"$",
"this",
"->",
"document",
"=",
"DOMDocumentFactory",
"::",
"create",
"(",
")",
";",
"$",
"root",
"=",
"$",
"this",
"->",
"document",
"->",
"createElementNS",
"(",
"Constants",
":... | Convert this message to an unsigned XML document.
This method does not sign the resulting XML document.
@return \DOMElement The root element of the DOM tree | [
"Convert",
"this",
"message",
"to",
"an",
"unsigned",
"XML",
"document",
".",
"This",
"method",
"does",
"not",
"sign",
"the",
"resulting",
"XML",
"document",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Message.php#L436-L465 |
simplesamlphp/saml2 | src/SAML2/Message.php | Message.toSignedXML | public function toSignedXML() : DOMElement
{
$root = $this->toUnsignedXML();
if ($this->signatureKey === null) {
/* We don't have a key to sign it with. */
return $root;
}
/* Find the position we should insert the signature node at. */
if ($this->is... | php | public function toSignedXML() : DOMElement
{
$root = $this->toUnsignedXML();
if ($this->signatureKey === null) {
/* We don't have a key to sign it with. */
return $root;
}
/* Find the position we should insert the signature node at. */
if ($this->is... | [
"public",
"function",
"toSignedXML",
"(",
")",
":",
"DOMElement",
"{",
"$",
"root",
"=",
"$",
"this",
"->",
"toUnsignedXML",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"signatureKey",
"===",
"null",
")",
"{",
"/* We don't have a key to sign it with. */",
"... | Convert this message to a signed XML document.
This method sign the resulting XML document if the private key for
the signature is set.
@return \DOMElement The root element of the DOM tree | [
"Convert",
"this",
"message",
"to",
"a",
"signed",
"XML",
"document",
".",
"This",
"method",
"sign",
"the",
"resulting",
"XML",
"document",
"if",
"the",
"private",
"key",
"for",
"the",
"signature",
"is",
"set",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Message.php#L475-L501 |
simplesamlphp/saml2 | src/SAML2/Message.php | Message.fromXML | public static function fromXML(\DOMElement $xml) : Message
{
if ($xml->namespaceURI !== Constants::NS_SAMLP) {
throw new \Exception('Unknown namespace of SAML message: '.var_export($xml->namespaceURI, true));
}
switch ($xml->localName) {
case 'AttributeQuery':
... | php | public static function fromXML(\DOMElement $xml) : Message
{
if ($xml->namespaceURI !== Constants::NS_SAMLP) {
throw new \Exception('Unknown namespace of SAML message: '.var_export($xml->namespaceURI, true));
}
switch ($xml->localName) {
case 'AttributeQuery':
... | [
"public",
"static",
"function",
"fromXML",
"(",
"\\",
"DOMElement",
"$",
"xml",
")",
":",
"Message",
"{",
"if",
"(",
"$",
"xml",
"->",
"namespaceURI",
"!==",
"Constants",
"::",
"NS_SAMLP",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Unknown namespa... | Convert an XML element into a message.
@param \DOMElement $xml The root XML element
@throws \Exception
@return \SAML2\Message The message | [
"Convert",
"an",
"XML",
"element",
"into",
"a",
"message",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Message.php#L559-L583 |
simplesamlphp/saml2 | src/SAML2/XML/Chunk.php | Chunk.unserialize | public function unserialize($serialized) : void
{
$doc = DOMDocumentFactory::fromString(unserialize($serialized));
$this->xml = $doc->documentElement;
$this->setLocalName($this->xml->localName);
$this->setNamespaceURI($this->xml->namespaceURI);
} | php | public function unserialize($serialized) : void
{
$doc = DOMDocumentFactory::fromString(unserialize($serialized));
$this->xml = $doc->documentElement;
$this->setLocalName($this->xml->localName);
$this->setNamespaceURI($this->xml->namespaceURI);
} | [
"public",
"function",
"unserialize",
"(",
"$",
"serialized",
")",
":",
"void",
"{",
"$",
"doc",
"=",
"DOMDocumentFactory",
"::",
"fromString",
"(",
"unserialize",
"(",
"$",
"serialized",
")",
")",
";",
"$",
"this",
"->",
"xml",
"=",
"$",
"doc",
"->",
"... | Un-serialize this XML chunk.
@param string $serialized The serialized chunk.
@return void
Type hint not possible due to upstream method signature | [
"Un",
"-",
"serialize",
"this",
"XML",
"chunk",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/Chunk.php#L143-L149 |
simplesamlphp/saml2 | src/SAML2/HTTPArtifact.php | HTTPArtifact.getRedirectURL | public function getRedirectURL(Message $message) : string
{
/** @psalm-suppress UndefinedClass */
$store = Store::getInstance();
if ($store === false) {
throw new \Exception('Unable to send artifact without a datastore configured.');
}
$generatedId = pack('H*', b... | php | public function getRedirectURL(Message $message) : string
{
/** @psalm-suppress UndefinedClass */
$store = Store::getInstance();
if ($store === false) {
throw new \Exception('Unable to send artifact without a datastore configured.');
}
$generatedId = pack('H*', b... | [
"public",
"function",
"getRedirectURL",
"(",
"Message",
"$",
"message",
")",
":",
"string",
"{",
"/** @psalm-suppress UndefinedClass */",
"$",
"store",
"=",
"Store",
"::",
"getInstance",
"(",
")",
";",
"if",
"(",
"$",
"store",
"===",
"false",
")",
"{",
"thro... | Create the redirect URL for a message.
@param \SAML2\Message $message The message.
@throws \Exception
@return string The URL the user should be redirected to in order to send a message. | [
"Create",
"the",
"redirect",
"URL",
"for",
"a",
"message",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/HTTPArtifact.php#L38-L71 |
simplesamlphp/saml2 | src/SAML2/HTTPArtifact.php | HTTPArtifact.send | public function send(Message $message) : void
{
$destination = $this->getRedirectURL($message);
Utils::getContainer()->redirect($destination);
} | php | public function send(Message $message) : void
{
$destination = $this->getRedirectURL($message);
Utils::getContainer()->redirect($destination);
} | [
"public",
"function",
"send",
"(",
"Message",
"$",
"message",
")",
":",
"void",
"{",
"$",
"destination",
"=",
"$",
"this",
"->",
"getRedirectURL",
"(",
"$",
"message",
")",
";",
"Utils",
"::",
"getContainer",
"(",
")",
"->",
"redirect",
"(",
"$",
"dest... | Send a SAML 2 message using the HTTP-Redirect binding.
Note: This function never returns.
@param \SAML2\Message $message The message we should send.
@return void | [
"Send",
"a",
"SAML",
"2",
"message",
"using",
"the",
"HTTP",
"-",
"Redirect",
"binding",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/HTTPArtifact.php#L82-L86 |
simplesamlphp/saml2 | src/SAML2/HTTPArtifact.php | HTTPArtifact.receive | public function receive() : ?Message
{
if (array_key_exists('SAMLart', $_REQUEST)) {
$artifact = base64_decode($_REQUEST['SAMLart']);
$endpointIndex = bin2hex(substr($artifact, 2, 2));
$sourceId = bin2hex(substr($artifact, 4, 20));
} else {
throw new \... | php | public function receive() : ?Message
{
if (array_key_exists('SAMLart', $_REQUEST)) {
$artifact = base64_decode($_REQUEST['SAMLart']);
$endpointIndex = bin2hex(substr($artifact, 2, 2));
$sourceId = bin2hex(substr($artifact, 4, 20));
} else {
throw new \... | [
"public",
"function",
"receive",
"(",
")",
":",
"?",
"Message",
"{",
"if",
"(",
"array_key_exists",
"(",
"'SAMLart'",
",",
"$",
"_REQUEST",
")",
")",
"{",
"$",
"artifact",
"=",
"base64_decode",
"(",
"$",
"_REQUEST",
"[",
"'SAMLart'",
"]",
")",
";",
"$"... | Receive a SAML 2 message sent using the HTTP-Artifact binding.
Throws an exception if it is unable receive the message.
@throws \Exception
@return \SAML2\Message|null The received message. | [
"Receive",
"a",
"SAML",
"2",
"message",
"sent",
"using",
"the",
"HTTP",
"-",
"Artifact",
"binding",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/HTTPArtifact.php#L97-L169 |
simplesamlphp/saml2 | src/SAML2/Compat/Ssp/Container.php | Container.writeFile | public function writeFile(string $filename, string $data, int $mode = null) : void
{
if ($mode === null) {
$mode = 0600;
}
/** @psalm-suppress UndefinedClass */
System::writeFile($filename, $data, $mode);
} | php | public function writeFile(string $filename, string $data, int $mode = null) : void
{
if ($mode === null) {
$mode = 0600;
}
/** @psalm-suppress UndefinedClass */
System::writeFile($filename, $data, $mode);
} | [
"public",
"function",
"writeFile",
"(",
"string",
"$",
"filename",
",",
"string",
"$",
"data",
",",
"int",
"$",
"mode",
"=",
"null",
")",
":",
"void",
"{",
"if",
"(",
"$",
"mode",
"===",
"null",
")",
"{",
"$",
"mode",
"=",
"0600",
";",
"}",
"/** ... | {@inheritdoc}
@param string $filename
@param string $date
@param int|null $mode
@return void | [
"{"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Compat/Ssp/Container.php#L110-L117 |
simplesamlphp/saml2 | src/SAML2/HTTPPost.php | HTTPPost.send | public function send(Message $message) : void
{
if ($this->destination === null) {
$destination = $message->getDestination();
if ($destination === null) {
throw new \Exception('Cannot send message, no destination set.');
}
} else {
$des... | php | public function send(Message $message) : void
{
if ($this->destination === null) {
$destination = $message->getDestination();
if ($destination === null) {
throw new \Exception('Cannot send message, no destination set.');
}
} else {
$des... | [
"public",
"function",
"send",
"(",
"Message",
"$",
"message",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"destination",
"===",
"null",
")",
"{",
"$",
"destination",
"=",
"$",
"message",
"->",
"getDestination",
"(",
")",
";",
"if",
"(",
"$",... | Send a SAML 2 message using the HTTP-POST binding.
Note: This function never returns.
@param \SAML2\Message $message The message we should send.
@return void | [
"Send",
"a",
"SAML",
"2",
"message",
"using",
"the",
"HTTP",
"-",
"POST",
"binding",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/HTTPPost.php#L22-L55 |
simplesamlphp/saml2 | src/SAML2/HTTPPost.php | HTTPPost.receive | public function receive() : ?Message
{
if (array_key_exists('SAMLRequest', $_POST)) {
$msgStr = $_POST['SAMLRequest'];
} elseif (array_key_exists('SAMLResponse', $_POST)) {
$msgStr = $_POST['SAMLResponse'];
} else {
throw new \Exception('Missing SAMLReques... | php | public function receive() : ?Message
{
if (array_key_exists('SAMLRequest', $_POST)) {
$msgStr = $_POST['SAMLRequest'];
} elseif (array_key_exists('SAMLResponse', $_POST)) {
$msgStr = $_POST['SAMLResponse'];
} else {
throw new \Exception('Missing SAMLReques... | [
"public",
"function",
"receive",
"(",
")",
":",
"?",
"Message",
"{",
"if",
"(",
"array_key_exists",
"(",
"'SAMLRequest'",
",",
"$",
"_POST",
")",
")",
"{",
"$",
"msgStr",
"=",
"$",
"_POST",
"[",
"'SAMLRequest'",
"]",
";",
"}",
"elseif",
"(",
"array_key... | Receive a SAML 2 message sent using the HTTP-POST binding.
Throws an exception if it is unable receive the message.
@return \SAML2\Message|null The received message.
@throws \Exception | [
"Receive",
"a",
"SAML",
"2",
"message",
"sent",
"using",
"the",
"HTTP",
"-",
"POST",
"binding",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/HTTPPost.php#L66-L95 |
simplesamlphp/saml2 | src/SAML2/StatusResponse.php | StatusResponse.isSuccess | public function isSuccess() : bool
{
Assert::keyExists($this->status, "Code");
return $this->status['Code'] === Constants::STATUS_SUCCESS;
} | php | public function isSuccess() : bool
{
Assert::keyExists($this->status, "Code");
return $this->status['Code'] === Constants::STATUS_SUCCESS;
} | [
"public",
"function",
"isSuccess",
"(",
")",
":",
"bool",
"{",
"Assert",
"::",
"keyExists",
"(",
"$",
"this",
"->",
"status",
",",
"\"Code\"",
")",
";",
"return",
"$",
"this",
"->",
"status",
"[",
"'Code'",
"]",
"===",
"Constants",
"::",
"STATUS_SUCCESS"... | Determine whether this is a successful response.
@return bool true if the status code is success, false if not. | [
"Determine",
"whether",
"this",
"is",
"a",
"successful",
"response",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/StatusResponse.php#L105-L110 |
simplesamlphp/saml2 | src/SAML2/StatusResponse.php | StatusResponse.setStatus | public function setStatus(array $status) : void
{
Assert::keyExists($status, "Code", 'Cannot set status without a Code key in the array.');
$this->status = $status;
if (!array_key_exists('SubCode', $status)) {
$this->status['SubCode'] = null;
}
if (!array_key_exi... | php | public function setStatus(array $status) : void
{
Assert::keyExists($status, "Code", 'Cannot set status without a Code key in the array.');
$this->status = $status;
if (!array_key_exists('SubCode', $status)) {
$this->status['SubCode'] = null;
}
if (!array_key_exi... | [
"public",
"function",
"setStatus",
"(",
"array",
"$",
"status",
")",
":",
"void",
"{",
"Assert",
"::",
"keyExists",
"(",
"$",
"status",
",",
"\"Code\"",
",",
"'Cannot set status without a Code key in the array.'",
")",
";",
"$",
"this",
"->",
"status",
"=",
"$... | Set the status code.
@param array $status The status code.
@return void | [
"Set",
"the",
"status",
"code",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/StatusResponse.php#L153-L164 |
simplesamlphp/saml2 | src/SAML2/StatusResponse.php | StatusResponse.toUnsignedXML | public function toUnsignedXML() : DOMElement
{
$root = parent::toUnsignedXML();
if ($this->inResponseTo !== null) {
$root->setAttribute('InResponseTo', $this->inResponseTo);
}
$status = $this->document->createElementNS(Constants::NS_SAMLP, 'Status');
$root->appe... | php | public function toUnsignedXML() : DOMElement
{
$root = parent::toUnsignedXML();
if ($this->inResponseTo !== null) {
$root->setAttribute('InResponseTo', $this->inResponseTo);
}
$status = $this->document->createElementNS(Constants::NS_SAMLP, 'Status');
$root->appe... | [
"public",
"function",
"toUnsignedXML",
"(",
")",
":",
"DOMElement",
"{",
"$",
"root",
"=",
"parent",
"::",
"toUnsignedXML",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"inResponseTo",
"!==",
"null",
")",
"{",
"$",
"root",
"->",
"setAttribute",
"(",
"'... | Convert status response message to an XML element.
@return \DOMElement This status response. | [
"Convert",
"status",
"response",
"message",
"to",
"an",
"XML",
"element",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/StatusResponse.php#L172-L198 |
simplesamlphp/saml2 | src/SAML2/XML/saml/Attribute.php | Attribute.toXMLInternal | protected function toXMLInternal(DOMElement $parent, string $namespace, string $name) : DOMElement
{
$e = $parent->ownerDocument->createElementNS($namespace, $name);
$parent->appendChild($e);
if (empty($this->Name)) {
throw new \Exception('Cannot convert Attribute to XML with no... | php | protected function toXMLInternal(DOMElement $parent, string $namespace, string $name) : DOMElement
{
$e = $parent->ownerDocument->createElementNS($namespace, $name);
$parent->appendChild($e);
if (empty($this->Name)) {
throw new \Exception('Cannot convert Attribute to XML with no... | [
"protected",
"function",
"toXMLInternal",
"(",
"DOMElement",
"$",
"parent",
",",
"string",
"$",
"namespace",
",",
"string",
"$",
"name",
")",
":",
"DOMElement",
"{",
"$",
"e",
"=",
"$",
"parent",
"->",
"ownerDocument",
"->",
"createElementNS",
"(",
"$",
"n... | Internal implementation of toXML.
This function allows RequestedAttribute to specify the element name and namespace.
@param \DOMElement $parent The element we should append this Attribute to.
@param string $namespace The namespace the element should be created in.
@param string $name The name of the element.
@return \... | [
"Internal",
"implementation",
"of",
"toXML",
".",
"This",
"function",
"allows",
"RequestedAttribute",
"to",
"specify",
"the",
"element",
"name",
"and",
"namespace",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/saml/Attribute.php#L194-L217 |
simplesamlphp/saml2 | src/SAML2/Certificate/PrivateKeyLoader.php | PrivateKeyLoader.loadPrivateKey | public function loadPrivateKey(PrivateKeyConfiguration $key) : PrivateKey
{
if ($key->isFile()) {
$privateKey = File::getFileContents($key->getFilePath());
} else {
$privateKey = $key->getContents();
}
return PrivateKey::create($privateKey, $key->getPassPhras... | php | public function loadPrivateKey(PrivateKeyConfiguration $key) : PrivateKey
{
if ($key->isFile()) {
$privateKey = File::getFileContents($key->getFilePath());
} else {
$privateKey = $key->getContents();
}
return PrivateKey::create($privateKey, $key->getPassPhras... | [
"public",
"function",
"loadPrivateKey",
"(",
"PrivateKeyConfiguration",
"$",
"key",
")",
":",
"PrivateKey",
"{",
"if",
"(",
"$",
"key",
"->",
"isFile",
"(",
")",
")",
"{",
"$",
"privateKey",
"=",
"File",
"::",
"getFileContents",
"(",
"$",
"key",
"->",
"g... | Loads a private key based on the configuration given.
@param \SAML2\Configuration\PrivateKey $key
@return \SAML2\Certificate\PrivateKey | [
"Loads",
"a",
"private",
"key",
"based",
"on",
"the",
"configuration",
"given",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Certificate/PrivateKeyLoader.php#L23-L32 |
simplesamlphp/saml2 | src/SAML2/XML/md/AdditionalMetadataLocation.php | AdditionalMetadataLocation.toXML | public function toXML(DOMElement $parent) : DOMElement
{
$e = Utils::addString($parent, Constants::NS_MD, 'md:AdditionalMetadataLocation', $this->getLocation());
$e->setAttribute('namespace', $this->getNamespace());
return $e;
} | php | public function toXML(DOMElement $parent) : DOMElement
{
$e = Utils::addString($parent, Constants::NS_MD, 'md:AdditionalMetadataLocation', $this->getLocation());
$e->setAttribute('namespace', $this->getNamespace());
return $e;
} | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"$",
"e",
"=",
"Utils",
"::",
"addString",
"(",
"$",
"parent",
",",
"Constants",
"::",
"NS_MD",
",",
"'md:AdditionalMetadataLocation'",
",",
"$",
"this",
"->",
"g... | Convert this AdditionalMetadataLocation to XML.
@param \DOMElement $parent The element we should append to.
@return \DOMElement This AdditionalMetadataLocation-element. | [
"Convert",
"this",
"AdditionalMetadataLocation",
"to",
"XML",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/AdditionalMetadataLocation.php#L107-L113 |
simplesamlphp/saml2 | src/SAML2/XML/saml/SubjectConfirmationData.php | SubjectConfirmationData.setAddress | public function setAddress(string $address = null) : void
{
if (!is_null($address) && !filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6)) {
Utils::getContainer()->getLogger()->warning(sprintf('Provided argument (%s) is not a valid IP address.', $address));
}
... | php | public function setAddress(string $address = null) : void
{
if (!is_null($address) && !filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6)) {
Utils::getContainer()->getLogger()->warning(sprintf('Provided argument (%s) is not a valid IP address.', $address));
}
... | [
"public",
"function",
"setAddress",
"(",
"string",
"$",
"address",
"=",
"null",
")",
":",
"void",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"address",
")",
"&&",
"!",
"filter_var",
"(",
"$",
"address",
",",
"FILTER_VALIDATE_IP",
",",
"FILTER_FLAG_IPV4",
... | Set the value of the Address-property
@param string|null $address
@return void | [
"Set",
"the",
"value",
"of",
"the",
"Address",
"-",
"property"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/saml/SubjectConfirmationData.php#L178-L184 |
simplesamlphp/saml2 | src/SAML2/XML/saml/SubjectConfirmationData.php | SubjectConfirmationData.addInfo | public function addInfo($info) : void
{
Assert::isInstanceOfAny($info, [Chunk::class, KeyInfo::class]);
$this->info[] = $info;
} | php | public function addInfo($info) : void
{
Assert::isInstanceOfAny($info, [Chunk::class, KeyInfo::class]);
$this->info[] = $info;
} | [
"public",
"function",
"addInfo",
"(",
"$",
"info",
")",
":",
"void",
"{",
"Assert",
"::",
"isInstanceOfAny",
"(",
"$",
"info",
",",
"[",
"Chunk",
"::",
"class",
",",
"KeyInfo",
"::",
"class",
"]",
")",
";",
"$",
"this",
"->",
"info",
"[",
"]",
"=",... | Add the value to the info-property
@param \SAML2\XML\Chunk|\SAML2\XML\ds\KeyInfo $info
@return void | [
"Add",
"the",
"value",
"to",
"the",
"info",
"-",
"property"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/saml/SubjectConfirmationData.php#L216-L220 |
simplesamlphp/saml2 | src/SAML2/XML/saml/SubjectConfirmationData.php | SubjectConfirmationData.toXML | public function toXML(DOMElement $parent) : DOMElement
{
$e = $parent->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:SubjectConfirmationData');
$parent->appendChild($e);
if ($this->NotBefore !== null) {
$e->setAttribute('NotBefore', gmdate('Y-m-d\TH:i:s\Z', $this->Not... | php | public function toXML(DOMElement $parent) : DOMElement
{
$e = $parent->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:SubjectConfirmationData');
$parent->appendChild($e);
if ($this->NotBefore !== null) {
$e->setAttribute('NotBefore', gmdate('Y-m-d\TH:i:s\Z', $this->Not... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"$",
"e",
"=",
"$",
"parent",
"->",
"ownerDocument",
"->",
"createElementNS",
"(",
"Constants",
"::",
"NS_SAML",
",",
"'saml:SubjectConfirmationData'",
")",
";",
"$",... | Convert this element to XML.
@param \DOMElement $parent The parent element we should append this element to.
@return \DOMElement This element, as XML. | [
"Convert",
"this",
"element",
"to",
"XML",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/saml/SubjectConfirmationData.php#L275-L301 |
simplesamlphp/saml2 | src/SAML2/XML/mdattr/EntityAttributes.php | EntityAttributes.addChildren | public function addChildren($child) : void
{
Assert::isInstanceOfAny($child, [Chunk::class, Attribute::class]);
$this->children[] = $child;
} | php | public function addChildren($child) : void
{
Assert::isInstanceOfAny($child, [Chunk::class, Attribute::class]);
$this->children[] = $child;
} | [
"public",
"function",
"addChildren",
"(",
"$",
"child",
")",
":",
"void",
"{",
"Assert",
"::",
"isInstanceOfAny",
"(",
"$",
"child",
",",
"[",
"Chunk",
"::",
"class",
",",
"Attribute",
"::",
"class",
"]",
")",
";",
"$",
"this",
"->",
"children",
"[",
... | Add the value to the children-property
@param \SAML2\XML\Chunk|\SAML2\XML\saml\Attribute $child
@return void | [
"Add",
"the",
"value",
"to",
"the",
"children",
"-",
"property"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/mdattr/EntityAttributes.php#L88-L92 |
simplesamlphp/saml2 | src/SAML2/XML/mdattr/EntityAttributes.php | EntityAttributes.toXML | public function toXML(DOMElement $parent) : DOMElement
{
$doc = $parent->ownerDocument;
$e = $doc->createElementNS(EntityAttributes::NS, 'mdattr:EntityAttributes');
$parent->appendChild($e);
/** @var \SAML2\XML\saml\Attribute|\SAML2\XML\Chunk $child */
foreach ($this->child... | php | public function toXML(DOMElement $parent) : DOMElement
{
$doc = $parent->ownerDocument;
$e = $doc->createElementNS(EntityAttributes::NS, 'mdattr:EntityAttributes');
$parent->appendChild($e);
/** @var \SAML2\XML\saml\Attribute|\SAML2\XML\Chunk $child */
foreach ($this->child... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"$",
"doc",
"=",
"$",
"parent",
"->",
"ownerDocument",
";",
"$",
"e",
"=",
"$",
"doc",
"->",
"createElementNS",
"(",
"EntityAttributes",
"::",
"NS",
",",
"'mdat... | Convert this EntityAttributes to XML.
@param \DOMElement $parent The element we should append to.
@return \DOMElement | [
"Convert",
"this",
"EntityAttributes",
"to",
"XML",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/mdattr/EntityAttributes.php#L101-L114 |
simplesamlphp/saml2 | src/SAML2/Certificate/Key.php | Key.canBeUsedFor | public function canBeUsedFor(string $usage) : bool
{
if (!in_array($usage, static::getValidKeyUsages(), true)) {
throw new InvalidKeyUsageException($usage);
}
return isset($this->keyData[$usage]) && $this->keyData[$usage];
} | php | public function canBeUsedFor(string $usage) : bool
{
if (!in_array($usage, static::getValidKeyUsages(), true)) {
throw new InvalidKeyUsageException($usage);
}
return isset($this->keyData[$usage]) && $this->keyData[$usage];
} | [
"public",
"function",
"canBeUsedFor",
"(",
"string",
"$",
"usage",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"usage",
",",
"static",
"::",
"getValidKeyUsages",
"(",
")",
",",
"true",
")",
")",
"{",
"throw",
"new",
"InvalidKeyUsageExcep... | Whether or not the key is configured to be used for usage given
@param string $usage
@return bool | [
"Whether",
"or",
"not",
"the",
"key",
"is",
"configured",
"to",
"be",
"used",
"for",
"usage",
"given"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Certificate/Key.php#L44-L51 |
simplesamlphp/saml2 | src/SAML2/Certificate/Key.php | Key.offsetExists | public function offsetExists($offset) : bool
{
if (!is_string($offset)) {
throw InvalidArgumentException::invalidType('string', $offset);
}
return array_key_exists($offset, $this->keyData);
} | php | public function offsetExists($offset) : bool
{
if (!is_string($offset)) {
throw InvalidArgumentException::invalidType('string', $offset);
}
return array_key_exists($offset, $this->keyData);
} | [
"public",
"function",
"offsetExists",
"(",
"$",
"offset",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"offset",
")",
")",
"{",
"throw",
"InvalidArgumentException",
"::",
"invalidType",
"(",
"'string'",
",",
"$",
"offset",
")",
";",
"}",... | @param mixed $offset
@throws InvalidArgumentException
@return bool
Type hint not possible due to upstream method signature | [
"@param",
"mixed",
"$offset",
"@throws",
"InvalidArgumentException",
"@return",
"bool"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Certificate/Key.php#L74-L80 |
simplesamlphp/saml2 | src/SAML2/Certificate/Key.php | Key.offsetGet | public function offsetGet($offset)
{
if (!is_string($offset)) {
throw InvalidArgumentException::invalidType('string', $offset);
}
return $this->keyData[$offset];
} | php | public function offsetGet($offset)
{
if (!is_string($offset)) {
throw InvalidArgumentException::invalidType('string', $offset);
}
return $this->keyData[$offset];
} | [
"public",
"function",
"offsetGet",
"(",
"$",
"offset",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"offset",
")",
")",
"{",
"throw",
"InvalidArgumentException",
"::",
"invalidType",
"(",
"'string'",
",",
"$",
"offset",
")",
";",
"}",
"return",
"$",
... | @param mixed $offset
@throws InvalidArgumentException
@return mixed
Type hint not possible due to upstream method signature | [
"@param",
"mixed",
"$offset",
"@throws",
"InvalidArgumentException",
"@return",
"mixed"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Certificate/Key.php#L90-L96 |
simplesamlphp/saml2 | src/SAML2/Certificate/Key.php | Key.offsetUnset | public function offsetUnset($offset) : void
{
if (!is_string($offset)) {
throw InvalidArgumentException::invalidType('string', $offset);
}
unset($this->keyData[$offset]);
} | php | public function offsetUnset($offset) : void
{
if (!is_string($offset)) {
throw InvalidArgumentException::invalidType('string', $offset);
}
unset($this->keyData[$offset]);
} | [
"public",
"function",
"offsetUnset",
"(",
"$",
"offset",
")",
":",
"void",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"offset",
")",
")",
"{",
"throw",
"InvalidArgumentException",
"::",
"invalidType",
"(",
"'string'",
",",
"$",
"offset",
")",
";",
"}",
... | @param mixed $offset
@throws InvalidArgumentException
@return void
Type hint not possible due to upstream method signature | [
"@param",
"mixed",
"$offset",
"@throws",
"InvalidArgumentException",
"@return",
"void"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Certificate/Key.php#L121-L127 |
simplesamlphp/saml2 | src/SAML2/Certificate/KeyCollection.php | KeyCollection.add | public function add($key) : void
{
Assert::isInstanceOf($key, Key::class);
parent::add($key);
} | php | public function add($key) : void
{
Assert::isInstanceOf($key, Key::class);
parent::add($key);
} | [
"public",
"function",
"add",
"(",
"$",
"key",
")",
":",
"void",
"{",
"Assert",
"::",
"isInstanceOf",
"(",
"$",
"key",
",",
"Key",
"::",
"class",
")",
";",
"parent",
"::",
"add",
"(",
"$",
"key",
")",
";",
"}"
] | Add a key to the collection
@psalm-suppress MoreSpecificImplementedParamType
@param \SAML2\Certificate\Key $key
@return void
Type hint not possible due to upstream method signature | [
"Add",
"a",
"key",
"to",
"the",
"collection"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Certificate/KeyCollection.php#L25-L29 |
simplesamlphp/saml2 | src/SAML2/Signature/AbstractChainedValidator.php | AbstractChainedValidator.validateElementWithKeys | protected function validateElementWithKeys(
SignedElement $element,
\SAML2\Utilities\ArrayCollection $pemCandidates
) : bool {
$lastException = null;
foreach ($pemCandidates as $index => $candidateKey) {
$key = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, ['type' => 'pu... | php | protected function validateElementWithKeys(
SignedElement $element,
\SAML2\Utilities\ArrayCollection $pemCandidates
) : bool {
$lastException = null;
foreach ($pemCandidates as $index => $candidateKey) {
$key = new XMLSecurityKey(XMLSecurityKey::RSA_SHA256, ['type' => 'pu... | [
"protected",
"function",
"validateElementWithKeys",
"(",
"SignedElement",
"$",
"element",
",",
"\\",
"SAML2",
"\\",
"Utilities",
"\\",
"ArrayCollection",
"$",
"pemCandidates",
")",
":",
"bool",
"{",
"$",
"lastException",
"=",
"null",
";",
"foreach",
"(",
"$",
... | BC compatible version of the signature check
@param \SAML2\SignedElement $element
@param \SAML2\Utilities\ArrayCollection $pemCandidates
@throws \Exception
@return bool | [
"BC",
"compatible",
"version",
"of",
"the",
"signature",
"check"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Signature/AbstractChainedValidator.php#L41-L76 |
simplesamlphp/saml2 | src/SAML2/Signature/ValidatorChain.php | ValidatorChain.hasValidSignature | public function hasValidSignature(
SignedElement $signedElement,
CertificateProvider $configuration
) : bool {
foreach ($this->validators as $validator) {
if ($validator->canValidate($signedElement, $configuration)) {
$this->logger->debug(sprintf(
... | php | public function hasValidSignature(
SignedElement $signedElement,
CertificateProvider $configuration
) : bool {
foreach ($this->validators as $validator) {
if ($validator->canValidate($signedElement, $configuration)) {
$this->logger->debug(sprintf(
... | [
"public",
"function",
"hasValidSignature",
"(",
"SignedElement",
"$",
"signedElement",
",",
"CertificateProvider",
"$",
"configuration",
")",
":",
"bool",
"{",
"foreach",
"(",
"$",
"this",
"->",
"validators",
"as",
"$",
"validator",
")",
"{",
"if",
"(",
"$",
... | @param \SAML2\SignedElement $signedElement
@param \SAML2\Configuration\CertificateProvider $configuration
@return bool | [
"@param",
"\\",
"SAML2",
"\\",
"SignedElement",
"$signedElement",
"@param",
"\\",
"SAML2",
"\\",
"Configuration",
"\\",
"CertificateProvider",
"$configuration"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Signature/ValidatorChain.php#L62-L86 |
simplesamlphp/saml2 | src/SAML2/Certificate/X509.php | X509.offsetSet | public function offsetSet($offset, $value) : void
{
if ($offset === 'X509Certificate') {
$value = preg_replace('~\s+~', '', $value);
}
parent::offsetSet($offset, $value);
} | php | public function offsetSet($offset, $value) : void
{
if ($offset === 'X509Certificate') {
$value = preg_replace('~\s+~', '', $value);
}
parent::offsetSet($offset, $value);
} | [
"public",
"function",
"offsetSet",
"(",
"$",
"offset",
",",
"$",
"value",
")",
":",
"void",
"{",
"if",
"(",
"$",
"offset",
"===",
"'X509Certificate'",
")",
"{",
"$",
"value",
"=",
"preg_replace",
"(",
"'~\\s+~'",
",",
"''",
",",
"$",
"value",
")",
";... | {@inheritdoc} Best place to ensure the logic is encapsulated in a single place
@param mixed $offset
@param mixed $value
@return void
Type hint not possible due to upstream method signature | [
"{",
"@inheritdoc",
"}",
"Best",
"place",
"to",
"ensure",
"the",
"logic",
"is",
"encapsulated",
"in",
"a",
"single",
"place"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Certificate/X509.php#L34-L41 |
simplesamlphp/saml2 | src/SAML2/Response/Processor.php | Processor.process | public function process(
ServiceProvider $serviceProviderConfiguration,
IdentityProvider $identityProviderConfiguration,
Destination $currentDestination,
Response $response
) : ArrayCollection {
$this->preconditionValidator = new PreconditionValidator($currentDestination);
... | php | public function process(
ServiceProvider $serviceProviderConfiguration,
IdentityProvider $identityProviderConfiguration,
Destination $currentDestination,
Response $response
) : ArrayCollection {
$this->preconditionValidator = new PreconditionValidator($currentDestination);
... | [
"public",
"function",
"process",
"(",
"ServiceProvider",
"$",
"serviceProviderConfiguration",
",",
"IdentityProvider",
"$",
"identityProviderConfiguration",
",",
"Destination",
"$",
"currentDestination",
",",
"Response",
"$",
"response",
")",
":",
"ArrayCollection",
"{",
... | @param \SAML2\Configuration\ServiceProvider $serviceProviderConfiguration
@param \SAML2\Configuration\IdentityProvider $identityProviderConfiguration
@param \SAML2\Configuration\Destination $currentDestination
@param \SAML2\Response $response
@return \SAML2\Utilities\ArrayCollection Collection of \SAML2\Assertion obj... | [
"@param",
"\\",
"SAML2",
"\\",
"Configuration",
"\\",
"ServiceProvider",
"$serviceProviderConfiguration",
"@param",
"\\",
"SAML2",
"\\",
"Configuration",
"\\",
"IdentityProvider",
"$identityProviderConfiguration",
"@param",
"\\",
"SAML2",
"\\",
"Configuration",
"\\",
"Des... | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Response/Processor.php#L72-L91 |
simplesamlphp/saml2 | src/SAML2/Response/Processor.php | Processor.enforcePreconditions | private function enforcePreconditions(Response $response) : void
{
$result = $this->preconditionValidator->validate($response);
if (!$result->isValid()) {
throw PreconditionNotMetException::createFromValidationResult($result);
}
} | php | private function enforcePreconditions(Response $response) : void
{
$result = $this->preconditionValidator->validate($response);
if (!$result->isValid()) {
throw PreconditionNotMetException::createFromValidationResult($result);
}
} | [
"private",
"function",
"enforcePreconditions",
"(",
"Response",
"$",
"response",
")",
":",
"void",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"preconditionValidator",
"->",
"validate",
"(",
"$",
"response",
")",
";",
"if",
"(",
"!",
"$",
"result",
"->",
... | Checks the preconditions that must be valid in order for the response to be processed.
@param \SAML2\Response $response
@throws PreconditionNotMetException
@return void | [
"Checks",
"the",
"preconditions",
"that",
"must",
"be",
"valid",
"in",
"order",
"for",
"the",
"response",
"to",
"be",
"processed",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Response/Processor.php#L101-L108 |
simplesamlphp/saml2 | src/SAML2/SubjectQuery.php | SubjectQuery.parseSubject | private function parseSubject(\DOMElement $xml) : void
{
/** @var \DOMElement[] $subject */
$subject = Utils::xpQuery($xml, './saml_assertion:Subject');
if (empty($subject)) {
throw new \Exception('Missing subject in subject query.');
} elseif (count($subject) > 1) {
... | php | private function parseSubject(\DOMElement $xml) : void
{
/** @var \DOMElement[] $subject */
$subject = Utils::xpQuery($xml, './saml_assertion:Subject');
if (empty($subject)) {
throw new \Exception('Missing subject in subject query.');
} elseif (count($subject) > 1) {
... | [
"private",
"function",
"parseSubject",
"(",
"\\",
"DOMElement",
"$",
"xml",
")",
":",
"void",
"{",
"/** @var \\DOMElement[] $subject */",
"$",
"subject",
"=",
"Utils",
"::",
"xpQuery",
"(",
"$",
"xml",
",",
"'./saml_assertion:Subject'",
")",
";",
"if",
"(",
"e... | Parse subject in query.
@param \DOMElement $xml The SubjectQuery XML element.
@throws \Exception
@return void | [
"Parse",
"subject",
"in",
"query",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/SubjectQuery.php#L57-L75 |
simplesamlphp/saml2 | src/SAML2/SubjectQuery.php | SubjectQuery.toUnsignedXML | public function toUnsignedXML() : DOMElement
{
if ($this->nameId === null) {
throw new \Exception('Cannot convert SubjectQuery to XML without a NameID set.');
}
$root = parent::toUnsignedXML();
$subject = $root->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:Su... | php | public function toUnsignedXML() : DOMElement
{
if ($this->nameId === null) {
throw new \Exception('Cannot convert SubjectQuery to XML without a NameID set.');
}
$root = parent::toUnsignedXML();
$subject = $root->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:Su... | [
"public",
"function",
"toUnsignedXML",
"(",
")",
":",
"DOMElement",
"{",
"if",
"(",
"$",
"this",
"->",
"nameId",
"===",
"null",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Cannot convert SubjectQuery to XML without a NameID set.'",
")",
";",
"}",
"$",
... | Convert subject query message to an XML element.
@return \DOMElement This subject query. | [
"Convert",
"subject",
"query",
"message",
"to",
"an",
"XML",
"element",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/SubjectQuery.php#L106-L119 |
simplesamlphp/saml2 | src/SAML2/XML/md/SPSSODescriptor.php | SPSSODescriptor.toXML | public function toXML(DOMElement $parent) : DOMElement
{
$e = parent::toXML($parent);
if (is_bool($this->AuthnRequestsSigned)) {
$e->setAttribute('AuthnRequestsSigned', $this->AuthnRequestsSigned ? 'true' : 'false');
}
if (is_bool($this->WantAssertionsSigned)) {
... | php | public function toXML(DOMElement $parent) : DOMElement
{
$e = parent::toXML($parent);
if (is_bool($this->AuthnRequestsSigned)) {
$e->setAttribute('AuthnRequestsSigned', $this->AuthnRequestsSigned ? 'true' : 'false');
}
if (is_bool($this->WantAssertionsSigned)) {
... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"$",
"e",
"=",
"parent",
"::",
"toXML",
"(",
"$",
"parent",
")",
";",
"if",
"(",
"is_bool",
"(",
"$",
"this",
"->",
"AuthnRequestsSigned",
")",
")",
"{",
"$... | Add this SPSSODescriptor to an EntityDescriptor.
@param \DOMElement $parent The EntityDescriptor we should append this SPSSODescriptor to.
@return \DOMElement | [
"Add",
"this",
"SPSSODescriptor",
"to",
"an",
"EntityDescriptor",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/SPSSODescriptor.php#L201-L222 |
simplesamlphp/saml2 | src/SAML2/AttributeQuery.php | AttributeQuery.toUnsignedXML | public function toUnsignedXML() : DOMElement
{
$root = parent::toUnsignedXML();
foreach ($this->attributes as $name => $values) {
$attribute = $root->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:Attribute');
$root->appendChild($attribute);
$attribute-... | php | public function toUnsignedXML() : DOMElement
{
$root = parent::toUnsignedXML();
foreach ($this->attributes as $name => $values) {
$attribute = $root->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:Attribute');
$root->appendChild($attribute);
$attribute-... | [
"public",
"function",
"toUnsignedXML",
"(",
")",
":",
"DOMElement",
"{",
"$",
"root",
"=",
"parent",
"::",
"toUnsignedXML",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"attributes",
"as",
"$",
"name",
"=>",
"$",
"values",
")",
"{",
"$",
"attribut... | Convert the attribute query message to an XML element.
@return \DOMElement This attribute query. | [
"Convert",
"the",
"attribute",
"query",
"message",
"to",
"an",
"XML",
"element",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/AttributeQuery.php#L151-L186 |
simplesamlphp/saml2 | src/SAML2/Assertion/Transformer/TransformerChain.php | TransformerChain.transform | public function transform(Assertion $assertion) : Assertion
{
foreach ($this->transformers as $transformer) {
$assertion = $transformer->transform($assertion);
}
return $assertion;
} | php | public function transform(Assertion $assertion) : Assertion
{
foreach ($this->transformers as $transformer) {
$assertion = $transformer->transform($assertion);
}
return $assertion;
} | [
"public",
"function",
"transform",
"(",
"Assertion",
"$",
"assertion",
")",
":",
"Assertion",
"{",
"foreach",
"(",
"$",
"this",
"->",
"transformers",
"as",
"$",
"transformer",
")",
"{",
"$",
"assertion",
"=",
"$",
"transformer",
"->",
"transform",
"(",
"$"... | @param \SAML2\Assertion $assertion
@return \SAML2\Assertion | [
"@param",
"\\",
"SAML2",
"\\",
"Assertion",
"$assertion"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Assertion/Transformer/TransformerChain.php#L69-L76 |
simplesamlphp/saml2 | src/SAML2/LogoutRequest.php | LogoutRequest.setSessionIndex | public function setSessionIndex(string $sessionIndex = null) : void
{
if (is_null($sessionIndex)) {
$this->sessionIndexes = [];
} else {
$this->sessionIndexes = [$sessionIndex];
}
} | php | public function setSessionIndex(string $sessionIndex = null) : void
{
if (is_null($sessionIndex)) {
$this->sessionIndexes = [];
} else {
$this->sessionIndexes = [$sessionIndex];
}
} | [
"public",
"function",
"setSessionIndex",
"(",
"string",
"$",
"sessionIndex",
"=",
"null",
")",
":",
"void",
"{",
"if",
"(",
"is_null",
"(",
"$",
"sessionIndex",
")",
")",
"{",
"$",
"this",
"->",
"sessionIndexes",
"=",
"[",
"]",
";",
"}",
"else",
"{",
... | Set the sesion index of the session that should be terminated.
@param string|null $sessionIndex The sesion index of the session that should be terminated.
@return void | [
"Set",
"the",
"sesion",
"index",
"of",
"the",
"session",
"that",
"should",
"be",
"terminated",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/LogoutRequest.php#L263-L270 |
simplesamlphp/saml2 | src/SAML2/LogoutRequest.php | LogoutRequest.toUnsignedXML | public function toUnsignedXML() : DOMElement
{
if ($this->encryptedNameId === null && $this->nameId === null) {
throw new \Exception('Cannot convert LogoutRequest to XML without a NameID set.');
}
$root = parent::toUnsignedXML();
if ($this->notOnOrAfter !== null) {
... | php | public function toUnsignedXML() : DOMElement
{
if ($this->encryptedNameId === null && $this->nameId === null) {
throw new \Exception('Cannot convert LogoutRequest to XML without a NameID set.');
}
$root = parent::toUnsignedXML();
if ($this->notOnOrAfter !== null) {
... | [
"public",
"function",
"toUnsignedXML",
"(",
")",
":",
"DOMElement",
"{",
"if",
"(",
"$",
"this",
"->",
"encryptedNameId",
"===",
"null",
"&&",
"$",
"this",
"->",
"nameId",
"===",
"null",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Cannot convert Lo... | Convert this logout request message to an XML element.
@return \DOMElement This logout request. | [
"Convert",
"this",
"logout",
"request",
"message",
"to",
"an",
"XML",
"element",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/LogoutRequest.php#L278-L303 |
simplesamlphp/saml2 | src/SAML2/HTTPRedirect.php | HTTPRedirect.getRedirectURL | public function getRedirectURL(Message $message) : string
{
if ($this->destination === null) {
$destination = $message->getDestination();
if ($destination === null) {
throw new \Exception('Cannot build a redirect URL, no destination set.');
}
} els... | php | public function getRedirectURL(Message $message) : string
{
if ($this->destination === null) {
$destination = $message->getDestination();
if ($destination === null) {
throw new \Exception('Cannot build a redirect URL, no destination set.');
}
} els... | [
"public",
"function",
"getRedirectURL",
"(",
"Message",
"$",
"message",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"destination",
"===",
"null",
")",
"{",
"$",
"destination",
"=",
"$",
"message",
"->",
"getDestination",
"(",
")",
";",
"if",
... | Create the redirect URL for a message.
@param \SAML2\Message $message The message.
@return string The URL the user should be redirected to in order to send a message. | [
"Create",
"the",
"redirect",
"URL",
"for",
"a",
"message",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/HTTPRedirect.php#L25-L76 |
simplesamlphp/saml2 | src/SAML2/HTTPRedirect.php | HTTPRedirect.send | public function send(Message $message) : void
{
$destination = $this->getRedirectURL($message);
Utils::getContainer()->getLogger()->debug('Redirect to '.strlen($destination).' byte URL: '.$destination);
Utils::getContainer()->redirect($destination);
} | php | public function send(Message $message) : void
{
$destination = $this->getRedirectURL($message);
Utils::getContainer()->getLogger()->debug('Redirect to '.strlen($destination).' byte URL: '.$destination);
Utils::getContainer()->redirect($destination);
} | [
"public",
"function",
"send",
"(",
"Message",
"$",
"message",
")",
":",
"void",
"{",
"$",
"destination",
"=",
"$",
"this",
"->",
"getRedirectURL",
"(",
"$",
"message",
")",
";",
"Utils",
"::",
"getContainer",
"(",
")",
"->",
"getLogger",
"(",
")",
"->"... | Send a SAML 2 message using the HTTP-Redirect binding.
Note: This function never returns.
@param \SAML2\Message $message The message we should send.
@return void | [
"Send",
"a",
"SAML",
"2",
"message",
"using",
"the",
"HTTP",
"-",
"Redirect",
"binding",
".",
"Note",
":",
"This",
"function",
"never",
"returns",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/HTTPRedirect.php#L86-L91 |
simplesamlphp/saml2 | src/SAML2/HTTPRedirect.php | HTTPRedirect.receive | public function receive() : ?Message
{
$data = self::parseQuery();
if (array_key_exists('SAMLRequest', $data)) {
$message = $data['SAMLRequest'];
} elseif (array_key_exists('SAMLResponse', $data)) {
$message = $data['SAMLResponse'];
} else {
throw ... | php | public function receive() : ?Message
{
$data = self::parseQuery();
if (array_key_exists('SAMLRequest', $data)) {
$message = $data['SAMLRequest'];
} elseif (array_key_exists('SAMLResponse', $data)) {
$message = $data['SAMLResponse'];
} else {
throw ... | [
"public",
"function",
"receive",
"(",
")",
":",
"?",
"Message",
"{",
"$",
"data",
"=",
"self",
"::",
"parseQuery",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"'SAMLRequest'",
",",
"$",
"data",
")",
")",
"{",
"$",
"message",
"=",
"$",
"data",
... | Receive a SAML 2 message sent using the HTTP-Redirect binding.
Throws an exception if it is unable receive the message.
@throws \Exception
@return \SAML2\Message|null The received message.
NPath is currently too high but solving that just moves code around. | [
"Receive",
"a",
"SAML",
"2",
"message",
"sent",
"using",
"the",
"HTTP",
"-",
"Redirect",
"binding",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/HTTPRedirect.php#L104-L157 |
simplesamlphp/saml2 | src/SAML2/HTTPRedirect.php | HTTPRedirect.parseQuery | private static function parseQuery() : array
{
/*
* Parse the query string. We need to do this ourself, so that we get access
* to the raw (urlencoded) values. This is required because different software
* can urlencode to different values.
*/
$data = [];
... | php | private static function parseQuery() : array
{
/*
* Parse the query string. We need to do this ourself, so that we get access
* to the raw (urlencoded) values. This is required because different software
* can urlencode to different values.
*/
$data = [];
... | [
"private",
"static",
"function",
"parseQuery",
"(",
")",
":",
"array",
"{",
"/*\n * Parse the query string. We need to do this ourself, so that we get access\n * to the raw (urlencoded) values. This is required because different software\n * can urlencode to different value... | Helper function to parse query data.
This function returns the query string split into key=>value pairs.
It also adds a new parameter, SignedQuery, which contains the data that is
signed.
@return array The query data that is signed. | [
"Helper",
"function",
"to",
"parse",
"query",
"data",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/HTTPRedirect.php#L169-L209 |
simplesamlphp/saml2 | src/SAML2/HTTPRedirect.php | HTTPRedirect.validateSignature | public static function validateSignature(array $data, XMLSecurityKey $key) : void
{
Assert::keyExists($data, "Query");
Assert::keyExists($data, "SigAlg");
Assert::keyExists($data, "Signature");
$query = $data['Query'];
$sigAlg = $data['SigAlg'];
$signature = $data['S... | php | public static function validateSignature(array $data, XMLSecurityKey $key) : void
{
Assert::keyExists($data, "Query");
Assert::keyExists($data, "SigAlg");
Assert::keyExists($data, "Signature");
$query = $data['Query'];
$sigAlg = $data['SigAlg'];
$signature = $data['S... | [
"public",
"static",
"function",
"validateSignature",
"(",
"array",
"$",
"data",
",",
"XMLSecurityKey",
"$",
"key",
")",
":",
"void",
"{",
"Assert",
"::",
"keyExists",
"(",
"$",
"data",
",",
"\"Query\"",
")",
";",
"Assert",
"::",
"keyExists",
"(",
"$",
"d... | Validate the signature on a HTTP-Redirect message.
Throws an exception if we are unable to validate the signature.
@param array $data The data we need to validate the query string.
@param XMLSecurityKey $key The key we should validate the query against.
@throws \Exception
@return void | [
"Validate",
"the",
"signature",
"on",
"a",
"HTTP",
"-",
"Redirect",
"message",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/HTTPRedirect.php#L222-L244 |
simplesamlphp/saml2 | src/SAML2/XML/mdrpi/RegistrationInfo.php | RegistrationInfo.toXML | public function toXML(DOMElement $parent) : DOMElement
{
if (empty($this->registrationAuthority)) {
throw new \Exception('Missing required registration authority.');
}
$doc = $parent->ownerDocument;
$e = $doc->createElementNS(Common::NS_MDRPI, 'mdrpi:RegistrationInfo');... | php | public function toXML(DOMElement $parent) : DOMElement
{
if (empty($this->registrationAuthority)) {
throw new \Exception('Missing required registration authority.');
}
$doc = $parent->ownerDocument;
$e = $doc->createElementNS(Common::NS_MDRPI, 'mdrpi:RegistrationInfo');... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"registrationAuthority",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Missing required registration authority.'"... | Convert this element to XML.
@param \DOMElement $parent The element we should append to.
@return \DOMElement | [
"Convert",
"this",
"element",
"to",
"XML",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/mdrpi/RegistrationInfo.php#L145-L165 |
simplesamlphp/saml2 | src/SAML2/XML/saml/SubjectConfirmation.php | SubjectConfirmation.toXML | public function toXML(DOMElement $parent) : DOMElement
{
Assert::notNull($this->Method, "Cannot convert SubjectConfirmation to XML without a Method set.");
$e = $parent->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:SubjectConfirmation');
$parent->appendChild($e);
/** @p... | php | public function toXML(DOMElement $parent) : DOMElement
{
Assert::notNull($this->Method, "Cannot convert SubjectConfirmation to XML without a Method set.");
$e = $parent->ownerDocument->createElementNS(Constants::NS_SAML, 'saml:SubjectConfirmation');
$parent->appendChild($e);
/** @p... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"Assert",
"::",
"notNull",
"(",
"$",
"this",
"->",
"Method",
",",
"\"Cannot convert SubjectConfirmation to XML without a Method set.\"",
")",
";",
"$",
"e",
"=",
"$",
"... | Convert this element to XML.
@param \DOMElement $parent The parent element we should append this element to.
@return \DOMElement This element, as XML. | [
"Convert",
"this",
"element",
"to",
"XML",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/saml/SubjectConfirmation.php#L152-L170 |
simplesamlphp/saml2 | src/SAML2/XML/md/SSODescriptorType.php | SSODescriptorType.toXML | protected function toXML(DOMElement $parent) : DOMElement
{
$e = parent::toXML($parent);
foreach ($this->ArtifactResolutionService as $ep) {
$ep->toXML($e, 'md:ArtifactResolutionService');
}
foreach ($this->SingleLogoutService as $ep) {
$ep->toXML($e, 'md:Si... | php | protected function toXML(DOMElement $parent) : DOMElement
{
$e = parent::toXML($parent);
foreach ($this->ArtifactResolutionService as $ep) {
$ep->toXML($e, 'md:ArtifactResolutionService');
}
foreach ($this->SingleLogoutService as $ep) {
$ep->toXML($e, 'md:Si... | [
"protected",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"$",
"e",
"=",
"parent",
"::",
"toXML",
"(",
"$",
"parent",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"ArtifactResolutionService",
"as",
"$",
"ep",
")",
... | Add this SSODescriptorType to an EntityDescriptor.
@param \DOMElement $parent The EntityDescriptor we should append this SSODescriptorType to.
@return \DOMElement The generated SSODescriptor DOMElement. | [
"Add",
"this",
"SSODescriptorType",
"to",
"an",
"EntityDescriptor",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/SSODescriptorType.php#L223-L242 |
simplesamlphp/saml2 | src/SAML2/XML/ds/X509Data.php | X509Data.addData | public function addData($data) : void
{
Assert::isInstanceOfAny($data, [Chunk::class, X509Certificate::class]);
$this->data[] = $data;
} | php | public function addData($data) : void
{
Assert::isInstanceOfAny($data, [Chunk::class, X509Certificate::class]);
$this->data[] = $data;
} | [
"public",
"function",
"addData",
"(",
"$",
"data",
")",
":",
"void",
"{",
"Assert",
"::",
"isInstanceOfAny",
"(",
"$",
"data",
",",
"[",
"Chunk",
"::",
"class",
",",
"X509Certificate",
"::",
"class",
"]",
")",
";",
"$",
"this",
"->",
"data",
"[",
"]"... | Add the value to the data-property
@param \SAML2\XML\Chunk|\SAML2\XML\ds\X509Certificate $data
@return void | [
"Add",
"the",
"value",
"to",
"the",
"data",
"-",
"property"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/ds/X509Data.php#L93-L97 |
simplesamlphp/saml2 | src/SAML2/XML/ds/X509Data.php | X509Data.toXML | public function toXML(DOMElement $parent) : DOMElement
{
$doc = $parent->ownerDocument;
$e = $doc->createElementNS(XMLSecurityDSig::XMLDSIGNS, 'ds:X509Data');
$parent->appendChild($e);
/** @var \SAML2\XML\Chunk|\SAML2\XML\ds\X509Certificate $n */
foreach ($this->getData() a... | php | public function toXML(DOMElement $parent) : DOMElement
{
$doc = $parent->ownerDocument;
$e = $doc->createElementNS(XMLSecurityDSig::XMLDSIGNS, 'ds:X509Data');
$parent->appendChild($e);
/** @var \SAML2\XML\Chunk|\SAML2\XML\ds\X509Certificate $n */
foreach ($this->getData() a... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"$",
"doc",
"=",
"$",
"parent",
"->",
"ownerDocument",
";",
"$",
"e",
"=",
"$",
"doc",
"->",
"createElementNS",
"(",
"XMLSecurityDSig",
"::",
"XMLDSIGNS",
",",
... | Convert this X509Data element to XML.
@param \DOMElement $parent The element we should append this X509Data element to.
@return \DOMElement | [
"Convert",
"this",
"X509Data",
"element",
"to",
"XML",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/ds/X509Data.php#L106-L119 |
simplesamlphp/saml2 | src/SAML2/XML/md/Extensions.php | Extensions.getList | public static function getList(DOMElement $parent) : array
{
$ret = [];
$supported = [
Scope::NS => [
'Scope' => Scope::class,
],
EntityAttributes::NS => [
'EntityAttributes' => EntityAttributes::class,
],
MD... | php | public static function getList(DOMElement $parent) : array
{
$ret = [];
$supported = [
Scope::NS => [
'Scope' => Scope::class,
],
EntityAttributes::NS => [
'EntityAttributes' => EntityAttributes::class,
],
MD... | [
"public",
"static",
"function",
"getList",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"array",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"$",
"supported",
"=",
"[",
"Scope",
"::",
"NS",
"=>",
"[",
"'Scope'",
"=>",
"Scope",
"::",
"class",
",",
"]",
",",... | Get a list of Extensions in the given element.
@param \DOMElement $parent The element that may contain the md:Extensions element.
@return (\SAML2\XML\shibmd\Scope|
\SAML2\XML\mdattr\EntityAttributes|
\SAML2\XML\mdrpi\RegistrationInfo|
\SAML2\XML\mdrpi\PublicationInfo|
\SAML2\XML\mdui\UIInfo|
\SAML2\XML\mdui\DiscoHints... | [
"Get",
"a",
"list",
"of",
"Extensions",
"in",
"the",
"given",
"element",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/Extensions.php#L44-L80 |
simplesamlphp/saml2 | src/SAML2/XML/ds/X509Certificate.php | X509Certificate.toXML | public function toXML(DOMElement $parent) : DOMElement
{
return Utils::addString($parent, XMLSecurityDSig::XMLDSIGNS, 'ds:X509Certificate', $this->getCertificate());
} | php | public function toXML(DOMElement $parent) : DOMElement
{
return Utils::addString($parent, XMLSecurityDSig::XMLDSIGNS, 'ds:X509Certificate', $this->getCertificate());
} | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"return",
"Utils",
"::",
"addString",
"(",
"$",
"parent",
",",
"XMLSecurityDSig",
"::",
"XMLDSIGNS",
",",
"'ds:X509Certificate'",
",",
"$",
"this",
"->",
"getCertific... | Convert this X509Certificate element to XML.
@param \DOMElement $parent The element we should append this X509Certificate element to.
@return \DOMElement | [
"Convert",
"this",
"X509Certificate",
"element",
"to",
"XML",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/ds/X509Certificate.php#L71-L74 |
simplesamlphp/saml2 | src/SAML2/Binding.php | Binding.getBinding | public static function getBinding(string $urn) : Binding
{
switch ($urn) {
case Constants::BINDING_HTTP_POST:
return new HTTPPost();
case Constants::BINDING_HTTP_REDIRECT:
return new HTTPRedirect();
case Constants::BINDING_HTTP_ARTIFACT:
... | php | public static function getBinding(string $urn) : Binding
{
switch ($urn) {
case Constants::BINDING_HTTP_POST:
return new HTTPPost();
case Constants::BINDING_HTTP_REDIRECT:
return new HTTPRedirect();
case Constants::BINDING_HTTP_ARTIFACT:
... | [
"public",
"static",
"function",
"getBinding",
"(",
"string",
"$",
"urn",
")",
":",
"Binding",
"{",
"switch",
"(",
"$",
"urn",
")",
"{",
"case",
"Constants",
"::",
"BINDING_HTTP_POST",
":",
"return",
"new",
"HTTPPost",
"(",
")",
";",
"case",
"Constants",
... | Retrieve a binding with the given URN.
Will throw an exception if it is unable to locate the binding.
@param string $urn The URN of the binding.
@throws \Exception
@return \SAML2\Binding The binding. | [
"Retrieve",
"a",
"binding",
"with",
"the",
"given",
"URN",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Binding.php#L32-L51 |
simplesamlphp/saml2 | src/SAML2/Binding.php | Binding.getCurrentBinding | public static function getCurrentBinding() : Binding
{
switch ($_SERVER['REQUEST_METHOD']) {
case 'GET':
if (array_key_exists('SAMLRequest', $_GET) || array_key_exists('SAMLResponse', $_GET)) {
return new HTTPRedirect();
} elseif (array_key_exi... | php | public static function getCurrentBinding() : Binding
{
switch ($_SERVER['REQUEST_METHOD']) {
case 'GET':
if (array_key_exists('SAMLRequest', $_GET) || array_key_exists('SAMLResponse', $_GET)) {
return new HTTPRedirect();
} elseif (array_key_exi... | [
"public",
"static",
"function",
"getCurrentBinding",
"(",
")",
":",
"Binding",
"{",
"switch",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_METHOD'",
"]",
")",
"{",
"case",
"'GET'",
":",
"if",
"(",
"array_key_exists",
"(",
"'SAMLRequest'",
",",
"$",
"_GET",
")",
"||... | Guess the current binding.
This function guesses the current binding and creates an instance
of \SAML2\Binding matching that binding.
An exception will be thrown if it is unable to guess the binding.
@throws \Exception
@return \SAML2\Binding The binding. | [
"Guess",
"the",
"current",
"binding",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Binding.php#L65-L108 |
simplesamlphp/saml2 | src/SAML2/XML/md/EndpointType.php | EndpointType.hasAttributeNS | public function hasAttributeNS(string $namespaceURI, string $localName) : bool
{
$fullName = '{'.$namespaceURI.'}'.$localName;
return isset($this->attributes[$fullName]);
} | php | public function hasAttributeNS(string $namespaceURI, string $localName) : bool
{
$fullName = '{'.$namespaceURI.'}'.$localName;
return isset($this->attributes[$fullName]);
} | [
"public",
"function",
"hasAttributeNS",
"(",
"string",
"$",
"namespaceURI",
",",
"string",
"$",
"localName",
")",
":",
"bool",
"{",
"$",
"fullName",
"=",
"'{'",
".",
"$",
"namespaceURI",
".",
"'}'",
".",
"$",
"localName",
";",
"return",
"isset",
"(",
"$"... | Check if a namespace-qualified attribute exists.
@param string $namespaceURI The namespace URI.
@param string $localName The local name.
@return bool true if the attribute exists, false if not. | [
"Check",
"if",
"a",
"namespace",
"-",
"qualified",
"attribute",
"exists",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/EndpointType.php#L94-L99 |
simplesamlphp/saml2 | src/SAML2/XML/md/EndpointType.php | EndpointType.getAttributeNS | public function getAttributeNS(string $namespaceURI, string $localName) : string
{
$fullName = '{'.$namespaceURI.'}'.$localName;
if (!isset($this->attributes[$fullName])) {
return '';
}
return $this->attributes[$fullName]['value'];
} | php | public function getAttributeNS(string $namespaceURI, string $localName) : string
{
$fullName = '{'.$namespaceURI.'}'.$localName;
if (!isset($this->attributes[$fullName])) {
return '';
}
return $this->attributes[$fullName]['value'];
} | [
"public",
"function",
"getAttributeNS",
"(",
"string",
"$",
"namespaceURI",
",",
"string",
"$",
"localName",
")",
":",
"string",
"{",
"$",
"fullName",
"=",
"'{'",
".",
"$",
"namespaceURI",
".",
"'}'",
".",
"$",
"localName",
";",
"if",
"(",
"!",
"isset",
... | Get a namespace-qualified attribute.
@param string $namespaceURI The namespace URI.
@param string $localName The local name.
@return string The value of the attribute, or an empty string if the attribute does not exist. | [
"Get",
"a",
"namespace",
"-",
"qualified",
"attribute",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/EndpointType.php#L109-L117 |
simplesamlphp/saml2 | src/SAML2/XML/md/EndpointType.php | EndpointType.setAttributeNS | public function setAttributeNS(string $namespaceURI, string $qualifiedName, string $value) : void
{
$name = explode(':', $qualifiedName, 2);
if (count($name) < 2) {
throw new \Exception('Not a qualified name.');
}
$localName = $name[1];
$fullName = '{'.$namespace... | php | public function setAttributeNS(string $namespaceURI, string $qualifiedName, string $value) : void
{
$name = explode(':', $qualifiedName, 2);
if (count($name) < 2) {
throw new \Exception('Not a qualified name.');
}
$localName = $name[1];
$fullName = '{'.$namespace... | [
"public",
"function",
"setAttributeNS",
"(",
"string",
"$",
"namespaceURI",
",",
"string",
"$",
"qualifiedName",
",",
"string",
"$",
"value",
")",
":",
"void",
"{",
"$",
"name",
"=",
"explode",
"(",
"':'",
",",
"$",
"qualifiedName",
",",
"2",
")",
";",
... | Get a namespace-qualified attribute.
@param string $namespaceURI The namespace URI.
@param string $qualifiedName The local name.
@param string $value The attribute value.
@throws \Exception
@return void | [
"Get",
"a",
"namespace",
"-",
"qualified",
"attribute",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/EndpointType.php#L129-L143 |
simplesamlphp/saml2 | src/SAML2/XML/md/EndpointType.php | EndpointType.removeAttributeNS | public function removeAttributeNS(string $namespaceURI, string $localName) : void
{
$fullName = '{'.$namespaceURI.'}'.$localName;
unset($this->attributes[$fullName]);
} | php | public function removeAttributeNS(string $namespaceURI, string $localName) : void
{
$fullName = '{'.$namespaceURI.'}'.$localName;
unset($this->attributes[$fullName]);
} | [
"public",
"function",
"removeAttributeNS",
"(",
"string",
"$",
"namespaceURI",
",",
"string",
"$",
"localName",
")",
":",
"void",
"{",
"$",
"fullName",
"=",
"'{'",
".",
"$",
"namespaceURI",
".",
"'}'",
".",
"$",
"localName",
";",
"unset",
"(",
"$",
"this... | Remove a namespace-qualified attribute.
@param string $namespaceURI The namespace URI.
@param string $localName The local name.
@return void | [
"Remove",
"a",
"namespace",
"-",
"qualified",
"attribute",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/EndpointType.php#L153-L157 |
simplesamlphp/saml2 | src/SAML2/XML/md/EndpointType.php | EndpointType.toXML | public function toXML(DOMElement $parent, string $name) : DOMElement
{
$e = $parent->ownerDocument->createElementNS(Constants::NS_MD, $name);
$parent->appendChild($e);
if (empty($this->Binding)) {
throw new \Exception('Cannot convert endpoint to XML without a Binding set.');
... | php | public function toXML(DOMElement $parent, string $name) : DOMElement
{
$e = $parent->ownerDocument->createElementNS(Constants::NS_MD, $name);
$parent->appendChild($e);
if (empty($this->Binding)) {
throw new \Exception('Cannot convert endpoint to XML without a Binding set.');
... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
",",
"string",
"$",
"name",
")",
":",
"DOMElement",
"{",
"$",
"e",
"=",
"$",
"parent",
"->",
"ownerDocument",
"->",
"createElementNS",
"(",
"Constants",
"::",
"NS_MD",
",",
"$",
"name",
")"... | Add this endpoint to an XML element.
@param \DOMElement $parent The element we should append this endpoint to.
@param string $name The name of the element we should create.
@return \DOMElement | [
"Add",
"this",
"endpoint",
"to",
"an",
"XML",
"element",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/EndpointType.php#L235-L259 |
simplesamlphp/saml2 | src/SAML2/XML/saml/Issuer.php | Issuer.toXML | public function toXML(DOMElement $parent = null) : DOMElement
{
if (($this->Saml2IssuerShowAll && ($this->Format === Constants::NAMEID_ENTITY))
|| ($this->Format !== Constants::NAMEID_ENTITY)
) {
return parent::toXML($parent);
}
/*
* if $this->Saml2I... | php | public function toXML(DOMElement $parent = null) : DOMElement
{
if (($this->Saml2IssuerShowAll && ($this->Format === Constants::NAMEID_ENTITY))
|| ($this->Format !== Constants::NAMEID_ENTITY)
) {
return parent::toXML($parent);
}
/*
* if $this->Saml2I... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
"=",
"null",
")",
":",
"DOMElement",
"{",
"if",
"(",
"(",
"$",
"this",
"->",
"Saml2IssuerShowAll",
"&&",
"(",
"$",
"this",
"->",
"Format",
"===",
"Constants",
"::",
"NAMEID_ENTITY",
")",
")... | Convert this Issuer to XML.
@param \DOMElement|null $parent The element we should append to.
@return \DOMElement The current Issuer object converted into a \DOMElement. | [
"Convert",
"this",
"Issuer",
"to",
"XML",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/saml/Issuer.php#L102-L134 |
simplesamlphp/saml2 | src/SAML2/ArtifactResolve.php | ArtifactResolve.toUnsignedXML | public function toUnsignedXML() : DOMElement
{
$root = parent::toUnsignedXML();
$artifactelement = $this->document->createElementNS(Constants::NS_SAMLP, 'Artifact', $this->artifact);
$root->appendChild($artifactelement);
return $root;
} | php | public function toUnsignedXML() : DOMElement
{
$root = parent::toUnsignedXML();
$artifactelement = $this->document->createElementNS(Constants::NS_SAMLP, 'Artifact', $this->artifact);
$root->appendChild($artifactelement);
return $root;
} | [
"public",
"function",
"toUnsignedXML",
"(",
")",
":",
"DOMElement",
"{",
"$",
"root",
"=",
"parent",
"::",
"toUnsignedXML",
"(",
")",
";",
"$",
"artifactelement",
"=",
"$",
"this",
"->",
"document",
"->",
"createElementNS",
"(",
"Constants",
"::",
"NS_SAMLP"... | Convert the response message to an XML element.
@return \DOMElement This response. | [
"Convert",
"the",
"response",
"message",
"to",
"an",
"XML",
"element",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/ArtifactResolve.php#L66-L73 |
simplesamlphp/saml2 | src/SAML2/XML/alg/DigestMethod.php | DigestMethod.toXML | public function toXML(DOMElement $parent) : DOMElement
{
Assert::stringNotEmpty($this->Algorithm, 'Cannot convert DigestMethod to XML without an Algorithm set.');
$doc = $parent->ownerDocument;
$e = $doc->createElementNS(Common::NS, 'alg:DigestMethod');
$parent->appendChild($e);
... | php | public function toXML(DOMElement $parent) : DOMElement
{
Assert::stringNotEmpty($this->Algorithm, 'Cannot convert DigestMethod to XML without an Algorithm set.');
$doc = $parent->ownerDocument;
$e = $doc->createElementNS(Common::NS, 'alg:DigestMethod');
$parent->appendChild($e);
... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"Assert",
"::",
"stringNotEmpty",
"(",
"$",
"this",
"->",
"Algorithm",
",",
"'Cannot convert DigestMethod to XML without an Algorithm set.'",
")",
";",
"$",
"doc",
"=",
"... | Convert this element to XML.
@param \DOMElement $parent The element we should append to.
@return \DOMElement
@throws \Exception | [
"Convert",
"this",
"element",
"to",
"XML",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/alg/DigestMethod.php#L77-L87 |
simplesamlphp/saml2 | src/SAML2/Response.php | Response.toUnsignedXML | public function toUnsignedXML() : DOMElement
{
$root = parent::toUnsignedXML();
/** @var \SAML2\Assertion|\SAML2\EncryptedAssertion $assertion */
foreach ($this->assertions as $assertion) {
$assertion->toXML($root);
}
return $root;
} | php | public function toUnsignedXML() : DOMElement
{
$root = parent::toUnsignedXML();
/** @var \SAML2\Assertion|\SAML2\EncryptedAssertion $assertion */
foreach ($this->assertions as $assertion) {
$assertion->toXML($root);
}
return $root;
} | [
"public",
"function",
"toUnsignedXML",
"(",
")",
":",
"DOMElement",
"{",
"$",
"root",
"=",
"parent",
"::",
"toUnsignedXML",
"(",
")",
";",
"/** @var \\SAML2\\Assertion|\\SAML2\\EncryptedAssertion $assertion */",
"foreach",
"(",
"$",
"this",
"->",
"assertions",
"as",
... | Convert the response message to an XML element.
@return \DOMElement This response. | [
"Convert",
"the",
"response",
"message",
"to",
"an",
"XML",
"element",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Response.php#L83-L93 |
simplesamlphp/saml2 | src/SAML2/XML/md/AttributeAuthorityDescriptor.php | AttributeAuthorityDescriptor.toXML | public function toXML(DOMElement $parent) : DOMElement
{
Assert::notEmpty($this->AttributeService);
$e = parent::toXML($parent);
foreach ($this->AttributeService as $ep) {
$ep->toXML($e, 'md:AttributeService');
}
foreach ($this->AssertionIDRequestService as $ep... | php | public function toXML(DOMElement $parent) : DOMElement
{
Assert::notEmpty($this->AttributeService);
$e = parent::toXML($parent);
foreach ($this->AttributeService as $ep) {
$ep->toXML($e, 'md:AttributeService');
}
foreach ($this->AssertionIDRequestService as $ep... | [
"public",
"function",
"toXML",
"(",
"DOMElement",
"$",
"parent",
")",
":",
"DOMElement",
"{",
"Assert",
"::",
"notEmpty",
"(",
"$",
"this",
"->",
"AttributeService",
")",
";",
"$",
"e",
"=",
"parent",
"::",
"toXML",
"(",
"$",
"parent",
")",
";",
"forea... | Add this AttributeAuthorityDescriptor to an EntityDescriptor.
@param \DOMElement $parent The EntityDescriptor we should append this IDPSSODescriptor to.
@return \DOMElement | [
"Add",
"this",
"AttributeAuthorityDescriptor",
"to",
"an",
"EntityDescriptor",
"."
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/XML/md/AttributeAuthorityDescriptor.php#L262-L285 |
simplesamlphp/saml2 | src/SAML2/Response/Validation/ConstraintValidator/IsSuccessful.php | IsSuccessful.buildMessage | private function buildMessage(array $responseStatus) : string
{
return sprintf(
'%s%s%s',
$this->truncateStatus($responseStatus['Code']),
$responseStatus['SubCode'] ? '/'.$this->truncateStatus($responseStatus['SubCode']) : '',
$responseStatus['Message'] ? ' '.... | php | private function buildMessage(array $responseStatus) : string
{
return sprintf(
'%s%s%s',
$this->truncateStatus($responseStatus['Code']),
$responseStatus['SubCode'] ? '/'.$this->truncateStatus($responseStatus['SubCode']) : '',
$responseStatus['Message'] ? ' '.... | [
"private",
"function",
"buildMessage",
"(",
"array",
"$",
"responseStatus",
")",
":",
"string",
"{",
"return",
"sprintf",
"(",
"'%s%s%s'",
",",
"$",
"this",
"->",
"truncateStatus",
"(",
"$",
"responseStatus",
"[",
"'Code'",
"]",
")",
",",
"$",
"responseStatu... | @param array $responseStatus
@return string | [
"@param",
"array",
"$responseStatus"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Response/Validation/ConstraintValidator/IsSuccessful.php#L34-L42 |
simplesamlphp/saml2 | src/SAML2/Response/Validation/ConstraintValidator/IsSuccessful.php | IsSuccessful.truncateStatus | private function truncateStatus(string $status) : string
{
$prefixLength = strlen(Constants::STATUS_PREFIX);
if (strpos($status, Constants::STATUS_PREFIX) !== 0) {
return $status;
}
return substr($status, $prefixLength);
} | php | private function truncateStatus(string $status) : string
{
$prefixLength = strlen(Constants::STATUS_PREFIX);
if (strpos($status, Constants::STATUS_PREFIX) !== 0) {
return $status;
}
return substr($status, $prefixLength);
} | [
"private",
"function",
"truncateStatus",
"(",
"string",
"$",
"status",
")",
":",
"string",
"{",
"$",
"prefixLength",
"=",
"strlen",
"(",
"Constants",
"::",
"STATUS_PREFIX",
")",
";",
"if",
"(",
"strpos",
"(",
"$",
"status",
",",
"Constants",
"::",
"STATUS_... | Truncate the status if it is prefixed by its urn.
@param string $status
@return string | [
"Truncate",
"the",
"status",
"if",
"it",
"is",
"prefixed",
"by",
"its",
"urn",
".",
"@param",
"string",
"$status"
] | train | https://github.com/simplesamlphp/saml2/blob/09e374fe0033f4706936c59033f86bd56411b1b1/src/SAML2/Response/Validation/ConstraintValidator/IsSuccessful.php#L51-L59 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.