Exemple #1
0
 public CookieValue(string cookieName, ISystemTime time, ICookies cookies, IOutputWriter writer)
 {
     _time       = time;
     _cookies    = cookies;
     _writer     = writer;
     _cookieName = cookieName;
 }
Exemple #2
0
 public CookieValue(string cookieName, ISystemTime time, ICookies cookies, IOutputWriter writer)
 {
     _time = time;
     _cookies = cookies;
     _writer = writer;
     _cookieName = cookieName;
 }
Exemple #3
0
        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;
 }
Exemple #7
0
        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 AntiForgeryValidator(IAntiForgeryTokenProvider tokenProvider, IAntiForgerySerializer serializer,
                             ICookies cookies, IFubuApplicationFiles fubuApplicationFiles,
                             IRequestData requestData)
 {
     _tokenProvider        = tokenProvider;
     _serializer           = serializer;
     _cookies              = cookies;
     _fubuApplicationFiles = fubuApplicationFiles;
     _requestData          = requestData;
 }
 public HttpContext(IServerVariables serverVariables,
     ICookies requestCookies,
     ICookies responseCookies,
     ISessionState sessionState)
 {
     ServerVariables = serverVariables;
     RequestCookies = requestCookies;
     ResponseCookies = responseCookies;
     SessionState = sessionState;
 }
 public AntiForgeryService(IOutputWriter outputWriter,
                           IAntiForgeryTokenProvider tokenProvider,
                           IAntiForgerySerializer serializer,
                           IFubuApplicationFiles fubuApplicationFiles,
                           ICookies cookies)
 {
     _outputWriter = outputWriter;
     _tokenProvider = tokenProvider;
     _serializer = serializer;
     _fubuApplicationFiles = fubuApplicationFiles;
     _cookies = cookies;
 }
 public AntiForgeryService(IOutputWriter outputWriter,
                           IAntiForgeryTokenProvider tokenProvider,
                           IAntiForgerySerializer serializer,
                           IFubuApplicationFiles fubuApplicationFiles,
                           ICookies cookies)
 {
     _outputWriter         = outputWriter;
     _tokenProvider        = tokenProvider;
     _serializer           = serializer;
     _fubuApplicationFiles = fubuApplicationFiles;
     _cookies = cookies;
 }
Exemple #13
0
 /// <summary>Static getter for Włączyć komunikat o cookies</summary>
 public static bool GetEnableCookies(ICookies that)
 {
     return(that.GetPropertyValue <bool>("enableCookies"));
 }
Exemple #14
0
 public CookieEndpoint(ICookies cookies, IOutputWriter writer)
 {
     _cookies = cookies;
     _writer  = writer;
 }
Exemple #15
0
 public CookieEndpoint(ICookies cookies, IHttpWriter writer)
 {
     _cookies = cookies;
     _writer  = writer;
 }
Exemple #16
0
 protected override void beforeEach()
 {
     inner = MockFor <ICookies>();
 }
Exemple #17
0
 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;
 }
Exemple #20
0
 public CookieEndpoint(ICookies cookies, IHttpWriter writer)
 {
     _cookies = cookies;
     _writer = writer;
 }
Exemple #21
0
 public static void Write(ICookies cookies, string name, string value)
 {
Exemple #22
0
 public CartController(ICookies cookies, HerbsDbContext context)
 {
     _cookies = cookies;
     _context = context;
 }
Exemple #23
0
 /// <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)
 {
 }
Exemple #26
0
 public CookieValueSource(ICookies cookies)
 {
     _cookies   = cookies;
     Provenance = RequestDataSource.Cookie.ToString();
 }
Exemple #27
0
 public CookieEndpoint(ICookies cookies, IOutputWriter writer)
 {
     _cookies = cookies;
     _writer = writer;
 }
 public BasicFubuLoginCookies(ISystemTime time, ICookies cookies, IOutputWriter writer)
 {
     _time    = time;
     _cookies = cookies;
     _writer  = writer;
 }
Exemple #29
0
 public CookieValue(string cookieName, ISystemTime time, ICookies cookies)
 {
     _time = time;
     _cookies = cookies;
     _cookieName = cookieName;
 }
Exemple #30
0
 public CookieFlashProvider(IOutputWriter writer, ICookies cookies, ISystemTime systemTime)
 {
     _writer     = writer;
     _cookies    = cookies;
     _systemTime = systemTime;
 }
Exemple #31
0
 public CookieValue(string cookieName, ISystemTime time, ICookies cookies)
 {
     _time       = time;
     _cookies    = cookies;
     _cookieName = cookieName;
 }
 public LoginCookieService(CookieSettings settings, ICookies cookies, IOutputWriter writer)
 {
     _settings = settings;
     _cookies  = cookies;
     _writer   = writer;
 }
        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);
        }