Пример #1
0
 internal TableStorageTarget(ICloudTableService cloudTableService)
 {
     TaskDelayMilliseconds            = 200;
     BatchSize                        = 100;
     _cloudTableService               = cloudTableService;
     _checkAndRepairTableNameDelegate = CheckAndRepairTableNamingRules;
 }
Пример #2
0
        public ImageService(IConfiguration configuration, ICloudTableService cloudTableService, ICloudStorageService cloudStorageService)
        {
            Configuration = configuration;

            CloudTableService = cloudTableService;

            CloudStorageService = cloudStorageService;
        }
Пример #3
0
        internal TableStorageTarget(ICloudTableService cloudTableService)
        {
            TaskDelayMilliseconds = 200;
            BatchSize             = 100;

            RowKey = Layout.FromMethod(l => string.Concat((DateTime.MaxValue.Ticks - l.TimeStamp.Ticks).ToString("d19"), "__", Guid.NewGuid().ToString()), LayoutRenderOptions.ThreadAgnostic);

            _cloudTableService = cloudTableService;
            _checkAndRepairTableNameDelegate = CheckAndRepairTableNamingRules;
        }
        public CloudStorageService(IConfiguration configuration, ICloudTableService cloudTableService)
        {
            Configuration = configuration;

            CloudTableService = cloudTableService;

            var cloudConnectionString = Configuration["BlobConnectionString"];

            var cloudStorageAccount = CloudStorageAccount.Parse(cloudConnectionString);

            CloudBlobClient = cloudStorageAccount.CreateCloudBlobClient();
        }
Пример #5
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ICloudStorageService storageService, ICloudTableService tableService)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseSecurityHeaders(new HeaderPolicyCollection()
                                       .AddCustomHeader("Content-Security-Policy", "default-src 'none\';" +
                                                        "script-src \'self\' https://cognitive.pbreen.co.uk https://maxcdn.bootstrapcdn.com https://code.jquery.com/;" +
                                                        "style-src \'self\' \'unsafe-inline\' https://maxcdn.bootstrapcdn.com;" +
                                                        "worker-src \'self' blob:;" +
                                                        "font-src \'self\' https://maxcdn.bootstrapcdn.com;" +
                                                        "img-src \'self\' https://cognitiveservice.blob.core.windows.net;" +
                                                        "connect-src \'self\';" +
                                                        "form-action \'self\';" +
                                                        "upgrade-insecure-requests;" +
                                                        "block-all-mixed-content;" +
                                                        "frame-ancestors 'none';" +
                                                        "report-uri https://818ad812755587db2606b9d22c5ca5b7.report-uri.com/r/d/csp/wizard;")
                                       .AddCustomHeader("X-Content-Type-Options", "nosniff")
                                       .AddCustomHeader("X-Frame-Options", "DENY")
                                       .AddCustomHeader("X-XSS-Protection", "1; mode=block")
                                       .AddCustomHeader("Strict-Transport-Security", "max-age=31536000; includeSubDomains; preload")
                                       .AddCustomHeader("referrer-policy", "no-referrer-when-downgrade")
                                       .AddCustomHeader("Access-Control-Allow-Origin", "https://report-uri.com/")
                                       .RemoveCustomHeader("X-Powered-By")
                                       .RemoveServerHeader()
                                       );

                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();

            app.UseMvc(routes =>
            {
                routes.MapRoute("default", "{controller=Images}/{action=Index}/{id?}");
            });

            storageService.CreateContainersIfNotExist().Wait();
            tableService.CreateTablesIfNotExist().Wait();
        }
 public AudioIdentificationService(IConfiguration configuration, ICloudTableService cloudTableService)
 {
     Configuration     = configuration;
     CloudTableService = cloudTableService;
 }
Пример #7
0
 public TextService(IConfiguration configuration, ICloudTableService cloudTableService)
 {
     Configuration     = configuration;
     CloudTableService = cloudTableService;
 }
Пример #8
0
 public FaceVerificationService(IConfiguration configuration, ICloudTableService cloudTableService)
 {
     Configuration     = configuration;
     CloudTableService = cloudTableService;
 }