public CommandHandler(IDataProtector protector,
                       ICosmosManager cosmosManager,
                       ISecretManager secretManager,
                       ITokenManager tokenManager,
                       ITCManager tcDataManager)
 {
     _protector     = protector;
     _cosmosManager = cosmosManager;
     _secretManager = secretManager;
     _tokenManager  = tokenManager;
     _tcDataManager = tcDataManager;
 }
        public CommandController(
            IConfiguration configuration,
            IHttpClientFactory factory,
            IDataProtectionProvider provider,
            ISecretManager secretManager,
            ICosmosManager cosmosManager,
            ITokenManager tokenManager,
            ITCManager dataManager
            )
        {
#pragma warning disable CA2208 // Instantiate argument exceptions correctly
            if (provider is null)
            {
                var message = "IDataProtectionProvider";
                throw new ArgumentNullException(message);
            }

            if (factory is null)
            {
                throw new ArgumentNullException("IHttpClientFactory");
            }

            if (secretManager is null)
            {
                throw new ArgumentNullException("ISecretManager");
            }
#pragma warning restore CA2208 // Instantiate argument exceptions correctly

            _configuration = configuration;
            _protector     = provider.CreateProtector("UUIDProtector");
            _secretManager = secretManager;
            _cosmosManager = cosmosManager;
            _httpClient    = factory.CreateClient("BotClient");
            _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", _secretManager.GetSecret("Slack-SlackbotOAuthAccessToken"));
            _tokenManager  = tokenManager;
            _tcDataManager = dataManager;

            _commandHandler = new CommandHandler(_protector, _cosmosManager, _secretManager, _tokenManager, _tcDataManager);
        }
        public ModalController(
            IConfiguration configuration,
            IHttpClientFactory factory,
            IDataProtectionProvider provider,
            ISecretManager secretManager,
            ICosmosManager cosmosManager,
            ITokenManager tokenManager,
            ITCManager dataManager
            )
        {
#pragma warning disable CA2208 // Instantiate argument exceptions correctly
            if (provider is null)
            {
                var message = "IDataProtectionProvider";
                throw new ArgumentNullException(message);
            }

            if (factory is null)
            {
                throw new ArgumentNullException("IHttpClientFactory");
            }

            if (secretManager is null)
            {
                throw new ArgumentNullException("ISecretManager");
            }
#pragma warning restore CA2208 // Instantiate argument exceptions correctly

            _configuration = configuration;
            _protector     = provider.CreateProtector("UUIDProtector");
            _secretManager = secretManager;
            _cosmosManager = cosmosManager;
            _httpClient    = factory.CreateClient("BotClient");
            _tokenManager  = tokenManager;
            _tcDataManager = dataManager;

            _commandHandler = new CommandHandler(_protector, _cosmosManager, _secretManager, _tokenManager, _tcDataManager);
        }
Exemplo n.º 4
0
 public DataController(ICosmosManager cosmosManager, IMapper mapper)
 {
     _cosmosManager = cosmosManager;
     _mapper        = mapper;
 }
Exemplo n.º 5
0
 public TestRepository(IDocumentClient client, ICosmosManager cosmosManager, ITelemetryClient telemetryClient, string databaseId, string collectionName, string partitionKey = "\\id") : base(client, cosmosManager, telemetryClient, databaseId, collectionName, partitionKey)
 {
 }
Exemplo n.º 6
0
 public AuthRepository(ICosmosManager context)
 {
     _context = context;
 }
Exemplo n.º 7
0
 public PhotosController(IOptions <CloudinarySettings> cloudinaryConfig, ICosmosManager repo, IPhotoRepository photoRepo)
 {
     _clodinaryConfig = cloudinaryConfig;
     _photoRepo       = photoRepo;
     _repo            = repo;
 }