public AwsApiGatewayAdapter( ILogger <AwsAdapterBase> logger, AwsContext awsContext, AmazonAPIGatewayConfig amazonClientConfig) : base(logger, awsContext, amazonClientConfig) { }
public AwsVpcReader( ILogger <AwsAdapterBase> logger, AwsContext awsContext, AmazonEC2Config amazonEc2Config) : base(logger, awsContext, amazonEc2Config) { }
protected AwsAdapterBase( ILogger <AwsAdapterBase> logger, AwsContext awsContext, ClientConfig amazonClientConfig ) : base(logger, awsContext, amazonClientConfig) { Ttl = 60 * 60; }
public AwsApiGatewayResolverStrategy( IDnsContextAccessor dnsContextAccessor, CacheManager cacheManager, AwsContext awsContext, AmazonAPIGatewayConfig amazonApiGatewayConfig, IServiceProvider serviceProvider) : base(dnsContextAccessor, cacheManager, awsContext, amazonApiGatewayConfig, serviceProvider) { StrategyName = "AwsApiGateway"; }
public AwsDocDbResolverStrategy( IDnsContextAccessor dnsContextAccessor, CacheManager cacheManager, AwsContext awsContext, AmazonDocDBConfig amazonDocDbConfig, IServiceProvider serviceProvider) : base(dnsContextAccessor, cacheManager, awsContext, amazonDocDbConfig, serviceProvider) { StrategyName = "AwsDocDb"; }
public AwsElasticCacheResolverStrategy( IDnsContextAccessor dnsContextAccessor, CacheManager cacheManager, AwsContext awsContext, AmazonElastiCacheConfig amazonElastiCacheConfig, IServiceProvider serviceProvider) : base(dnsContextAccessor, cacheManager, awsContext, amazonElastiCacheConfig, serviceProvider) { StrategyName = "AwsElasticCache"; }
protected AwsBaseResolverStrategy( IDnsContextAccessor dnsContextAccessor, CacheManager cacheManager, AwsContext awsContext, ClientConfig awsClientConfig, IServiceProvider serviceProvider) : base(dnsContextAccessor, cacheManager, null) { AwsContext = awsContext; AwsClientConfig = awsClientConfig; ServiceProvider = serviceProvider; NeedsQueryTimeout = true; }
protected AwsBase( ILogger <AwsAdapterBase> logger, AwsContext awsContext, ClientConfig amazonClientConfig ) { Logger = logger; AwsContext = awsContext; AmazonClientConfig = amazonClientConfig; if (AmazonClientConfig != null) { AmazonClientConfig.RegionEndpoint = RegionEndpoint.GetBySystemName(awsContext?.AwsSettings?.Region); } }
public async Task StartReadingVpcAsync(AwsContext awsContext, CancellationToken cancellationToken) { if (awsContext?.AwsSettings?.UserAccounts == null) { return; } _proxyBypassList.Clear(); try { foreach (var awsSettingsUserAccount in awsContext.AwsSettings.UserAccounts) { if (awsSettingsUserAccount.DoScan) { await ReadVpcAsync(awsSettingsUserAccount.AwsCredentials, awsSettingsUserAccount, cancellationToken) .ConfigureAwait(false); } foreach (var userRoleExtended in awsSettingsUserAccount.Roles) { if (userRoleExtended.DoScan) { await ReadVpcAsync(userRoleExtended.AwsCredentials, userRoleExtended, cancellationToken) .ConfigureAwait(false); } } } var path = Path.Combine(Environment.CurrentDirectory, awsContext.AwsSettings.OutputFileName); _logger.LogInformation("AWS write ProxyBypassList in File: [{0}]", path); await File.WriteAllTextAsync(path, CreateContentForProxyBypassFile(), Encoding.UTF8, cancellationToken) .ConfigureAwait(false); _logger.LogInformation("AWS import finished!"); } catch (Exception e) { _logger.LogError(e, e.Message); } }
public override async Task <List <DnsRecordBase> > ResolveAsync(DnsQuestion dnsQuestion, CancellationToken cancellationToken) { if (AwsContext == null) { AwsContext = ServiceProvider.GetService <AwsContext>(); } var result = new List <DnsRecordBase>(); AwsClient?.Dispose(); foreach (var awsSettingsUserAccount in AwsContext.AwsSettings.UserAccounts) { await DoScanAsync(dnsQuestion, cancellationToken, awsSettingsUserAccount, result).ConfigureAwait(false); foreach (var userRoleExtended in awsSettingsUserAccount.Roles) { await DoScanAsync(dnsQuestion, cancellationToken, userRoleExtended, result).ConfigureAwait(false); } } AwsClient?.Dispose(); return(result); }
public AwsInstancesController(AwsContext context) { _context = context; }
public SearchController(AwsContext context) { _context = context; }
protected AwsBase( ILogger <AwsAdapterBase> logger, AwsContext awsContext) : this(logger, awsContext, default(ClientConfig)) { }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, AwsContext context) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); // app.UseStaticFiles(); app.UseStaticFiles(new StaticFileOptions() { OnPrepareResponse = c => { //Do not add cache to json files. We need to have new versions when we add new translations. if (!c.Context.Request.Path.Value.Contains(".json")) { c.Context.Response.GetTypedHeaders().CacheControl = new CacheControlHeaderValue() { MaxAge = TimeSpan.FromDays(30) // Cache everything except json for 30 days }; } else { c.Context.Response.GetTypedHeaders().CacheControl = new CacheControlHeaderValue() { MaxAge = TimeSpan.FromMinutes(15) // Cache json for 15 minutes }; } } }); DbInitializer.Initialize(context); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { HotModuleReplacement = true, HotModuleReplacementEndpoint = "/dist/" }); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); }); // Enable middleware to serve swagger-ui (HTML, JS, CSS etc.), specifying the Swagger JSON endpoint. app.MapWhen(x => !x.Request.Path.Value.StartsWith("/swagger", StringComparison.OrdinalIgnoreCase), builder => { builder.UseMvc(routes => { routes.MapSpaFallbackRoute( name: "spa-fallback", defaults: new { controller = "Home", action = "Index" }); }); }); } else { app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); routes.MapRoute( "Sitemap", "sitemap.xml", new { controller = "Home", action = "SitemapXml" }); routes.MapSpaFallbackRoute( name: "spa-fallback", defaults: new { controller = "Home", action = "Index" }); }); app.UseExceptionHandler("/Home/Error"); } }
public AwsVpcEndpointAdapter( ILogger <AwsAdapterBase> logger, AwsContext awsContext) : base(logger, awsContext) { }
public UsersController(AwsContext context) { _context = context; }