Beispiel #1
0
        public UserAccountManager(IFileAccess fileAccess, IEncryptionManager encryptionManager)
        {
            _fileAccess        = fileAccess;
            _encryptionManager = encryptionManager;

            Load();
        }
Beispiel #2
0
 public EncryptionService(IRsaManager rsaManager, IDecryptionManager decryptionManager,
                          IEncryptionManager encryptionManager)
 {
     this.rsaManager        = rsaManager;
     this.decryptionManager = decryptionManager;
     this.encryptionManager = encryptionManager;
 }
Beispiel #3
0
 public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer, ILogManager logManager, IEncryptionManager encryption)
     : base(applicationPaths, xmlSerializer)
 {
     _encryption = encryption;
     Instance    = this;
     Logger      = logManager.GetLogger("SMTP Notifications");
 }
Beispiel #4
0
        public SQLTaskScheduler(ISLogger logger, IResourceManager resourceManager, IUnitOfWork unitOfWork, IConnectionManager connManager,
                                IEncryptionManager encryptionManager)
        {
            this.logger            = logger;
            this.resourceManager   = resourceManager;
            this.unitOfWork        = unitOfWork;
            this.connManager       = connManager;
            this.encryptionManager = encryptionManager;

            triggerBatchTimer           = new System.Timers.Timer();
            triggerBatchTimer.Elapsed  += OnTriggerBatch;
            triggerBatchTimer.AutoReset = true;
            triggerBatchTimer.Interval  = TRIGGER_AFTER_MS;


            jobTypes = unitOfWork.JobTypes.GetAll();

            foreach (JobType jobType in jobTypes)
            {
                System.Timers.Timer timer = new System.Timers.Timer();
                timer.Elapsed  += (sender, e) => TryStartDataFlow(jobType.Type);
                timer.Enabled   = false;
                timer.Interval  = jobType.RepeatTimeSec * ONE_THOUSAND;
                timer.AutoReset = true;

                timers.Add(timer);
            }



            jobWorkers = new JobWorkers(logger, resourceManager, unitOfWork, this, encryptionManager);
        }
        public Notifier(ILogManager logManager, IEncryptionManager encryption)
        {
            _encryption = encryption;
            _logger = logManager.GetLogger(GetType().Name);

            Instance = this;
        }
Beispiel #6
0
 public YoutubeVideoUploadService(AppDbContext appDbContext, IEncryptionManager encryption, IOptions <YoutubeClientSecret> settings, MongoDbContext mongoDbContext)
 {
     _appDbContext        = appDbContext;
     _encryption          = encryption;
     _mongoDbContext      = mongoDbContext;
     _youtubeClientSecret = settings.Value;
 }
Beispiel #7
0
 public ValuesViewModel(IApiService apiService, IEncryptionManager encManager, ILocalStore localStore)
 {
     _apiService = apiService;
     _encManager = encManager;
     _localStore = localStore;
     ListValues.CollectionChanged += ListValues_CollectionChanged;
 }
Beispiel #8
0
        public ConnectManager(ILogger logger,
                              IApplicationPaths appPaths,
                              IJsonSerializer json,
                              IEncryptionManager encryption,
                              IHttpClient httpClient,
                              IServerApplicationHost appHost,
                              IServerConfigurationManager config, IUserManager userManager, IProviderManager providerManager, ISecurityManager securityManager, IFileSystem fileSystem)
        {
            _logger          = logger;
            _appPaths        = appPaths;
            _json            = json;
            _encryption      = encryption;
            _httpClient      = httpClient;
            _appHost         = appHost;
            _config          = config;
            _userManager     = userManager;
            _providerManager = providerManager;
            _securityManager = securityManager;
            _fileSystem      = fileSystem;

            _userManager.UserConfigurationUpdated += _userManager_UserConfigurationUpdated;
            _config.ConfigurationUpdated          += _config_ConfigurationUpdated;

            LoadCachedData();
        }
        public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer, IEncryptionManager encryption)
            : base(applicationPaths, xmlSerializer)
        {
            Instance    = this;
            _encryption = encryption;

            var username = Instance.Configuration.Username;
            var password = Instance.Configuration.PwData;

            var creds = new SoundCloudCredentials("78fd88dde7ebf8fdcad08106f6d56ab6",
                                                  "ef6b3dbe724eff1d03298c2e787a69bd");

            if (username != null && password != null)
            {
                creds = new SoundCloudCredentials("78fd88dde7ebf8fdcad08106f6d56ab6",
                                                  "ef6b3dbe724eff1d03298c2e787a69bd", username, _encryption.DecryptString(Instance.Configuration.PwData));
            }

            _SoundCloudClient = new SoundCloudClient(creds);

            if (username != null && password != null)
            {
                _SoundCloudClient.Authenticate();
            }
        }
 public SoundCloudChannel(IHttpClient httpClient, IJsonSerializer jsonSerializer, ILogManager logManager, IEncryptionManager encryption)
 {
     _httpClient = httpClient;
     _logger = logManager.GetLogger(GetType().Name);
     _jsonSerializer = jsonSerializer;
     _encryption = encryption;
 }
Beispiel #11
0
        public Notifier(ILogManager logManager, IEncryptionManager encryption)
        {
            _encryption = encryption;
            _logger     = logManager.GetLogger(GetType().Name);

            Instance = this;
        }
 public CachingClearSecretStore(
     IProtectedSecretRepository secrets,
     IEncryptionManager encryptionManager,
     ISecretCache <ClearSecret> cache) : base(secrets, encryptionManager)
 {
     _cache = cache;
 }
 protected BaseSecretStore(
     IProtectedSecretRepository secrets,
     IEncryptionManager encryptionManager)
 {
     _secrets           = secrets;
     _encryptionManager = encryptionManager;
 }
        /// <summary>
        /// To be added to start of application. This will set ConfigurationManager's s_configSystem to ours.
        /// </summary>
        public static bool Initialize(IEncryptionManager encryptionManager)
        {
            // replace config manager with our own version
            if (!initialized)
            {
                lock (sLockme)
                {
                    // check again in case another thread beat us to the punch after the previous check but before the lock was taken
                    if (!initialized)
                    {
                        // check if a key was defined, otherwise assume encryption is disabled
                        if (encryptionManager == null || !encryptionManager.HasKey)
                        {
                            return(false);
                        }

                        SecureConfigManager.KeyUtil = encryptionManager;

                        // initialize manager and load from disk if not done already
                        ConfigurationManager.ConnectionStrings.IsReadOnly();

                        // get s_configSystem field (private static volatile) from ConfigurationManager
                        FieldInfo s_configSystem = typeof(ConfigurationManager).GetField("s_configSystem",
                                                                                         BindingFlags.Static | BindingFlags.NonPublic);
                        // set its value to our modified implementation of IInternalConfigSystem
                        s_configSystem.SetValue(null, new SecureConfigManager((IInternalConfigSystem)s_configSystem.GetValue(null)));

                        initialized = true;
                    }
                }
            }

            return(true);
        }
Beispiel #15
0
        public TestProfileService()
        {
            var services = new ContainerResolver().Container;

            _profileService = (IProfileService)services.GetService(typeof(IProfileService));
            _encryption     = (IEncryptionManager)services.GetService(typeof(IEncryptionManager));
        }
Beispiel #16
0
        public JobWorkers(ISLogger logger, IResourceManager resourceManager, IUnitOfWork unitOfWork,
                          SQLTaskScheduler scheduler, IEncryptionManager encryptionManager)
        {
            this.logger            = logger;
            this.resourceManager   = resourceManager;
            this.unitOfWork        = unitOfWork;
            this.scheduler         = scheduler;
            this.encryptionManager = encryptionManager;



            ILocalStorage localDb = ServiceLocator.Current.GetInstance <ILocalStorage>();

            // BaseJobUpdater fullJobUpdater = new FullJobUpdater(instanceInfoUpdater, logger, unitOfWork, connManager, instanceDataCollector);
            // BaseJobUpdater statusJobUpdater = new StatusJobUpdater(instanceInfoUpdater, logger, unitOfWork, connManager, instanceDataCollector);


            BaseJobSaver fullJobSaver   = new FullJobSaver(logger, localDb, scheduler);
            BaseJobSaver statusJobSaver = new StatusJobSaver(logger, localDb, scheduler);
            BaseJobSaver removeJobSaver = new RemoveJobSaver(logger, localDb, scheduler);


            saveWorkers.Add(JobType.UpdateInfoType.Full, fullJobSaver);
            saveWorkers.Add(JobType.UpdateInfoType.CheckStatus, statusJobSaver);
            saveWorkers.Add(JobType.UpdateInfoType.RemoveInstances, removeJobSaver);


            //updateWorkers.Add(JobType.UpdateInfoType.Full, fullJobUpdater);
            // updateWorkers.Add(JobType.UpdateInfoType.CheckStatus, statusJobUpdater);
        }
Beispiel #17
0
        public Notifier(ILogger logger, IEncryptionManager encryption)
        {
            _encryption = encryption;
            _logger     = logger;

            Instance = this;
        }
Beispiel #18
0
        public LegendasTVProvider(
            ILogger logger,
            IHttpClient httpClient,
            IServerConfigurationManager config,
            IEncryptionManager encryption,
            ILocalizationManager localizationManager,
            ILibraryManager libraryManager,
            IJsonSerializer jsonSerializer,
            IServerApplicationPaths appPaths,
            IFileSystem fileSystem,
            IZipClient zipClient)
        {
            _logger              = logger;
            _httpClient          = httpClient;
            _config              = config;
            _encryption          = encryption;
            _libraryManager      = libraryManager;
            _localizationManager = localizationManager;
            _jsonSerializer      = jsonSerializer;
            _appPaths            = appPaths;
            _fileSystem          = fileSystem;
            _zipClient           = zipClient;

            _config.NamedConfigurationUpdating += _config_NamedConfigurationUpdating;

            // Load HtmlAgilityPack from embedded resource
            EmbeddedAssembly.Load(GetType().Namespace + ".HtmlAgilityPack.dll", "HtmlAgilityPack.dll");
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler((object sender, ResolveEventArgs args) => EmbeddedAssembly.Get(args.Name));
        }
Beispiel #19
0
        public JobWorkers(ISLogger logger, IResourceManager resourceManager, IUnitOfWork unitOfWork,
                          SQLTaskScheduler scheduler, IEncryptionManager encryptionManager)
        {
            this.logger            = logger;
            this.resourceManager   = resourceManager;
            this.unitOfWork        = unitOfWork;
            this.scheduler         = scheduler;
            this.encryptionManager = encryptionManager;

            /*
             * InstanceInfoUpdater instanceInfoUpdater = new InstanceInfoUpdater(logger);
             * IInstanceDataCollector instanceDataCollector = DependencyConfig.Initialize().Resolve<IInstanceDataCollector>(
             *                                                 new ParameterOverride("connManager", connManager),
             *                                                 new ParameterOverride("resourceManager", resourceManager),
             *                                                 new ParameterOverride("logger", logger));
             */

            ILocalStorage localDb = ServiceLocator.Current.GetInstance <ILocalStorage>();

            // BaseJobUpdater fullJobUpdater = new FullJobUpdater(instanceInfoUpdater, logger, unitOfWork, connManager, instanceDataCollector);
            // BaseJobUpdater statusJobUpdater = new StatusJobUpdater(instanceInfoUpdater, logger, unitOfWork, connManager, instanceDataCollector);


            BaseJobSaver fullJobSaver   = new FullJobSaver(logger, localDb, scheduler);
            BaseJobSaver statusJobSaver = new StatusJobSaver(logger, localDb, scheduler);


            saveWorkers.Add(JobType.UpdateInfoType.Full, fullJobSaver);
            saveWorkers.Add(JobType.UpdateInfoType.CheckStatus, statusJobSaver);


            //updateWorkers.Add(JobType.UpdateInfoType.Full, fullJobUpdater);
            // updateWorkers.Add(JobType.UpdateInfoType.CheckStatus, statusJobUpdater);
        }
Beispiel #20
0
 public SoundCloudChannel(IHttpClient httpClient, IJsonSerializer jsonSerializer, ILogManager logManager, IEncryptionManager encryption)
 {
     _httpClient     = httpClient;
     _logger         = logManager.GetLogger(GetType().Name);
     _jsonSerializer = jsonSerializer;
     _encryption     = encryption;
 }
Beispiel #21
0
 public EmailService(AppDbContext appDbContext, IOptions <AppSettings> settings, Random random, IEncryptionManager encryption, IUserIPAddress userIPAddress)
 {
     _appDbContext  = appDbContext;
     _random        = random;
     _appSettings   = settings.Value;
     _encryptor     = encryption;
     _userIPAddress = userIPAddress;
 }
        public RDCInstanceManager(ISnackbarMessageQueue snackbarMessageQueue, IFileAccess fileAccess, IEncryptionManager encryptionManager)
        {
            _snackbarMessageQueue = snackbarMessageQueue;
            _fileAccess           = fileAccess;
            _encryptionManager    = encryptionManager;

            Load();
        }
 public QRScanService(MongoDbContext mongoDbContext, AppDbContext appContext, IEncryptionManager Encryption, IMapper mapper, IFileService fileService)
 {
     _appDbContext   = appContext;
     _mapper         = mapper;
     _Encryptor      = Encryption;
     _fileService    = fileService;
     _mongoDbContext = mongoDbContext;
 }
Beispiel #24
0
 public UserService(IServiceScopeFactory scopeFactory, IJwtHandler jwtHandler,
                    IEncryptionManager encryptionManager, IPasswordHasher <User> passwordHasher)
 {
     _scopeFactory      = scopeFactory;
     _jwtHandler        = jwtHandler;
     _encryptionManager = encryptionManager;
     _passwordHasher    = passwordHasher;
 }
        public OpenSubtitleDownloader(ILogManager logManager, IHttpClient httpClient, IServerConfigurationManager config, IEncryptionManager encryption)
        {
            _logger     = logManager.GetLogger(GetType().Name);
            _httpClient = httpClient;
            _config     = config;
            _encryption = encryption;

            _config.ConfigurationUpdating += _config_ConfigurationUpdating;
        }
        public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer, IEncryptionManager encryption)
            : base(applicationPaths, xmlSerializer)
        {
            _encryption = encryption;
            Instance    = this;

            /* For dependency injection as MailKit and MimeKit are rather large codebases */
            AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
        }
 public RecommendLeaderService(AppDbContext appDbContext, IOptions <MinIoConfig> minIoConfig, IMapper mapper, IEmailService emailService, IEncryptionManager encryption, IUserIPAddress userIPAddress)
 {
     _appDbContext  = appDbContext;
     _minIoConfig   = minIoConfig.Value;
     _mapper        = mapper;
     _emailService  = emailService;
     _encryptor     = encryption;
     _userIPAddress = userIPAddress;
 }
 public BaseSubProvider(ILogger logger, IHttpClient httpClient, IServerConfigurationManager config, IEncryptionManager encryption, IJsonSerializer json, IFileSystem fileSystem, ILocalizationManager localizationManager)
 {
     _logger              = logger;
     _httpClient          = httpClient;
     _config              = config;
     _encryption          = encryption;
     _json                = json;
     _fileSystem          = fileSystem;
     _localizationManager = localizationManager;
 }
 public FileService(IMapper mapper, FileDbContext fileDbContext, AppDbContext dbContext, IEncryptionManager encryption, IProfilePercentageCalculationService profilePercentageCalculation, MongoDbContext mongoDbContext, IUserIPAddress userIPAddress)
 {
     _mapper        = mapper;
     _fileDbContext = fileDbContext;
     _appDbContext  = dbContext;
     _encryption    = encryption;
     _profilePercentageCalculation = profilePercentageCalculation;
     _mongoDbContext = mongoDbContext;
     _userIPAddress  = userIPAddress;
 }
        public MainWindowViewModel(IUnityContainer container, IFileManager fileManager, ISerializationManager serializationManager, IEncryptionManager encryptionManager, IGoogleDriveCloudManager googleDriveCloudManager, IDataFormRepository dataFormRepository)
        {
            this.container               = container;
            this.fileManager             = fileManager;
            this.serializationManager    = serializationManager;
            this.encryptionManager       = encryptionManager;
            this.googleDriveCloudManager = googleDriveCloudManager;
            this.dataFormRepository      = dataFormRepository;

            PerformViewModelSetup();
        }
Beispiel #31
0
 public Addic7edDownloader(ILogger logger, IHttpClient httpClient, IServerConfigurationManager config, IEncryptionManager encryption, IJsonSerializer json, IFileSystem fileSystem, ILocalizationManager localizationManager)
 {
     _logger              = logger;
     _httpClient          = httpClient;
     _config              = config;
     _encryption          = encryption;
     _json                = json;
     _fileSystem          = fileSystem;
     _localizationManager = localizationManager;
     _config.NamedConfigurationUpdating += _config_NamedConfigurationUpdating;
 }
Beispiel #32
0
        public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer, IEncryptionManager encryption, ILogManager logManager, INotificationManager notificationManager, IJsonSerializer jsonSerializer, IHttpClient httpClient, IChannelManager channelManager)
            : base(applicationPaths, xmlSerializer)
        {
            Instance             = this;
            _encryption          = encryption;
            _logger              = logManager.GetLogger(GetType().Name);
            _notificationManager = notificationManager;
            _channelManager      = channelManager;

            _soundCloudClient = new SoundCloudClient(_logger, jsonSerializer, httpClient);
        }
        public OpenSubtitleDownloader(ILogManager logManager, IHttpClient httpClient, IServerConfigurationManager config, IEncryptionManager encryption)
        {
            _logger = logManager.GetLogger(GetType().Name);
            _httpClient = httpClient;
            _config = config;
            _encryption = encryption;

            _config.NamedConfigurationUpdating += _config_NamedConfigurationUpdating;

            // Reset the count every 24 hours
            _dailyTimer = new Timer(state => _dailyDownloadCount = 0, null, TimeSpan.FromHours(24), TimeSpan.FromHours(24));
        }
Beispiel #34
0
        public OpenSubtitleDownloader(ILogManager logManager, IHttpClient httpClient, IServerConfigurationManager config, IEncryptionManager encryption, IJsonSerializer json)
        {
            _logger = logManager.GetLogger(GetType().Name);
            _httpClient = httpClient;
            _config = config;
            _encryption = encryption;
            _json = json;

            _config.NamedConfigurationUpdating += _config_NamedConfigurationUpdating;

            Utilities.HttpClient = httpClient;
            OpenSubtitles.SetUserAgent("mediabrowser.tv");
        }
        public OpenSubtitleDownloader(ILogManager logManager, IHttpClient httpClient, IServerConfigurationManager config, IEncryptionManager encryption, IJsonSerializer json)
        {
            _logger = logManager.GetLogger(GetType().Name);
            _httpClient = httpClient;
            _config = config;
            _encryption = encryption;
            _json = json;

            _config.NamedConfigurationUpdating += _config_NamedConfigurationUpdating;

            // Reset the count every 24 hours
            _dailyTimer = new Timer(state => _dailyDownloadCount = 0, null, TimeSpan.FromHours(24), TimeSpan.FromHours(24));

            Utilities.HttpClient = httpClient;
            OpenSubtitles.SetUserAgent("mediabrowser.tv");
        }
Beispiel #36
0
        public ConnectManager(ILogger logger,
            IApplicationPaths appPaths,
            IJsonSerializer json,
            IEncryptionManager encryption,
            IHttpClient httpClient,
            IServerApplicationHost appHost,
            IServerConfigurationManager config)
        {
            _logger = logger;
            _appPaths = appPaths;
            _json = json;
            _encryption = encryption;
            _httpClient = httpClient;
            _appHost = appHost;
            _config = config;

            LoadCachedData();
        }
Beispiel #37
0
        public ConnectManager(ILogger logger,
            IApplicationPaths appPaths,
            IJsonSerializer json,
            IEncryptionManager encryption,
            IHttpClient httpClient,
            IServerApplicationHost appHost,
            IServerConfigurationManager config, IUserManager userManager, IProviderManager providerManager, ISecurityManager securityManager, IFileSystem fileSystem)
        {
            _logger = logger;
            _appPaths = appPaths;
            _json = json;
            _encryption = encryption;
            _httpClient = httpClient;
            _appHost = appHost;
            _config = config;
            _userManager = userManager;
            _providerManager = providerManager;
            _securityManager = securityManager;
            _fileSystem = fileSystem;

            _config.ConfigurationUpdated += _config_ConfigurationUpdated;

            LoadCachedData();
        }
 public ServerApiEndpoints(IEncryptionManager encryption)
 {
     _encryption = encryption;
 }