public Handler(
     IAuthorizationService authorizationService,
     IIdentityResolver identityResolver,
     ITerraformService terraformService,
     TerraformOptions terraformOptions)
 {
     _authorizationService = authorizationService;
     _user             = identityResolver.GetClaimsPrincipal();
     _terraformService = terraformService;
     _terraformOptions = terraformOptions;
 }
 public Handler(
     CasterContext db,
     IMapper mapper,
     IAuthorizationService authorizationService,
     IIdentityResolver identityResolver,
     TerraformOptions terraformOptions,
     ITerraformService terraformService,
     ILockService lockService,
     ILogger <BaseOperationHandler> logger) :
     base(db, mapper, authorizationService, identityResolver, terraformOptions, terraformService, lockService, logger)
 {
 }
Exemple #3
0
 public Handler(
     CasterContext db,
     IMapper mapper,
     IAuthorizationService authorizationService,
     IIdentityResolver identityResolver,
     TerraformOptions terraformOptions)
 {
     _db     = db;
     _mapper = mapper;
     _authorizationService = authorizationService;
     _user             = identityResolver.GetClaimsPrincipal();
     _terraformOptions = terraformOptions;
 }
Exemple #4
0
 public Handler(
     CasterContext db,
     IMapper mapper,
     IMediator mediator,
     IAuthorizationService authorizationService,
     IIdentityResolver identityResolver,
     ILockService lockService,
     TerraformOptions options)
 {
     _db                   = db;
     _mapper               = mapper;
     _mediator             = mediator;
     _authorizationService = authorizationService;
     _user                 = identityResolver.GetClaimsPrincipal();
     _lockService          = lockService;
     _options              = options;
 }
 public ApplyAddedHandler(
     CasterContext db,
     DbContextOptions <CasterContext> dbOptions,
     ILogger <ApplyAddedHandler> logger,
     ITerraformService terraformService,
     TerraformOptions options,
     IMediator mediator,
     IOutputService outputService)
 {
     _db               = db;
     _dbOptions        = dbOptions;
     _logger           = logger;
     _terraformService = terraformService;
     _options          = options;
     _mediator         = mediator;
     _outputService    = outputService;
 }
Exemple #6
0
 public BaseOperationHandler(
     CasterContext db,
     IMapper mapper,
     IAuthorizationService authorizationService,
     IIdentityResolver identityResolver,
     TerraformOptions terraformOptions,
     ITerraformService terraformService,
     ILockService lockService,
     ILogger <BaseOperationHandler> logger)
 {
     _db     = db;
     _mapper = mapper;
     _authorizationService = authorizationService;
     _user             = identityResolver.GetClaimsPrincipal();
     _terraformOptions = terraformOptions;
     _terraformService = terraformService;
     _lockService      = lockService;
     _logger           = logger;
 }
        public static void AddApiClients(this IServiceCollection services, ClientOptions clientOptions, TerraformOptions terraformOptions, ILoggerFactory loggerFactory)
        {
            services.AddPlayerClient(clientOptions, loggerFactory);
            services.AddIdentityClient(clientOptions, loggerFactory);
            services.AddGitlabClient(clientOptions, terraformOptions, loggerFactory);

            services.AddTransient <AuthenticatingHandler>();
        }
        private static void AddGitlabClient(this IServiceCollection services, ClientOptions clientOptions, TerraformOptions terraformOptions, ILoggerFactory loggerFactory)
        {
            var policy = GetPolicy(clientOptions.MaxRetryDelaySeconds, "Gitlab Api", loggerFactory);

            services.AddHttpClient("gitlab", client =>
            {
                // Workaround to avoid TaskCanceledException after several retries. TODO: find a better way to handle this.
                client.Timeout     = Timeout.InfiniteTimeSpan;
                client.BaseAddress = new Uri(terraformOptions.GitlabApiUrl);
            }).AddPolicyHandler(policy);
        }
 public TerraformService(TerraformOptions options, ILogger <TerraformService> logger)
 {
     _options = options;
     _logger  = logger;
 }
 public TerraformService(TerraformOptions options, ILogger <TerraformService> logger, IMemoryCache cache)
 {
     _options      = options;
     _logger       = logger;
     _processCache = cache;
 }