Skip to content

Commit bcf31cc

Browse files
committed
Alert of insecure urls
1 parent 5827c21 commit bcf31cc

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

yaml-generation/generateDimensions.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@
165165
$implementationReferences = readYaml($implementationReferenceFile)['implementations'];
166166
$references = array("implementations" => $implementationReferences);
167167
assertUniqueRefs($references, $errorMsg);
168+
assertSecureUrlsInRefs($references, $errorMsg);
168169
assertLiveUrlsInRefs($references, $errorMsg);
169170

170171
resolveYamlReferences($dimensionsAggregated, $references, $errorMsg);
@@ -216,6 +217,22 @@ function assertUniqueRefByKey($references, $keyToAssert, &$errorMsg) {
216217
}
217218

218219

220+
function assertSecureUrlsInRefs($all_references, &$errorMsg) {
221+
foreach ($all_references as $references) {
222+
foreach ($references as $id => $reference) {
223+
foreach ($reference as $key => $value) {
224+
if (is_string($value)) {
225+
// echo "KEY: $key VAL: " . var_dump($value) . "\n";
226+
if (str_contains($value,'http://')) {
227+
array_push($errorMsg, "Insecure url in '$key' of $id: " . $reference[$key]);
228+
}
229+
}
230+
}
231+
}
232+
}
233+
}
234+
235+
219236
function assertLiveUrlsInRefs($all_references, &$errorMsg) {
220237
if (TEST_REFERENCED_URLS) {
221238
echo "\nTesting referenced URLs:\n";

0 commit comments

Comments
 (0)