Skip to content

Commit

Permalink
Added textDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
btmattsson committed Feb 17, 2025
1 parent 629a6c0 commit b3d94dc
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 9 deletions.
5 changes: 5 additions & 0 deletions web/html/src/Validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,11 @@ public function getError() {
return $this->error . $this->errorNB;
}

/**
* Save Results
*
* @return void
*/
protected function saveResults() {
$resultHandler = $this->config->getDb()->prepare("UPDATE Entities
SET `validationOutput` = :validationOutput,
Expand Down
115 changes: 106 additions & 9 deletions web/html/src/ValidateSWAMID.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ public function saml(){
*
* Validate LangElements in
* - MDUI
* -
* - AttributeConsumingService
* - Organization
*
* SWAMID Tech
* - 5.1.1 -> 5.1.5
Expand Down Expand Up @@ -234,7 +235,20 @@ private function checkLangElements() {
}
}

// 5.1.9 -> 5.1.11 / 6.1.9 -> 6.1.11
/**
* Validate Entity Attributes
*
* Validate Entity Attributes
* - EntityCategory
* - EntityCategorySupport
* - Assurance Certification
*
* SWAMID Tech
* - 5.1.9 -> 5.1.11
* - 6.1.9 -> 6.1.11
*
* @return void
*/
private function checkEntityAttributes($type) {
$entityAttributesHandler = $this->config->getDb()->prepare('SELECT `attribute`
FROM EntityAttributes WHERE `entity_id` = :Id AND `type` = :Type');
Expand Down Expand Up @@ -278,7 +292,16 @@ private function checkEntityAttributes($type) {
}
}

# 5.1.13 errorURL
/**
* Validate Error URL of an IdP
*
* Validate than an Error URL exists in IDPSSODecriptor
*
* SWAMID Tech
* - 5.1.13 errorURL
*
* @return void
*/
private function checkErrorURL() {
$errorURLHandler = $this->config->getDb()->prepare("SELECT DISTINCT `URL`
FROM EntityURLs WHERE `entity_id` = :Id AND `type` = 'error';");
Expand All @@ -289,7 +312,18 @@ private function checkErrorURL() {
}
}

// 5.1.15, 5.1.16 Scope
/**
* Validate IdP Scope
*
* Validate IdP ScopeEntity Attributes
* - RegExp
* - Missing Scope
*
* SWAMID Tech
* - 5.1.15, 5.1.16
*
* @return void
*/
private function checkIDPScope() {
$scopesHandler = $this->config->getDb()->prepare('SELECT `scope`, `regexp` FROM Scopes WHERE `entity_id` = :Id');
$scopesHandler->bindParam(self::BIND_ID, $this->dbIdNr);
Expand All @@ -307,7 +341,21 @@ private function checkIDPScope() {
}
}

// 5.1.17
/**
* Validate Required MDUI-elements IdP
*
* Validate Required MDUI-elements for an IdP
* - DisplayName
* - Description
* - InformationURL
* - PrivacyStatementURL
* - Logo
*
* SWAMID Tech
* - 5.1.17
*
* @return void
*/
private function checkRequiredMDUIelementsIdP() {
$elementArray = array ('DisplayName' => false,
'Description' => false,
Expand Down Expand Up @@ -364,7 +412,20 @@ private function checkRequiredMDUIelementsIdP() {
}
}

// 6.1.12
/**
* Validate Required MDUI-elements SP
*
* Validate Required MDUI-elements for a SP
* - DisplayName
* - Description
* - InformationURL
* - PrivacyStatementURL
*
* SWAMID Tech
* - 6.1.12
*
* @return void
*/
private function checkRequiredMDUIelementsSP() {
$elementArray = array ('DisplayName' => false,
'Description' => false,
Expand Down Expand Up @@ -399,7 +460,20 @@ private function checkRequiredMDUIelementsSP() {
}
}

// 5.1.20, 5.2.x / 6.1.14, 6.2.x
/**
* Validate Certificates
*
* Validate Certificates
* - Length of certs
* - Validity of certs
* - Required cert exists
*
* SWAMID Tech
* - 5.1.20, 5.2.x
* - 6.1.14, 6.2.x
*
* @return void
*/
private function checkRequiredSAMLcertificates($type) {
$keyInfoArray = array ('IDPSSO' => false, 'SPSSO' => false, 'AttributeAuthority' => false);
$keyInfoHandler = $this->config->getDb()->prepare('SELECT `use`, `notValidAfter`, `subject`, `issuer`, `bits`, `key_type`
Expand Down Expand Up @@ -645,7 +719,20 @@ private function checkAssertionConsumerService($data) {
}
}*/

// 5.1.22 / 6.1.21
/**
* Validate Required Organization Elements
*
* Validate Required Organization Elements
* - OrganizationName
* - OrganizationDisplayName
* - OrganizationURL
*
* SWAMID Tech
* - 5.1.22
* - 6.1.21
*
* @return void
*/
private function checkRequiredOrganizationElements() {
$elementArray = array('OrganizationName' => false, 'OrganizationDisplayName' => false, 'OrganizationURL' => false);

Expand All @@ -664,7 +751,17 @@ private function checkRequiredOrganizationElements() {
}
}

// 5.1.23 -> 5.1.28 / 6.1.22 -> 6.1.26
/**
* Validate Required Contact Person Elements
*
* Validate Required Contact Person Elements
*
* SWAMID Tech
* - 5.1.23 -> 5.1.28
* - 6.1.22 -> 6.1.26
*
* @return void
*/
private function checkRequiredContactPersonElements() {
$usedContactTypes = array();
$contactPersonHandler = $this->config->getDb()->prepare('SELECT `contactType`, `subcontactType`, `emailAddress`, `givenName`
Expand Down

0 comments on commit b3d94dc

Please sign in to comment.