public SecurityCheckResultDecorator(ISecurityCheck check, SecurityCheckResult result, string secureMessage, string unsecureMessage, bool secureWhenFailed) : base(check, result.Passed) { IsSecure = secureWhenFailed ? !result.Passed : result.Passed; this.secureMessage = secureMessage; this.unsecureMessage = unsecureMessage; this.result = result; }
public DeviceCheckSecurityDecorator(ISecurityCheck securityCheck, string secureMessage, string unsecureMessage, bool secureWhenFailed = false) { this.securityCheck = securityCheck; this.secureWhenFailed = secureWhenFailed; this.secureMessage = secureMessage; this.unsecureMessage = unsecureMessage; }
public MainRequestHandler(ISecurityCheck security) { _security = security; ExternalEndpoint = AnySetting("PrimaryCallbackAddress"); var settingValid = bool.TryParse(AnySetting("UpgradeHttp"), out var httpUpgradeSetting); UpgradeHttp = HttpsAvailable && httpUpgradeSetting && settingValid; var timer = new Stopwatch(); timer.Start(); _versionTable = new VersionTable <SiteHost>(); _baseFolder = AppDomain.CurrentDomain.BaseDirectory; if (Directory.Exists(AnySetting("HostedSitesRootDirectory"))) { // use directly specified folder _watchFolder = AnySetting("HostedSitesRootDirectory"); } else { // use general working folder (best for Azure?) _watchFolder = Path.Combine(_baseFolder, "uploads"); Directory.CreateDirectory(_watchFolder); } AvailableAppScanner = new PluginScanner(_watchFolder); AvailableAppScanner.PluginsChanged += AvailableAppWatcher_PluginsChanged; // Load initial versions out-of-band so we don't appear dead at start-up new Thread(() => { try { _firstScan = true; Trace.TraceInformation("Initial scan started"); AvailableAppScanner.RefreshPlugins(); Trace.TraceInformation("Initial scan complete"); } finally { _firstScan = false; timer.Stop(); _warmUp = timer.Elapsed; Console.WriteLine("Ready"); } }) { IsBackground = true }.Start(); }
public void AddCheck(ISecurityCheck check) { _Checks.Add(check); }
public SecurityCheckExecutionResult(ISecurityCheck securityCheck, SecurityCheckResult securityCheckInfo, Exception exception = null) { SecurityCheck = securityCheck ?? throw new ArgumentNullException(nameof(securityCheck)); SecurityCheckResult = securityCheckInfo ?? throw new ArgumentNullException(nameof(securityCheckInfo)); Exception = exception; }
public void Add(ISecurityCheck securityCheck, Exception exception) { Results.Add(new SecurityCheckExecutionResult(securityCheck, SecurityCheckResult.Empty, exception)); }
public void Add(ISecurityCheck securityCheck, SecurityCheckResult info) { Results.Add(new SecurityCheckExecutionResult(securityCheck, info)); }
public SecurityCheckResult(ISecurityCheck check, bool passed) { this.Id = check.GetId(); this.Name = check.GetName(); this.Passed = passed; }
public void AddCheck(ISecurityCheck check) { _Checks.Add(check); }