public SanityTests() { _petsManagementService = ServiceProvider.Instance.Resolve <IPetsManagementService>(); _petsStatusManagementService = ServiceProvider.Instance.Resolve <IPetsStatusManagementService>(); _newsManagementService = ServiceProvider.Instance.Resolve <INewsManagementService>(); _userManagementService = ServiceProvider.Instance.Resolve <IUsersManagementService>(); _filesManagementService = ServiceProvider.Instance.Resolve <IFilesManagementService>(); _organizationManagementService = ServiceProvider.Instance.Resolve <IOrganizationManagementService>(); _proposalsManagementService = ServiceProvider.Instance.Resolve <IProposalsManagementService>(); _howToHelpInformationService = ServiceProvider.Instance.Resolve <IHowToHelpInformationService>(); _accountManagementService = ServiceProvider.Instance.Resolve <IAccountManagementService>(); _helpersManagementService = ServiceProvider.Instance.Resolve <IHelpersManagementService>(); _commentsManagementService = ServiceProvider.Instance.Resolve <ICommentsManagementService>(); _petsManagementService.RequestUri = RequestUriHelper.PetsUri; _petsStatusManagementService.RequestUri = RequestUriHelper.PetsStatusUri; _newsManagementService.RequestUri = RequestUriHelper.NewsUri; _userManagementService.RequestUri = RequestUriHelper.UsersUri; _organizationManagementService.RequestUri = RequestUriHelper.OrganizationInfoUri; _proposalsManagementService.RequestUri = RequestUriHelper.ProposalsUri; _howToHelpInformationService.BecomeVolunteerUrl = RequestUriHelper.HowToHelpUri; _howToHelpInformationService.DonateInfoUrl = RequestUriHelper.HowToHelpUri; _accountManagementService.RequestUri = RequestUriHelper.JwtTokenUri; _helpersManagementService.RequestUri = RequestUriHelper.HelpersUri; _commentsManagementService.RequestUri = RequestUriHelper.CommentsUri; }
public Reservation(IAccountManagementService accountManagementService, IBandManagementService bandManagementService) { InitializeComponent(); _accountManagementService = accountManagementService; _bandManagementService = bandManagementService; GetAllReservations(); }
public Home(IAccountManagementService accountManagementService, IBandManagementService bandManagementService) { InitializeComponent(); _accountManagementService = accountManagementService; _bandManagementService = bandManagementService; GetAllBands(); }
public RegistrationPresenter( IRegisterView view, IRegistrationService registrationService, ISubjectManagementService subjectManagementService, IClassOfStudentsManagementService classOfStudentsManagementService, IAccountManagementService accountManagementSerivce, IEmailSenderService emailSender, IPasswordGeneratorService passwordService) : base(view) { Guard.WhenArgument(registrationService, "registrationService").IsNull().Throw(); Guard.WhenArgument(subjectManagementService, "subjectManagementService").IsNull().Throw(); Guard.WhenArgument(classOfStudentsManagementService, "classOfStudentsManagementService").IsNull().Throw(); Guard.WhenArgument(accountManagementSerivce, "accountManagementService").IsNull().Throw(); Guard.WhenArgument(emailSender, "emailSender").IsNull().Throw(); Guard.WhenArgument(passwordService, "passwordService").IsNull().Throw(); this.registrationService = registrationService; this.accountManagementSerivce = accountManagementSerivce; this.subjectManagementService = subjectManagementService; this.classOfStudentsManagementService = classOfStudentsManagementService; this.emailSender = emailSender; this.passwordService = passwordService; this.View.EventRegisterUser += this.RegisterUser; this.View.EventGetClassesOfStudents += this.View_EventGetClassesOfStudents; this.View.EventGetUserRoles += this.View_EventGetUserRoles; this.View.EventGetAvailableSubjects += this.View_EventGetAvailableSubjects; }
private void attachUserToContext(HttpContext context, IAccountManagementService AccountManagementServices, string token) { try { var tokenHandler = new JwtSecurityTokenHandler(); var key = Encoding.ASCII.GetBytes(_appSettings.Secret); tokenHandler.ValidateToken(token, new TokenValidationParameters { ValidateIssuerSigningKey = true, IssuerSigningKey = new SymmetricSecurityKey(key), ValidateIssuer = false, ValidateAudience = false, // set clockskew to zero so tokens expire exactly at token expiration time (instead of 5 minutes later) ClockSkew = TimeSpan.Zero }, out SecurityToken validatedToken); var jwtToken = (JwtSecurityToken)validatedToken; var userId = int.Parse(jwtToken.Claims.First(x => x.Type == "id").Value); // attach user to context on successful jwt validation context.Items["User"] = AccountManagementServices.GetById(userId); } catch { // do nothing if jwt validation fails // user is not attached to context so request won't have access to secure routes } }
public AccountManagementController(IAccountManagementService AccountManagement, IOptions <EmailSender> appSettings, IOptions <Default_Url> settings) { _AccountManagementService = AccountManagement; email = appSettings.Value; url = settings.Value; }
public TemporaryCapitalController( IAccountManagementService accountManagementService, IAccuracyService accuracyService) { _accountManagementService = accountManagementService; _accuracyService = accuracyService; }
private AllAccountsInfo ListAllRoles() { using (var scope = WebHost.Services.CreateScope()) { var services = scope.ServiceProvider; manager = services.GetService <IAccountManagementService>(); return(manager.ListAllUsers()); } }
public CleanupExpiredComplexityService(IFeatureManager featureManager, ILog log, AccountManagementSettings settings, IAccountManagementService accountManagementService, IComplexityWarningRepository complexityWarningRepository) { _featureManager = featureManager; _log = log; _settings = settings; _accountManagementService = accountManagementService; _complexityWarningRepository = complexityWarningRepository; }
public FrmClan(IAccountManagementService accountManagementService, IBandMemberManagementService bandMemberManagementService) { InitializeComponent(); _accountManagementService = accountManagementService; _bandMemberManagementService = bandMemberManagementService; GetMembers(); GetAvailableAccounts(); }
private YearApPermissionLevels GetUserRole(string userEmail) { using (var scope = WebHost.Services.CreateScope()) { var services = scope.ServiceProvider; manager = services.GetService <IAccountManagementService>(); return(manager.GetAccountInfoByEmail(userEmail).Role); } }
public NewsManagementTest() { _newsManagementService = ServiceProvider.Instance.Resolve <INewsManagementService>(); _accountManagementService = ServiceProvider.Instance.Resolve <IAccountManagementService>(); _newsManagementService.RequestUri = RequestUriHelper.NewsUri; _accountManagementService.RequestUriJwt = RequestUriHelper.JwtTokenUri; _testingNews = TestingObjectProvider.Instance.News; _token = _accountManagementService.SignIn(TestingObjectProvider.Instance.Login).Result; }
public void ThrowArgumentNulLException_WhenAccountManagementService_IsNull() { // Arrange IAccountManagementService accountManagementService = null; // Act and Assert Assert.That(() => new HomeController(accountManagementService), Throws.ArgumentNullException.With.Message.Contain(nameof(accountManagementService))); }
public ExecutiveSummaryViewModel( ITextTranslator textTranslator, IAccountManagementService accountService, IItemReferences itemReferences) { TextTranslator = textTranslator; AccountService = accountService; ItemReferences = itemReferences; }
public HelpersManagementTests() { _helpersManagementService = ServiceProvider.Instance.Resolve <IHelpersManagementService>(); _accountManagementService = ServiceProvider.Instance.Resolve <IAccountManagementService>(); _helpersManagementService.RequestUri = RequestUriHelper.HelpersUri; _accountManagementService.RequestUri = RequestUriHelper.JwtTokenUri; _testingHelper = TestingObjectProvider.Instance.Helper; _token = _accountManagementService.SignIn(TestingObjectProvider.Instance.Login).Result; }
public PetsStatusManagementTest() { _petsStatusManagementService = ServiceProvider.Instance.Resolve <IPetsStatusManagementService>(); _accountManagementService = ServiceProvider.Instance.Resolve <IAccountManagementService>(); _petsStatusManagementService.RequestUri = RequestUriHelper.PetsStatusUri; _accountManagementService.RequestUri = RequestUriHelper.JwtTokenUri; _testingStatus = TestingObjectProvider.Instance.PetsStatus; _token = _accountManagementService.SignIn(TestingObjectProvider.Instance.Login).Result; }
public OrganizationInfoManagementTest() { _organizationInfoManagementService = ServiceProvider.Instance.Resolve <IOrganizationManagementService>(); _accountManagementService = ServiceProvider.Instance.Resolve <IAccountManagementService>(); _organizationInfoManagementService.RequestUri = RequestUriHelper.OrganizationInfoUri; _accountManagementService.RequestUri = RequestUriHelper.JwtTokenUri; _testingOrganization = TestingObjectProvider.Instance.Organization; _token = _accountManagementService.SignIn(TestingObjectProvider.Instance.Login).Result; }
public CommentsManagementTests() { _commentsManagementService = ServiceProvider.Instance.Resolve <ICommentsManagementService>(); _accountManagementService = ServiceProvider.Instance.Resolve <IAccountManagementService>(); _commentsManagementService.RequestUri = RequestUriHelper.CommentsUri; _accountManagementService.RequestUri = RequestUriHelper.JwtTokenUri; _testingComment = TestingObjectProvider.Instance.Comment; _token = _accountManagementService.SignIn(TestingObjectProvider.Instance.Login).Result; }
public UserManagementTest() { _userManagementService = ServiceProvider.Instance.Resolve <IUsersManagementService>(); _accountManagementService = ServiceProvider.Instance.Resolve <IAccountManagementService>(); _userManagementService.RequestUri = RequestUriHelper.UsersUri; _accountManagementService.RequestUriJwt = RequestUriHelper.JwtTokenUri; _testUser = TestingObjectProvider.Instance.User; _token = _accountManagementService.SignIn(TestingObjectProvider.Instance.Login).Result; }
public ProposalsManagementTests() { _proposalsManagementService = ServiceProvider.Instance.Resolve <IProposalsManagementService>(); _accountManagementService = ServiceProvider.Instance.Resolve <IAccountManagementService>(); _proposalsManagementService.RequestUri = RequestUriHelper.ProposalsUri; _accountManagementService.RequestUriJwt = RequestUriHelper.JwtTokenUri; _testingProposal = TestingObjectProvider.Instance.Proposal; _token = _accountManagementService.SignIn(TestingObjectProvider.Instance.Login).Result; }
public CounterpartyManagementService(EdoContext context, IDateTimeProvider dateTimeProvider, IManagementAuditService managementAuditService, IAccountManagementService accountManagementService) { _context = context; _dateTimeProvider = dateTimeProvider; _managementAuditService = managementAuditService; _accountManagementService = accountManagementService; }
public ITController(IDoctorRepository doctorRepository, IStaffRepository staffRepository, IAccountRepository accountRepository, IAccountManagementService accountManagementService) { _doctorRepository = doctorRepository; _staffRepository = staffRepository; _accountRepository = accountRepository; _accountManagementService = accountManagementService; }
public HotToHelpInfoManagementTests() { _howToHelpInformationService = ServiceProvider.Instance.Resolve <IHowToHelpInformationService>(); _accountManagementService = ServiceProvider.Instance.Resolve <IAccountManagementService>(); _howToHelpInformationService.BecomeVolunteerUrl = RequestUriHelper.OrganizationInfoUri; _howToHelpInformationService.DonateInfoUrl = RequestUriHelper.HowToHelpUri; _accountManagementService.RequestUri = RequestUriHelper.JwtTokenUri; _testingObject = TestingObjectProvider.Instance.HowToHelpInfo; _token = _accountManagementService.SignIn(TestingObjectProvider.Instance.Login).Result; }
public CustomAuthorizationMiddleware(RequestDelegate next, IOptions <AppSettings> appSettings, IHostingEnvironment env, IAuthService cookieService, IAccountManagementService accountManagementService) { _next = next; _appSettings = appSettings.Value; _env = env; _authService = cookieService; _accountManagementService = accountManagementService; _blockedControllers = appSettings.Value.BlockedControllers; }
public async Task Invoke(HttpContext context, IAccountManagementService AccountManagementServices) { var token = context.Request.Headers["Authorization"].FirstOrDefault()?.Split(" ").Last(); if (token != null) { attachUserToContext(context, AccountManagementServices, token); } await _next(context); }
public AgencyVerificationService(EdoContext context, IAccountManagementService accountManagementService, IManagementAuditService managementAuditService, INotificationService notificationService, IDateTimeProvider dateTimeProvider, Services.Agents.IAgentService agentService) { _context = context; _accountManagementService = accountManagementService; _managementAuditService = managementAuditService; _notificationService = notificationService; _dateTimeProvider = dateTimeProvider; _agentService = agentService; }
public DbInitializer( ApplicationDbContext dbContext, IAccountManagementService accountManager, IConfiguration configuration, IEmailService emailService) { _dbContext = dbContext; _configuration = configuration; _accountManager = accountManager; _emailService = emailService; }
public AvatarUploadPresenter( IAvatarUploadView view, IAccountManagementService accountManagementService) : base(view) { Guard.WhenArgument(accountManagementService, "accountManagementService").IsNull().Throw(); this.accountManagementService = accountManagementService; this.View.EventUploadAvatar += this.View_EventUploadAvatar; this.View.EventGetUserAvatar += this.View_EventGetUserAvatar; }
public WithdrawalCommandsHandler( ISystemClock systemClock, IAccountsRepository accountsRepository, IOperationExecutionInfoRepository executionInfoRepository, IChaosKitty chaosKitty, IAccountManagementService accountManagementService) { _systemClock = systemClock; _executionInfoRepository = executionInfoRepository; _accountsRepository = accountsRepository; _chaosKitty = chaosKitty; _accountManagementService = accountManagementService; }
public UsersController( IAccountManagementService accountManagementService, IMappingProvider mappingProvider, IAuthService authService) { Guard.WhenArgument(accountManagementService, nameof(accountManagementService)).IsNull().Throw(); Guard.WhenArgument(mappingProvider, nameof(mappingProvider)).IsNull().Throw(); Guard.WhenArgument(authService, nameof(authService)).IsNull().Throw(); this.accountManagementService = accountManagementService; this.authService = authService; this.mappingProvider = mappingProvider; }
public void Initialize() { managementService = new AccountManagementService(); accountAdministrationService = new AccountAdministrationService(); userInformationServiceMock = _factory.CreateMock<IUserInformationService>(); accountAdministrationDaoMock = _factory.CreateMock<IAccountAdministrationDao>(); authorizationServiceMock = _factory.CreateMock<IAuthorizationService>(); accountAdministrationServiceMock = _factory.CreateMock<IAccountAdministrationService>(); userInformationDaoMock = _factory.CreateMock<IUserInformationDao>(); managementService.UserInformationDao = userInformationDaoMock.MockObject; userInformationService = userInformationServiceMock.MockObject; managementService.UserInformationService = userInformationService; managementService.AccountAdministrationDao = accountAdministrationDaoMock.MockObject; accountAdministrationService.AccountAdministrationDao = accountAdministrationDaoMock.MockObject; managementService.AuthorizationService = authorizationServiceMock.MockObject; managementService.AccountAdministrationService = accountAdministrationServiceMock.MockObject; helper.UserAccountHelper(userAccount); //accountAdministrationService.SaveOrUpdateUser(userAccount); userAccountId = userAccount.Id; }
public AccountController(IAccountManagementService accountManagementService) { _accountManagementService = accountManagementService; }