Пример #1
0
        public void FeatureBackground()
        {
            postProcessor = new CommandTrackingPostProcessor();

            Options = new SequinOptions
            {
                PostProcessor   = postProcessor,
                CommandPipeline = new[]
                {
                    new CommandPipelineStage(typeof(ConditionalCapture))
                }
            };
        }
Пример #2
0
        public void FeatureBackground()
        {
            postProcessor = new CommandTrackingPostProcessor();

            Options = Options.Configure()
                      .ForHttp()
                      .WithOwinDefaults()
                      .WithPipeline(x => new ConditionalCapture
            {
                Next = x.IssueCommand
            })
                      .WithPostProcessPipeline(postProcessor)
                      .Build();
        }
Пример #3
0
 public void Background()
 {
     postProcessor = new CommandTrackingPostProcessor();
     Server = TestServer.Create(app =>
                                {
                                    app.UseSequin(SequinOptions.Configure()
                                                               .WithOwinDefaults()
                                                               .WithPostProcessPipeline(postProcessor)
                                                               .WithPipeline(x => new ValidateCommand(new ReflectionValidatorFactory(Assembly.GetExecutingAssembly()))
                                                                                  {
                                                                                      Next = x.IssueCommand
                                                                                  })
                                                               .Build(), new[]
                                                                         {
                                                                             new ResponseMiddleware(typeof(CommandValidationResponseMiddleware), new DefaultDictionaryFormatter())
                                                                         });
                                });
 }
        public void Background()
        {
            isSignedIn = false;
            userRoles = new List<string>();
            postProcessor = new CommandTrackingPostProcessor();

            Server = TestServer.Create(app =>
                                       {
                                           app.Use(new Func<AppFunc, AppFunc>(next => (async env =>
                                                                                             {
                                                                                                 if (isSignedIn)
                                                                                                 {
                                                                                                     var context = new OwinContext(env);
                                                                                                     var claims = userRoles.Select(x => new Claim("role", x)).ToList();
                                                                                                     context.Request.User = new ClaimsPrincipal(new ClaimsIdentity(claims, "SomeAuthType"));
                                                                                                 }

                                                                                                 await next.Invoke(env);
                                                                                             })));

                                           var options = SequinOptions.Configure()
                                                                  .WithOwinDefaults()
                                                                  .WithPipeline(x =>
                                                                                {
                                                                                    CommandAuthorization.Next = x.IssueCommand;
                                                                                    return CommandAuthorization;
                                                                                })
                                                                  .WithPostProcessPipeline(postProcessor)
                                                                  .Build();

                                           app.UseSequin(options, new[]
                                                                  {
                                                                      new ResponseMiddleware(typeof(UnauthorizedCommandResponseMiddleware))
                                                                  });
                                       });
        }
 public void FeatureBackground()
 {
     postProcessor = new CommandTrackingPostProcessor();
 }