public CookieValue(string cookieName, ISystemTime time, ICookies cookies, IOutputWriter writer) { _time = time; _cookies = cookies; _writer = writer; _cookieName = cookieName; }
public SelfHostRequestData(RouteData routeData, HttpRequestMessage request, ICookies cookies) { AddValues(new RouteDataValues(routeData)); var querystring = request.RequestUri.ParseQueryString(); AddValues("Querystring", new NamedKeyValues(querystring)); var formData = request.Content.IsFormData() ? request.Content.ReadAsFormDataAsync().Result : new NameValueCollection(); AddValues(RequestDataSource.Request.ToString(), new NamedKeyValues(formData)); var headers = AggregateKeyValues.For(new HeaderKeyValues(request.Headers), new HeaderKeyValues(request.Content.Headers)); AddValues(RequestDataSource.Header.ToString(), headers); Func <string, IEnumerable <string>, bool> ignoreCaseKeyFinder = (key, keys) => keys.Contains(key, StringComparer.InvariantCultureIgnoreCase); var values = new SimpleKeyValues(key => cookies.Get(key).Value, () => cookies.Request.Select(x => x.Name), ignoreCaseKeyFinder); var valueSource = new FlatValueSource <object>(values, RequestDataSource.Cookie.ToString()); AddValues(valueSource); }
protected override void beforeEach() { MockFor <IAntiForgeryTokenProvider>().Stub(x => x.GetTokenName()).Return("FormName"); MockFor <IAntiForgeryTokenProvider>().Stub(x => x.GetTokenName("String")).IgnoreArguments().Return( "CookieName"); MockFor <IRequestData>().Stub(x => x.Value("ApplicationPath")).Return("Path"); _valueSource = MockFor <IValueSource>(); _headerSource = MockFor <IValueSource>(); MockFor <IRequestData>().Stub(x => x.ValuesFor(RequestDataSource.Request)).Return(_valueSource); MockFor <IRequestData>().Stub(x => x.ValuesFor(RequestDataSource.Header)).Return(_headerSource); _cookies = MockFor <ICookies>(); _formToken = new AntiForgeryData { CreationDate = new DateTime(2010, 12, 12), Salt = "Salty", Username = "******", Value = "12345" }; _cookieToken = new AntiForgeryData { CreationDate = new DateTime(2010, 12, 12), Salt = "Salty", Username = "******", Value = "12345" }; MockFor <IAntiForgerySerializer>().Stub(x => x.Deserialize("CookieValue")).Return(_cookieToken); MockFor <IAntiForgerySerializer>().Stub(x => x.Deserialize("FormValue")).Return(_formToken); }
public UserCookiesSettings(ICookies cookies) { if (cookies == null) { throw new ArgumentException("cookies parameter must be not null"); } _cookies = cookies; }
public HttpContext(IServerVariables serverVariables, ICookies requestCookies, ICookies responseCookies, ISessionState sessionState) { ServerVariables = serverVariables; RequestCookies = requestCookies; ResponseCookies = responseCookies; SessionState = sessionState; }
protected override void beforeEach() { time = MockRepository.GenerateMock <ISystemTime>(); cookies = MockFor <ICookies>(); writer = new RecordingOutputWriter(); theName = "some name"; theCookieValue = new CookieValue(theName, time, cookies, writer); }
public AntiForgeryValidator(IAntiForgeryTokenProvider tokenProvider, IAntiForgerySerializer serializer, ICookies cookies, IFubuApplicationFiles fubuApplicationFiles, IRequestData requestData) { _tokenProvider = tokenProvider; _serializer = serializer; _cookies = cookies; _fubuApplicationFiles = fubuApplicationFiles; _requestData = requestData; }
public AntiForgeryService(IOutputWriter outputWriter, IAntiForgeryTokenProvider tokenProvider, IAntiForgerySerializer serializer, IFubuApplicationFiles fubuApplicationFiles, ICookies cookies) { _outputWriter = outputWriter; _tokenProvider = tokenProvider; _serializer = serializer; _fubuApplicationFiles = fubuApplicationFiles; _cookies = cookies; }
/// <summary>Static getter for Włączyć komunikat o cookies</summary> public static bool GetEnableCookies(ICookies that) { return(that.GetPropertyValue <bool>("enableCookies")); }
public CookieEndpoint(ICookies cookies, IOutputWriter writer) { _cookies = cookies; _writer = writer; }
public CookieEndpoint(ICookies cookies, IHttpWriter writer) { _cookies = cookies; _writer = writer; }
protected override void beforeEach() { inner = MockFor <ICookies>(); }
public AccountController(HerbsDbContext context, ICookies cookies) { _context = context; _cookies = cookies; }
public BasicFubuLoginCookies(ISystemTime time, ICookies cookies, IOutputWriter writer) { _time = time; _cookies = cookies; _writer = writer; }
public LoginCookieService(CookieSettings settings, ICookies cookies, IOutputWriter writer) { _settings = settings; _cookies = cookies; _writer = writer; }
public static void Write(ICookies cookies, string name, string value) {
public CartController(ICookies cookies, HerbsDbContext context) { _cookies = cookies; _context = context; }
/// <summary>Static getter for Treść</summary> public static IHtmlString GetText(ICookies that) { return(that.GetPropertyValue <IHtmlString>("text")); }
public CookieValueSource(ICookies cookies) { _cookies = cookies; Provenance = RequestDataSource.Cookie.ToString(); }
public OneTrustUserCookiesSettings(ICookies cookies) : base(cookies) { }
public CookieValue(string cookieName, ISystemTime time, ICookies cookies) { _time = time; _cookies = cookies; _cookieName = cookieName; }
public CookieFlashProvider(IOutputWriter writer, ICookies cookies, ISystemTime systemTime) { _writer = writer; _cookies = cookies; _systemTime = systemTime; }
public SelfHostRequestData(RouteData routeData, HttpRequestMessage request, ICookies cookies) { AddValues(new RouteDataValues(routeData)); var querystring = request.RequestUri.ParseQueryString(); AddValues("Querystring", new NamedKeyValues(querystring)); var formData = request.Content.IsFormData() ? request.Content.ReadAsFormDataAsync().Result : new NameValueCollection(); AddValues(RequestDataSource.Request.ToString(), new NamedKeyValues(formData)); var headers = AggregateKeyValues.For(new HeaderKeyValues(request.Headers), new HeaderKeyValues(request.Content.Headers)); AddValues(RequestDataSource.Header.ToString(), headers); Func<string, IEnumerable<string>, bool> ignoreCaseKeyFinder = (key, keys) => keys.Contains(key, StringComparer.InvariantCultureIgnoreCase); var values = new SimpleKeyValues(key => cookies.Get(key).Value, () => cookies.Request.Select(x => x.Name), ignoreCaseKeyFinder); var valueSource = new FlatValueSource<object>(values, RequestDataSource.Cookie.ToString()); AddValues(valueSource); }