497 SecurityDefaults["weak_key_size_rsa_medium"] |
497 SecurityDefaults["weak_key_size_rsa_medium"] |
498 ), |
498 ), |
499 "WeakKeySizeEcHigh": str(SecurityDefaults["weak_key_size_ec_high"]), |
499 "WeakKeySizeEcHigh": str(SecurityDefaults["weak_key_size_ec_high"]), |
500 "WeakKeySizeEcMedium": str(SecurityDefaults["weak_key_size_ec_medium"]), |
500 "WeakKeySizeEcMedium": str(SecurityDefaults["weak_key_size_ec_medium"]), |
501 "CheckTypedException": SecurityDefaults["check_typed_exception"], |
501 "CheckTypedException": SecurityDefaults["check_typed_exception"], |
|
502 "ExtendMarkupNames": SecurityDefaults["extend_markup_names"], |
|
503 "AllowedEscapeFunctions": SecurityDefaults["allowed_calls"], |
502 }, |
504 }, |
503 # Imports |
505 # Imports |
504 "ImportsChecker": { |
506 "ImportsChecker": { |
505 "ApplicationPackageNames": [], |
507 "ApplicationPackageNames": [], |
506 "BannedModules": [], |
508 "BannedModules": [], |
732 self.__data["SecurityChecker"]["WeakKeySizeEcMedium"] |
734 self.__data["SecurityChecker"]["WeakKeySizeEcMedium"] |
733 ) |
735 ) |
734 self.typedExceptionsCheckBox.setChecked( |
736 self.typedExceptionsCheckBox.setChecked( |
735 self.__data["SecurityChecker"]["CheckTypedException"] |
737 self.__data["SecurityChecker"]["CheckTypedException"] |
736 ) |
738 ) |
|
739 self.additionalMarkupNamesEdit.setPlainText( |
|
740 "\n".join(self.__data["SecurityChecker"]["ExtendMarkupNames"]) |
|
741 ) |
|
742 self.allowedEscapeFunctionsEdit.setPlainText( |
|
743 "\n".join(self.__data["SecurityChecker"]["AllowedEscapeFunctions"]) |
|
744 ) |
737 |
745 |
738 # ImportsChecker |
746 # ImportsChecker |
739 self.appPackagesEdit.setPlainText( |
747 self.appPackagesEdit.setPlainText( |
740 " ".join(sorted(self.__data["ImportsChecker"]["ApplicationPackageNames"])) |
748 " ".join(sorted(self.__data["ImportsChecker"]["ApplicationPackageNames"])) |
741 ) |
749 ) |
976 "weak_key_size_rsa_high": int(self.rsaHighRiskCombo.currentText()), |
984 "weak_key_size_rsa_high": int(self.rsaHighRiskCombo.currentText()), |
977 "weak_key_size_rsa_medium": int(self.rsaMediumRiskCombo.currentText()), |
985 "weak_key_size_rsa_medium": int(self.rsaMediumRiskCombo.currentText()), |
978 "weak_key_size_ec_high": int(self.ecHighRiskCombo.currentText()), |
986 "weak_key_size_ec_high": int(self.ecHighRiskCombo.currentText()), |
979 "weak_key_size_ec_medium": int(self.ecMediumRiskCombo.currentText()), |
987 "weak_key_size_ec_medium": int(self.ecMediumRiskCombo.currentText()), |
980 "check_typed_exception": self.typedExceptionsCheckBox.isChecked(), |
988 "check_typed_exception": self.typedExceptionsCheckBox.isChecked(), |
|
989 "extend_markup_names": [ |
|
990 n.strip() |
|
991 for n in self.additionalMarkupNamesEdit.toPlainText().splitlines() |
|
992 ], |
|
993 "allowed_calls": [ |
|
994 f.strip() |
|
995 for f in self.allowedEscapeFunctionsEdit.toPlainText().splitlines() |
|
996 ] |
981 } |
997 } |
982 |
998 |
983 importsArgs = { |
999 importsArgs = { |
984 "ApplicationPackageNames": sorted( |
1000 "ApplicationPackageNames": sorted( |
985 self.appPackagesEdit.toPlainText().split() |
1001 self.appPackagesEdit.toPlainText().split() |
1459 "WeakKeySizeRsaHigh": self.rsaHighRiskCombo.currentText(), |
1475 "WeakKeySizeRsaHigh": self.rsaHighRiskCombo.currentText(), |
1460 "WeakKeySizeRsaMedium": self.rsaMediumRiskCombo.currentText(), |
1476 "WeakKeySizeRsaMedium": self.rsaMediumRiskCombo.currentText(), |
1461 "WeakKeySizeEcHigh": self.ecHighRiskCombo.currentText(), |
1477 "WeakKeySizeEcHigh": self.ecHighRiskCombo.currentText(), |
1462 "WeakKeySizeEcMedium": self.ecMediumRiskCombo.currentText(), |
1478 "WeakKeySizeEcMedium": self.ecMediumRiskCombo.currentText(), |
1463 "CheckTypedException": self.typedExceptionsCheckBox.isChecked(), |
1479 "CheckTypedException": self.typedExceptionsCheckBox.isChecked(), |
|
1480 "ExtendMarkupNames": [ |
|
1481 n.strip() |
|
1482 for n in self.additionalMarkupNamesEdit.toPlainText().splitlines() |
|
1483 ], |
|
1484 "AllowedEscapeFunctions": [ |
|
1485 f.strip() |
|
1486 for f in self.allowedEscapeFunctionsEdit.toPlainText().splitlines() |
|
1487 ], |
1464 }, |
1488 }, |
1465 "ImportsChecker": { |
1489 "ImportsChecker": { |
1466 "ApplicationPackageNames": sorted( |
1490 "ApplicationPackageNames": sorted( |
1467 self.appPackagesEdit.toPlainText().split() |
1491 self.appPackagesEdit.toPlainText().split() |
1468 ), |
1492 ), |
2036 "PEP8/CheckTypedException", |
2060 "PEP8/CheckTypedException", |
2037 defaultParameters["SecurityChecker"]["CheckTypedException"], |
2061 defaultParameters["SecurityChecker"]["CheckTypedException"], |
2038 ) |
2062 ) |
2039 ) |
2063 ) |
2040 ) |
2064 ) |
|
2065 self.additionalMarkupNamesEdit.setPlainText( |
|
2066 "\n".join( |
|
2067 EricUtilities.toList( |
|
2068 settings.value( |
|
2069 "PEP8/ExtendMarkupNames", |
|
2070 defaultParameters["SecurityChecker"]["ExtendMarkupNames"] |
|
2071 ) |
|
2072 ) |
|
2073 ) |
|
2074 ) |
|
2075 self.allowedEscapeFunctionsEdit.setPlainText( |
|
2076 "\n".join( |
|
2077 EricUtilities.toList( |
|
2078 settings.value( |
|
2079 "PEP8/AllowedEscapeFunctions", |
|
2080 defaultParameters["SecurityChecker"]["AllowedEscapeFunctions"] |
|
2081 ) |
|
2082 ) |
|
2083 ) |
|
2084 ) |
2041 |
2085 |
2042 # Imports Checker |
2086 # Imports Checker |
2043 self.appPackagesEdit.setPlainText( |
2087 self.appPackagesEdit.setPlainText( |
2044 " ".join( |
2088 " ".join( |
2045 sorted( |
2089 sorted( |
2337 "PEP8/WeakKeySizeEcMedium", self.ecMediumRiskCombo.currentText() |
2381 "PEP8/WeakKeySizeEcMedium", self.ecMediumRiskCombo.currentText() |
2338 ) |
2382 ) |
2339 settings.setValue( |
2383 settings.setValue( |
2340 "PEP8/CheckTypedException", self.typedExceptionsCheckBox.isChecked() |
2384 "PEP8/CheckTypedException", self.typedExceptionsCheckBox.isChecked() |
2341 ) |
2385 ) |
|
2386 settings.setValue( |
|
2387 "PEP8/ExtendMarkupNames", |
|
2388 [ |
|
2389 n.strip() |
|
2390 for n in self.additionalMarkupNamesEdit.toPlainText().splitlines() |
|
2391 ] |
|
2392 ) |
|
2393 settings.setValue( |
|
2394 "PEP8/AllowedEscapeFunctions", |
|
2395 [ |
|
2396 f.strip() |
|
2397 for f in self.allowedEscapeFunctionsEdit.toPlainText().splitlines() |
|
2398 ] |
|
2399 ) |
2342 |
2400 |
2343 # Imports Checker |
2401 # Imports Checker |
2344 settings.setValue( |
2402 settings.setValue( |
2345 "PEP8/ApplicationPackageNames", |
2403 "PEP8/ApplicationPackageNames", |
2346 sorted(self.appPackagesEdit.toPlainText().split()), |
2404 sorted(self.appPackagesEdit.toPlainText().split()), |
2560 defaultParameters["SecurityChecker"]["WeakKeySizeEcMedium"], |
2618 defaultParameters["SecurityChecker"]["WeakKeySizeEcMedium"], |
2561 ) |
2619 ) |
2562 settings.setValue( |
2620 settings.setValue( |
2563 "PEP8/CheckTypedException", |
2621 "PEP8/CheckTypedException", |
2564 defaultParameters["SecurityChecker"]["CheckTypedException"], |
2622 defaultParameters["SecurityChecker"]["CheckTypedException"], |
|
2623 ) |
|
2624 settings.setValue( |
|
2625 "PEP8/ExtendMarkupNames", |
|
2626 defaultParameters["SecurityChecker"]["ExtendMarkupNames"], |
|
2627 ) |
|
2628 settings.setValue( |
|
2629 "PEP8/AllowedEscapeFunctions", |
|
2630 defaultParameters["SecurityChecker"]["AllowedEscapeFunctions"] |
2565 ) |
2631 ) |
2566 |
2632 |
2567 # Imports Checker |
2633 # Imports Checker |
2568 settings.setValue( |
2634 settings.setValue( |
2569 "PEP8/ApplicationPackageNames", |
2635 "PEP8/ApplicationPackageNames", |