예제 #1
0
 public void Configure(IRequestGraph graph)
 {
     graph.Chains.ForEach(x => x.AddFirst<ErrorWrapperChainPart>()
         .AddLast<AuthenticateEndpoint>()
         .AddLast(x.Endpoint.GetCorrectActionExecutorChainPart())
         .AddLast<RenderEndpointResult>()
         .AddLast<WriteUWebVersionHeader>());
 }
예제 #2
0
파일: UWebEngine.cs 프로젝트: UStack/UWeb
        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;
        }
예제 #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);
        }
예제 #4
0
파일: Details.cs 프로젝트: UStack/UWeb
 public Details(IRequestGraph requestGraph, IApplicationEndpoints applicationEndpoints)
 {
     this.requestGraph = requestGraph;
     this.applicationEndpoints = applicationEndpoints;
 }
예제 #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>());
 }