public void GivenIHaveAHttpPublicKeyPinningViolationWithDetails(Table table) { var hpkpModel = table.CreateInstance <HpkpModel>(); var hpkpReport = new HpkpReport { DateTime = hpkpModel.DateTime.ToString(CultureInfo.CurrentCulture), ExpirationDate = hpkpModel.ExpirationDate.ToString(CultureInfo.CurrentCulture), HostName = hpkpModel.HostName, IncludeSubDomains = hpkpModel.IncludeSubDomains.ToString(), KnownPins = hpkpModel.KnownPinsDelimited.Split(','), NotedHostName = hpkpModel.NotedHostName, Port = hpkpModel.Port, ServedCertificateChain = hpkpModel.ServedCertificateChainDelimited.Split(','), ValidatedCertificateChain = hpkpModel.ValidatedCertificateChainDelimited.Split(',') }; ScenarioContext.Current.SetHpkpReport(hpkpReport); }
public JsonResult HpkpReporting([ModelBinder(typeof(JsonModelBinder <HpkpReport>))] HpkpReport data) { Serilog.Log.Logger.Warning("Http Public Key Pinning Violation {@data}", data); return(Json(new { success = true })); }
public static void SetHpkpReport(this ScenarioContext scenarioContext, HpkpReport hpkpReport) { scenarioContext.Set(hpkpReport, HpkpReport); }