Esempio n. 1
0
 public StaticRquestHandler(UserRequest userRequest, UserResponse userResponse) : base(userRequest, userResponse)
 {
 }
Esempio n. 2
0
 public RequestPipeline(UserRequest userRequest, UserResponse userResponse)
 {
     this.userRequest  = userRequest ?? throw new ArgumentNullException(paramName: nameof(userRequest));
     this.userResponse = userResponse ?? throw new ArgumentNullException(paramName: nameof(userResponse));
 }
Esempio n. 3
0
 public AuthorizeRquestHandler(UserRequest userRequest, UserResponse userResponse) : base(userRequest, userResponse)
 {
 }
Esempio n. 4
0
        static void Main(string[] args)
        {
            UserRequest request1 = new UserRequest
            {
                Cookie          = "",
                UserName        = "******",
                Role            = null,
                ContentType     = "image/svg+xml",
                URL             = "/static/files/johnsmith.svg",
                IsStaticRequest = true
            };

            UserRequest request2 = new UserRequest
            {
                Cookie          = "SESS:12345",
                UserName        = "******",
                Role            = "user",
                ContentType     = "text/html",
                URL             = "/products/index.html",
                IsStaticRequest = false
            };

            UserRequest request3 = new UserRequest
            {
                Cookie          = "SESS:12345",
                UserName        = "******",
                Role            = "user",
                ContentType     = "text/html",
                URL             = "/admin/products/upsert/3",
                IsStaticRequest = false
            };

            UserRequest request4 = new UserRequest
            {
                Cookie          = "SESS:11111",
                UserName        = "******",
                Role            = "admin",
                ContentType     = "text/html",
                URL             = "/admin/products/upsert/5",
                IsStaticRequest = false
            };

            UserResponse response = new UserResponse();

            WriteLine("****** Pipeline for request 1 ******");

            var pipeline = BuildPipeLine(request1, response);

            pipeline.Handle();

            WriteLine(response);

            WriteLine("****** END OF Pipeline for request 1 ******");

            WriteLine("****** Pipeline for request 2 ******");

            pipeline = BuildPipeLine(request2, response);

            pipeline.Handle();

            WriteLine(response);

            WriteLine("****** END OF Pipeline for request 2 ******");

            WriteLine("****** Pipeline for request 3 ******");

            pipeline = BuildPipeLine(request3, response);

            pipeline.Handle();

            WriteLine(response);

            WriteLine("****** END OF Pipeline for request 3 ******");

            WriteLine("****** Pipeline for request 4 ******");

            pipeline = BuildPipeLine(request4, response);

            pipeline.Handle();

            WriteLine(response);

            WriteLine("****** END OF Pipeline for request 4 ******");
        }
Esempio n. 5
0
 public AuthenticateRquestHandler(UserRequest userRequest, UserResponse userResponse) : base(userRequest, userResponse)
 {
 }