예제 #1
0
 public GetNotificationsHandler(AutoTestContext autoTestContext)
 {
     this.autoTestContext = autoTestContext;
 }
예제 #2
0
 public GetEditableEntrantsHandler(AutoTestContext autoTestContext)
 {
     this.autoTestContext = autoTestContext;
 }
예제 #3
0
 public AddNotificationHandler(AutoTestContext autoTestContext, ISignalRNotifier signalRNotifier)
 {
     this.autoTestContext = autoTestContext;
     this.signalRNotifier = signalRNotifier;
 }
예제 #4
0
 public SaveMarshalHandler(AutoTestContext autoTestContext)
 {
     this.autoTestContext = autoTestContext;
 }
예제 #5
0
 public ClubRepository(AutoTestContext autoTestContext)
 {
     _autoTestContext = autoTestContext;
 }
예제 #6
0
 public EventsRepository(AutoTestContext autoTestContext)
 {
     _autoTestContext = autoTestContext;
 }
예제 #7
0
 public DeleteEventHandler(AutoTestContext autoTestContext)
 {
     _autoTestContext = autoTestContext;
 }
예제 #8
0
 public DeleteMarshalHandler(AutoTestContext autoTestContext)
 {
     _autoTestContext = autoTestContext;
 }
예제 #9
0
 public static void InitializeDbForTests(AutoTestContext db)
 {
     db.Events !.Add(new Event(22, 1, "", DateTime.Today, 10, 2, "", EventType.AutoTest, string.Empty, TimingSystem.StopWatch));
     db.SaveChanges();
 }
예제 #10
0
 public GetEditableMarshalsHandler(AutoTestContext autoTestContext)
 {
     this.autoTestContext = autoTestContext;
 }
예제 #11
0
 public TestRunsRepository(AutoTestContext autoTestContext)
 {
     _autoTestContext = autoTestContext;
 }
예제 #12
0
 public IsClubAdminHandler(AutoTestContext autoTestContext)
 {
     this.autoTestContext = autoTestContext;
 }
예제 #13
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, AutoTestContext autoTestContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseResponseCompression();
            app.UseSpaStaticFileCaching();

            app.UseRouting();
            app.UseAuthentication().UseAuthorization();
            app.UseWebMarkupMin();
            app.UseSecurityHeaders(
                policies => policies.AddDefaultSecurityHeaders()
                .AddStrictTransportSecurityMaxAgeIncludeSubDomains(maxAgeInSeconds: 63072000)
                .RemoveServerHeader().AddContentSecurityPolicy(builder =>
            {
                builder.AddDefaultSrc().Self();
                var scripts = builder.AddScriptSrc().Self()
                              .From(googleCom)
                              .From("https://www.gstatic.com")
                              .From(googleAnal)
                              .WithHash256(swaggerHash)
                              .WithHash256(swagger2Hash);
                if (env.IsDevelopment())
                {
                    scripts.UnsafeEval();
                }

                builder.AddFrameSrc().Self().From(googleCom);
                var style = builder.AddStyleSrc().Self();
                if (env.IsDevelopment())
                {
                    style.UnsafeInline();
                }
                else
                {
                    style.WithHash256(baseCssHash);
                }

                var connect = builder.AddConnectSrc().Self().From(googleCom);
                if (env.IsDevelopment())
                {
                    connect.From("https://localhost:*");
                }

                builder.AddUpgradeInsecureRequests();
            }));


            app.UseEndpoints(endpoints =>
            {
                endpoints.MapHub <ResultsHub>("/resultsHub");
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller}/{action=Index}/{id?}");
            });
            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                //c.OAuthClientId("implicit");
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
                c.OAuthConfigObject.ClientId = ClientId;
            });
            app.UseSpa(spa =>
            {
                if (env.IsDevelopment())
                {
                    spa.Options.SourcePath = "ClientApp/";
                    spa.UseReactDevelopmentServer(npmScript: "dev");
                }
                else
                {
                    spa.Options.SourcePath = "ClientApp/build/";
                }
            });
            autoTestContext.SeedDatabase();
        }
예제 #14
0
 public GetProfileHandler(AutoTestContext autoTestContext)
 {
     this.autoTestContext = autoTestContext;
 }
예제 #15
0
 public GetMarshalEventsHandler(AutoTestContext autoTestContext)
 {
     this.autoTestContext = autoTestContext;
 }
예제 #16
0
 public AddTestRunHandler(ITestRunsRepository testRunsRepository, ISignalRNotifier signalRNotifier, AutoTestContext autoTestContext)
 {
     this.testRunsRepository = testRunsRepository;
     this.signalRNotifier    = signalRNotifier;
     _autoTestContext        = autoTestContext;
 }
예제 #17
0
 public MarkPaidHandler(AutoTestContext autoTestContext)
 {
     _autoTestContext = autoTestContext;
 }