public SpotifyManagement(IHttpClientFactory httpClientFactory, IConfiguration configuration, ICredentialsRepository credentialsRepository)
 {
     _httpClientFactory     = httpClientFactory;
     _configuration         = configuration;
     _credentialsRepository = credentialsRepository;
     _configs = configuration.GetSection("Connector.Spotify");
 }
Exemplo n.º 2
0
 public AdminController(IRepository repo, IHassService hassService, ICredentialsRepository credentialsRepo)
 {
     _repo            = repo;
     _hassService     = hassService;
     _credentialsRepo = credentialsRepo;
     _entities        = _repo.GetEntities();
 }
Exemplo n.º 3
0
        public async Task QuandOnSeConnecte()
        {
            if (_login == _validLogin)
            {
                _user = new User()
                {
                    Login    = _login,
                    Password = _validPassword,
                    NbTentativesConnexions = _nbTentativesConnexions
                };
            }
            _credentialRepository = AuthenticationUtility.BuildCredentialsRepository(_user);
            var controller =
                new AuthenticationController(
                    new AuthenticationUseCase(
                        AuthenticationUtility.BuildTokenRepository(new DateTime(2049, 05, 17)),
                        _credentialRepository));

            var authenticationDto = new AuthenticationDto()
            {
                Login    = this._login,
                Password = this._password
            };

            this._actual = await controller.ConnectAsync(authenticationDto);
        }
Exemplo n.º 4
0
 public HassService(IConfiguration config, ICredentialsRepository credentialsRepo)
 {
     _configuration   = config;
     _credentialsRepo = credentialsRepo;
     _client          = new HttpClient {
         BaseAddress = new Uri(HassBaseUrl)
     };
 }
Exemplo n.º 5
0
        public IftttConnector(ICredentialsRepository credentialsRepository, IDeviceRepository deviceRepository)
        {
            if (credentialsRepository == null) throw new ArgumentNullException(nameof(credentialsRepository));
            if (deviceRepository == null) throw new ArgumentNullException(nameof(deviceRepository));

            _credentialsRepository = credentialsRepository;
            _deviceRepository = deviceRepository;
        }
Exemplo n.º 6
0
        private string ApiPasswordQuery => $"?api_password={_credentialsRepo.GetHassPassword()}"; //?api_password={password}

        public HassWebSocketService(IRepository repo, SignalRHub hub, IConfiguration config, ICredentialsRepository credentialsRepo)
        {
            _repo            = repo;
            _hub             = hub;
            _configuration   = config;
            _credentialsRepo = credentialsRepo;
            _entities        = _repo.GetEntities();
        }
Exemplo n.º 7
0
 public SlService(IConfiguration config, IRepository repo, ICredentialsRepository credentialsRepo)
 {
     _configuration   = config;
     _repo            = repo;
     _credentialsRepo = credentialsRepo;
     _client          = new HttpClient {
         BaseAddress = new Uri(baseUrl)
     };
 }
Exemplo n.º 8
0
        /// <inheritdoc />
        public SimpleAuthenticateService(ICredentialsRepository userRepository, IConfiguration configuration)
        {
            _userRepository = userRepository ?? throw new ArgumentNullException(nameof(userRepository));

            var configuration1 = configuration ?? throw new ArgumentNullException(nameof(configuration));
            var key            = configuration1["AUTHKEY"];

            _key = Encoding.ASCII.GetBytes(key);
        }
Exemplo n.º 9
0
 public AuthenticationProvider(IGroupRepository groupRepository, IPersonGroupRepository personGroupRepository, ICredentialsRepository credentialsRepository, IPersonRepository personRepository)
 {
     this.groupRepository = groupRepository;
     this.personGroupRepository = personGroupRepository;
     this.credentialsRepository = credentialsRepository;
     this.personRepository = personRepository;
     this.personGroupFactory = new PersonGroupFactory();
     this.credentialsFactory = new CredentialsFactory();
 }
        public ConnectFifthplayViewModel(ICredentialsRepository credentialsRepository, IDeviceConnector deviceConnector)
        {
            if (credentialsRepository == null) throw new ArgumentNullException(nameof(credentialsRepository));
            if (deviceConnector == null) throw new ArgumentNullException(nameof(deviceConnector));

            _credentialsRepository = credentialsRepository;
            _deviceConnector = deviceConnector;

            ConnectCommand = new TransactionalCommandTask(ConnectDevices, CanConnectDevices);
        }
Exemplo n.º 11
0
 public HomeController(ICredentialsRepository credentialsRepository,
                       IRepositoryPersistence repositoryPersistence,
                       IPullRequestRepository pullRequestRepository,
                       ILogger <HomeController> logger)
 {
     _credentialsRepository = credentialsRepository;
     _repositoryPersistence = repositoryPersistence;
     _pullRequestRepository = pullRequestRepository;
     _logger = logger;
 }
Exemplo n.º 12
0
        public ConnectIftttViewModel(ICredentialsRepository credentialsRepository, IIftttConnector iftttConnector)
        {
            if (credentialsRepository == null) throw new ArgumentNullException(nameof(credentialsRepository));
            if (iftttConnector == null) throw new ArgumentNullException(nameof(iftttConnector));

            _credentialsRepository = credentialsRepository;
            _iftttConnector = iftttConnector;

            ConnectCommand = new TransactionalCommandTask(Connect, CanConnect);
        }
Exemplo n.º 13
0
        public ConfigurationHandler(
            ICredentialsRepository credentialsRepository,
            IDisplayService displayService)
        {
            Guard.NotNull(credentialsRepository, nameof(credentialsRepository));
            Guard.NotNull(displayService, nameof(displayService));

            _credentialsRepository = credentialsRepository;
            _displayService        = displayService;
        }
Exemplo n.º 14
0
        public SecurityService(
            ICredentialsRepository credentialsRepository,
            ITesonetClient tesonetClient)
        {
            Guard.NotNull(credentialsRepository, nameof(credentialsRepository));
            Guard.NotNull(tesonetClient, nameof(tesonetClient));

            _credentialsRepository = credentialsRepository;
            _tesonetClient         = tesonetClient;
        }
 public FirstTimeUserExperienceTracker(IApplicationRepository applicationRepository, ILocationRepository locationRepository,
     IDeviceRepository deviceRepository, ICredentialsRepository credentialsRepository, IActionRepository actionRepository, 
     IIftttConnector iftttConnector)
 {
     _applicationRepository = applicationRepository;
     _locationRepository = locationRepository;
     _deviceRepository = deviceRepository;
     _credentialsRepository = credentialsRepository;
     _actionRepository = actionRepository;
     _iftttConnector = iftttConnector;
 }
        public FifthplayDeviceConnector(IFifthplayRepository fifthplayRepository,
            ICredentialsRepository credentialsRepository, IDeviceRepository deviceRepository)
        {
            if (fifthplayRepository == null) throw new ArgumentNullException(nameof(fifthplayRepository));
            if (credentialsRepository == null) throw new ArgumentNullException(nameof(credentialsRepository));
            if (deviceRepository == null) throw new ArgumentNullException(nameof(deviceRepository));

            _fifthplayRepository = fifthplayRepository;
            _credentialsRepository = credentialsRepository;
            _deviceRepository = deviceRepository;
        }
Exemplo n.º 17
0
 public FirstTimeUserExperienceTracker(IApplicationRepository applicationRepository, ILocationRepository locationRepository,
                                       IDeviceRepository deviceRepository, ICredentialsRepository credentialsRepository, IActionRepository actionRepository,
                                       IIftttConnector iftttConnector)
 {
     _applicationRepository = applicationRepository;
     _locationRepository    = locationRepository;
     _deviceRepository      = deviceRepository;
     _credentialsRepository = credentialsRepository;
     _actionRepository      = actionRepository;
     _iftttConnector        = iftttConnector;
 }
Exemplo n.º 18
0
        // Constructors

        public Tray(ISettingsRepository settings, ICredentialsRepository credentials)
        {
            _settings    = settings;
            _credentials = credentials;
            InitTray();
            InitContextMenu();

            Visible = _settings.FlagConfig.AlwaysShowTray;
            _settings.FlagConfig.PropertyChanged += FlagChanged;
            MainWindow.Closing      += WindowIsClosing;
            MainWindow.StateChanged += WindowStateChanged;
        }
Exemplo n.º 19
0
 public RepositoryController(IOrganisationRepository organisationRepository,
                             IRepositoryRepository repositoryRepository,
                             IRepositoryPersistence repositoryPersistence,
                             ICredentialsRepository credentialsRepository,
                             ILogger <RepositoryController> logger)
 {
     _organisationRepository = organisationRepository;
     _repositoryRepository   = repositoryRepository;
     _repositoryPersistence  = repositoryPersistence;
     _credentialsRepository  = credentialsRepository;
     _logger = logger;
 }
Exemplo n.º 20
0
        public MainViewModel(IApplicationRepository applicationRepository, IFunctionalityToggler functionalityToggler, ILogRepository logRepository,
            ILocationRepository locationRepository, IDeviceRepository deviceRepository, ICredentialsRepository credentialsRepository,
            IFirstTimeUserExperienceTracker firstTimeUserExperienceTracker, IActionRepository actionRepository)
        {
            if (applicationRepository == null) throw new ArgumentNullException(nameof(applicationRepository));
            if (functionalityToggler == null) throw new ArgumentNullException(nameof(functionalityToggler));
            if (logRepository == null) throw new ArgumentNullException(nameof(logRepository));
            if (locationRepository == null) throw new ArgumentNullException(nameof(locationRepository));
            if (deviceRepository == null) throw new ArgumentNullException(nameof(deviceRepository));
            if (actionRepository == null) throw new ArgumentNullException(nameof(actionRepository));
            if (credentialsRepository == null) throw new ArgumentNullException(nameof(credentialsRepository));
            if (firstTimeUserExperienceTracker == null) throw new ArgumentNullException(nameof(firstTimeUserExperienceTracker));

            _applicationRepository = applicationRepository;
            _functionalityToggler = functionalityToggler;
            _logRepository = logRepository;
            _locationRepository = locationRepository;
            _deviceRepository = deviceRepository;
            _actionRepository = actionRepository;
            _credentialsRepository = credentialsRepository;
            _firstTimeUserExperienceTracker = firstTimeUserExperienceTracker;

            if (IsInDesignMode)
            {
                IsFirstTimeUserExperience = false;

                Activities = new ObservableCollection<ActivityViewModel>
                {
                    new ActivityViewModel(DateTimeOffset.UtcNow, "Home")
                    {
                        Actions = new List<string> { "switch on Desk lamp", $"Failed to control IFTTT{Environment.NewLine}This is what happened: (NotFound Not Found..." }
                    },
                    new ActivityViewModel(DateTimeOffset.UtcNow.AddDays(-1), "Away")
                    {
                        Actions = new List<string> { "switch off TV", "set to 16°C heating" }
                    },
                    new ActivityViewModel(DateTimeOffset.UtcNow.AddDays(-10), "Home")
                    {
                        Actions = new List<string> { "switch on TV", "set to 16°C heating" }
                    }
                };

                IsFirstTimeUserExperienceHomeStep = true;
            }
            else
            {
                Activities = new ObservableCollection<ActivityViewModel>();
            }

            UpdateFirstTimeUserExperienceCommand = new TransactionalCommandTask(UpdateFirstTimeUserExperience);
            NavigateToSettingsCommand = new RelayCommand(NavigateToSettings);
        }
Exemplo n.º 21
0
        public IftttConnector(ICredentialsRepository credentialsRepository, IDeviceRepository deviceRepository)
        {
            if (credentialsRepository == null)
            {
                throw new ArgumentNullException(nameof(credentialsRepository));
            }
            if (deviceRepository == null)
            {
                throw new ArgumentNullException(nameof(deviceRepository));
            }

            _credentialsRepository = credentialsRepository;
            _deviceRepository      = deviceRepository;
        }
Exemplo n.º 22
0
 public MailCreator(IInputValidator inputValidator,
                    IEmailAddressValidator emailAddressValidator,
                    IMailMessageFactory mailMessageFactory,
                    IMailRepositoryFactory mailRepositoryFactory,
                    IMailSender sender,
                    ICredentialsRepository credentialsRepo)
 {
     _inputValidator        = inputValidator;
     _emailValidator        = emailAddressValidator;
     _mailMessageFactory    = mailMessageFactory;
     _mailRepositoryFactory = mailRepositoryFactory;
     _sender          = sender;
     _credentialsRepo = credentialsRepo;
 }
Exemplo n.º 23
0
        public MainViewModel(ICredentialsRepository credentialsRepository)
        {
            //Messenger.Default.Register<PageOrientationChangedMessage>(this, message =>
            //    {
            //        if (!message.IsPortrait)
            //            _navigationService.NavigateTo(ViewModelLocator.CopyrightPageUri);
            //    });
            Messenger.Default.Register <BattlelogResponseMessage>(this, BattlelogResponseMessageReceived);
            Messenger.Default.Register <SoldierLoadedMessage>(this, SoldierLoadedMessageReceived);
            Messenger.Default.Register <SoldierVisibleMessage>(this, SoldierVisibleMessageReceived);

            LogInCommand          = new RelayCommand(LogInCommandReceived, CanExecuteLogInCommand);
            CredentialsRepository = credentialsRepository;
            LoadCredentials();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="T:CSF.Security.AuthenticationService`2"/> class.
        /// </summary>
        /// <param name="repository">Credentials repository.</param>
        /// <param name="verifier">Credentials verifier.</param>
        public AuthenticationService(ICredentialsRepository <TEnteredCredentials, TStoredCredentials> repository,
                                     ICredentialVerifier <TEnteredCredentials, TStoredCredentials> verifier)
        {
            if (repository == null)
            {
                throw new ArgumentNullException(nameof(repository));
            }
            if (verifier == null)
            {
                throw new ArgumentNullException(nameof(verifier));
            }

            CredentialsRepository = repository;
            CredentialsVerifier   = verifier;
        }
Exemplo n.º 25
0
        public MainViewModel(ICredentialsRepository credentialsRepository)
        {
            //Messenger.Default.Register<PageOrientationChangedMessage>(this, message =>
            //    {
            //        if (!message.IsPortrait)
            //            _navigationService.NavigateTo(ViewModelLocator.CopyrightPageUri);
            //    });
            Messenger.Default.Register<BattlelogResponseMessage>(this, BattlelogResponseMessageReceived);
            Messenger.Default.Register<SoldierLoadedMessage>(this, SoldierLoadedMessageReceived);
            Messenger.Default.Register<SoldierVisibleMessage>(this, SoldierVisibleMessageReceived);

            LogInCommand = new RelayCommand(LogInCommandReceived, CanExecuteLogInCommand);
            CredentialsRepository = credentialsRepository;
            LoadCredentials();
        }
        public ConnectFifthplayViewModel(ICredentialsRepository credentialsRepository, IDeviceConnector deviceConnector)
        {
            if (credentialsRepository == null)
            {
                throw new ArgumentNullException(nameof(credentialsRepository));
            }
            if (deviceConnector == null)
            {
                throw new ArgumentNullException(nameof(deviceConnector));
            }

            _credentialsRepository = credentialsRepository;
            _deviceConnector       = deviceConnector;

            ConnectCommand = new TransactionalCommandTask(ConnectDevices, CanConnectDevices);
        }
Exemplo n.º 27
0
        public ConnectIftttViewModel(ICredentialsRepository credentialsRepository, IIftttConnector iftttConnector)
        {
            if (credentialsRepository == null)
            {
                throw new ArgumentNullException(nameof(credentialsRepository));
            }
            if (iftttConnector == null)
            {
                throw new ArgumentNullException(nameof(iftttConnector));
            }

            _credentialsRepository = credentialsRepository;
            _iftttConnector        = iftttConnector;

            ConnectCommand = new TransactionalCommandTask(Connect, CanConnect);
        }
Exemplo n.º 28
0
 public MiscViewModel(ICredentialsRepository credentialsRepository,
                      IAnimeRepository animeRepository,
                      IAnimeService animeService,
                      IDetailProviderService detailService,
                      IFileService fileService,
                      ISettingsRepository settingsRepository)
 {
     _credentialsRepository = credentialsRepository;
     _animeRepository       = animeRepository;
     _animeService          = animeService;
     _detailService         = detailService;
     _fileService           = fileService;
     _settingsRepository    = settingsRepository;
     SelectedIndex          = 0;
     SubmitCommand          = new RelayCommand(DoAction, () => !DoingAction);
     //
 }
Exemplo n.º 29
0
        public ActionExecutor(ILocationRepository locationRepository, IActionRepository actionRepository, ILogger logger,
            ICredentialsRepository credentialsRepository, IFifthplayRepository fifthplayRepository,
            IIftttRepository iftttRepository)
        {
            if (locationRepository == null) throw new ArgumentNullException(nameof(locationRepository));
            if (actionRepository == null) throw new ArgumentNullException(nameof(actionRepository));
            if (logger == null) throw new ArgumentNullException(nameof(logger));
            if (credentialsRepository == null) throw new ArgumentNullException(nameof(credentialsRepository));
            if (fifthplayRepository == null) throw new ArgumentNullException(nameof(fifthplayRepository));
            if (iftttRepository == null) throw new ArgumentNullException(nameof(iftttRepository));

            _locationRepository = locationRepository;
            _actionRepository = actionRepository;
            _logger = logger;
            _credentialsRepository = credentialsRepository;
            _fifthplayRepository = fifthplayRepository;
            _iftttRepository = iftttRepository;
        }
Exemplo n.º 30
0
        public SettingsViewModel(ISettingsRepository settings, ICredentialsRepository credentials)
        {
            _credentials = credentials;
            Settings     = settings;
            Subgroups    = string.Join(", ", Settings.Subgroups);

            TrayToggleCommand = new RelayCommand(() => { });
            SaveCommand       = new RelayCommand(() =>
            {
                Settings.Subgroups = Regex.Split(Subgroups, ", ").ToList();
                Settings.Save();
                ChangeMade = false;
            });

            Credentials.MyAnimeListConfig.PropertyChanged    += Model_PropertyChanged;
            Credentials.AniListConfiguration.PropertyChanged += Model_PropertyChanged;
            Settings.FlagConfig.PropertyChanged += Model_PropertyChanged;
            Settings.PathConfig.PropertyChanged += Model_PropertyChanged;
        }
        public FifthplayDeviceConnector(IFifthplayRepository fifthplayRepository,
                                        ICredentialsRepository credentialsRepository, IDeviceRepository deviceRepository)
        {
            if (fifthplayRepository == null)
            {
                throw new ArgumentNullException(nameof(fifthplayRepository));
            }
            if (credentialsRepository == null)
            {
                throw new ArgumentNullException(nameof(credentialsRepository));
            }
            if (deviceRepository == null)
            {
                throw new ArgumentNullException(nameof(deviceRepository));
            }

            _fifthplayRepository   = fifthplayRepository;
            _credentialsRepository = credentialsRepository;
            _deviceRepository      = deviceRepository;
        }
Exemplo n.º 32
0
        public WebViewModel(ICredentialsRepository credentialsRepository,
                            IAnimeRepository animeRepository,
                            IAnimeService animeService,
                            ISyncProviderService syncService,
                            IMyAnimeListApi api,
                            IDownloadService downloadService)
        {
            DownloadService        = downloadService;
            _credentialsRepository = credentialsRepository;
            _animeRepository       = animeRepository;
            _animeService          = animeService;
            _syncService           = syncService;
            _api = api;

            //

            SetCommands();
            CheckSyncAndLog();

            MessengerInstance.Register <Request>(this, HandleRequest);
            MessengerInstance.Register <ViewRequest>(this, HandleViewAction);
        }
Exemplo n.º 33
0
        public ActionExecutor(ILocationRepository locationRepository, IActionRepository actionRepository, ILogger logger,
                              ICredentialsRepository credentialsRepository, IFifthplayRepository fifthplayRepository,
                              IIftttRepository iftttRepository)
        {
            if (locationRepository == null)
            {
                throw new ArgumentNullException(nameof(locationRepository));
            }
            if (actionRepository == null)
            {
                throw new ArgumentNullException(nameof(actionRepository));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }
            if (credentialsRepository == null)
            {
                throw new ArgumentNullException(nameof(credentialsRepository));
            }
            if (fifthplayRepository == null)
            {
                throw new ArgumentNullException(nameof(fifthplayRepository));
            }
            if (iftttRepository == null)
            {
                throw new ArgumentNullException(nameof(iftttRepository));
            }

            _locationRepository    = locationRepository;
            _actionRepository      = actionRepository;
            _logger                = logger;
            _credentialsRepository = credentialsRepository;
            _fifthplayRepository   = fifthplayRepository;
            _iftttRepository       = iftttRepository;
        }
        //

        public MyAnimeListInternalApi(ICredentialsRepository credentialsRepository, IDetailProviderService detailProvider)
        {
            _credentialsRepository = credentialsRepository;
            _detailProvider        = detailProvider;

            // Remove any api details on any changes to login credentials
            _credentialsRepository.MyAnimeListConfig.PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == "Username" || args.PropertyName == "Password")
                {
                    _credentialsRepository.MyAnimeListConfig.Credentials = new ApiCredentials();
                    _credentialsRepository.Save();
                    _clientReady = false;
                }
            };

            _client = new HttpClient(new HttpClientHandler
            {
                UseCookies             = false,
                AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate
            });

            _credentials = _credentialsRepository.MyAnimeListConfig.Credentials;
        }
Exemplo n.º 35
0
 public CrendentialsApiController(ICredentialsRepository repository)
 {
     _repository = repository;
 }
Exemplo n.º 36
0
 public SmtpClientFactory(INetworkCredentialsFactory networkCredentialsFactory, ICredentialsRepository credentialsRepo)
 {
     _networkCredentialsFactory = networkCredentialsFactory;
     _credentialsRepo           = credentialsRepo;
 }
 public NetworkCredentialsFactory(ICredentialsRepository credentialsRepo)
 {
     _credentialsRepo = credentialsRepo;
 }
Exemplo n.º 38
0
 public AuthenticationUseCase(ITokenRepository tokenRepository, ICredentialsRepository credentialsRepository)
 {
     _tokenRepository       = tokenRepository;
     _credentialsRepository = credentialsRepository;
 }
Exemplo n.º 39
0
 public HomeController(ICredentialsRepository repo, IRepository ctx)
 {
     repository = repo;
     context    = ctx;
 }
Exemplo n.º 40
0
 public TimeLineService(ICredentialsRepository credentialsRepository, IConfiguration configuration)
 {
     this.credentialsRepository = credentialsRepository;
     _configuration = configuration;
 }
Exemplo n.º 41
0
 public CredentialService(ICredentialsRepository credentialsRepository)
 {
     this.credentialsRepository = credentialsRepository;
 }
Exemplo n.º 42
0
		public CredentialsManager(ICredentialsRepository credentialsRepository, IEncrypterator encrypterator)
		{
			_credentialsRepository = DIHelper.VerifyParameter(credentialsRepository);
			_encrypterator = DIHelper.VerifyParameter(encrypterator);
		}
Exemplo n.º 43
0
 public CredentialsService(ICredentialsRepository credentialsRepository)
 {
     _credentialsRepository = credentialsRepository;
 }