Ejemplo n.º 1
0
 public void Configure(IRequestGraph graph)
 {
     graph.Chains.ForEach(x => x.AddFirst<ErrorWrapperChainPart>()
         .AddLast<AuthenticateEndpoint>()
         .AddLast(x.Endpoint.GetCorrectActionExecutorChainPart())
         .AddLast<RenderEndpointResult>()
         .AddLast<WriteUWebVersionHeader>());
 }
Ejemplo n.º 2
0
        public UWebEngine(IRouteCollection collection, IRequestGraph requestGraph, IServiceContainer serviceContainer, IPrePipelineCollection prePipelineCollection, 
            IPostPipelineCollection postPipelineCollection)
        {
            collection.ArgumentNullCheck("collection");
            requestGraph.ArgumentNullCheck("requestGraph");
            serviceContainer.ArgumentNullCheck("serviceContainer");
            prePipelineCollection.ArgumentNullCheck("prePipelineCollection");
            postPipelineCollection.ArgumentNullCheck("postPipelineCollection");

            this.collection = collection;
            this.requestGraph = requestGraph;
            this.serviceContainer = serviceContainer;
            this.prePipelineCollection = prePipelineCollection;
            this.postPipelineCollection = postPipelineCollection;
        }
Ejemplo n.º 3
0
        public void SetUp()
        {
            routeCollection = A.Fake<IRouteCollection>();
            outputWriter = A.Fake<IOutputWriter>();
            requestGraph = A.Fake<IRequestGraph>();
            prePipelineCollection = A.Fake<IPrePipelineCollection>();
            postPipelineCollection = A.Fake<IPostPipelineCollection>();

            endpoint = A.Fake<IEndpoint>();
            request = A.Fake<IRequest>();
            route = A.Fake<IRoute>();
            requestChain = A.Fake<IRequestChain>();
            response = A.Fake<IResponse>();

            serviceContainer = A.Fake<IServiceContainer>();

            A.CallTo(() => route.Endpoint).Returns(endpoint);
            A.CallTo(() => routeCollection.Resolve(request)).Returns(route);
            A.CallTo(() => requestGraph.FindChainFor(endpoint)).Returns(requestChain);
            A.CallTo(() => outputWriter.CreateResponse()).Returns(response);

            engine = new UWebEngine(routeCollection, requestGraph, serviceContainer, prePipelineCollection, postPipelineCollection);
        }
Ejemplo n.º 4
0
 public Details(IRequestGraph requestGraph, IApplicationEndpoints applicationEndpoints)
 {
     this.requestGraph = requestGraph;
     this.applicationEndpoints = applicationEndpoints;
 }
Ejemplo n.º 5
0
 public void Configure(IRequestGraph graph)
 {
     graph.Chains
         .Where(x => EndpointExtensions.GetInputModelType(x.Endpoint) != null && typeof(ISecureMeFromAntiXssAttacks).IsAssignableFrom(EndpointExtensions.GetInputModelType(x.Endpoint)))
         .ForEach(x => x.AddFirst<ValidateAntiXssToken>());
 }