public UsersService(ApplicationDbContext dbContext,
                            IEncrypter encrypter,
                            IUserInfoProvider userInfoProvider,
                            IPolicy <RegisterUserModel> registerUserPolicy,
                            IPolicy <RegisterDomainUserModel> registerDomainUserPolicy,
                            IPolicy <UpdateUserModel> updateUserPolicy,
                            IPolicy <PasswordResetRequestModel> requestPasswordResetPolicy,
                            IPolicy <ResetPasswordModel> resetPasswordPolicy,
                            IPolicy <PasswordModel> passwordPolicy,
                            ICommsService commsService,
                            IConfigurationRoot configurationRoot)
        {
            this.dbContext                  = dbContext;
            this.encrypter                  = encrypter;
            this.userInfoProvider           = userInfoProvider;
            this.registerUserPolicy         = registerUserPolicy;
            this.registerDomainUserPolicy   = registerDomainUserPolicy;
            this.updateUserPolicy           = updateUserPolicy;
            this.requestPasswordResetPolicy = requestPasswordResetPolicy;
            this.passwordPolicy             = passwordPolicy;
            this.resetPasswordPolicy        = resetPasswordPolicy;
            this.commsService               = commsService;
            this.configurationRoot          = configurationRoot;
            this.websiteConfiguration       = new WebsiteConfiguration();

            configurationRoot.GetSection("WebsiteConfiguration").Bind(websiteConfiguration);
        }
 public UserQueryService(IUserRepository userRepository, IMapper mapper, IEncrypter encrypter, ITokenManager tokenManager)
 {
     this.userRepository = userRepository;
     this.mapper         = mapper;
     this.encrypter      = encrypter;
     this.tokenManager   = tokenManager;
 }
Esempio n. 3
0
 public UserService(IUserRepository userRepository, IEncrypter encrypter, IMapper mapper, ILogger <UserService> logger)
 {
     this.encrypter      = encrypter;
     this.mapper         = mapper;
     this.logger         = logger;
     this.userRepository = userRepository;
 }
Esempio n. 4
0
 public ServiceUser(IUserRepository userRepository, IMapper mapper, IEncrypter encrypter, IJwtHandler jwtHandler)
 {
     _userRepository = userRepository;
     _mapper         = mapper;
     _encrypter      = encrypter;
     _jwtHandler     = jwtHandler;
 }
Esempio n. 5
0
 public LoginCommandHandler(DatabaseContext context, IJwtService jwtService, IEncrypter encrypter, IMemoryCache cache)
 {
     this.context    = context;
     this.jwtService = jwtService;
     this.encrypter  = encrypter;
     this.cache      = cache;
 }
Esempio n. 6
0
        public void SetPassword(string password, IEncrypter encrypter)
        {
            if (string.IsNullOrWhiteSpace(password))
            {
                throw new NewException(NewCodes.NullPassword);
            }
            if (password.Length < 8)
            {
                throw new NewException(NewCodes.ShortPassword);
            }
            if (password.Length >= 32)
            {
                throw new NewException(NewCodes.LongPassword);
            }
            if (password == Password)
            {
                throw new Exception();
            }

            string salt = encrypter.GetSalt(password);
            string hash = encrypter.GetHash(password, salt);

            Password = hash;
            Salt     = salt;
        }
Esempio n. 7
0
 public EmployeeService(IEmployeeRepository employeeRepository, IRestaurantRepository restaurantRepository, IMapper mapper, IEncrypter encrypter)
 {
     _employeeRepository   = employeeRepository;
     _restaurantRepository = restaurantRepository;
     _mapper    = mapper;
     _encrypter = encrypter;
 }
 public UserService(IUserRepository <User> repository, IEncrypter encrypter, IJwtHandler jwtHandler, UserManager <User> userManager)
 {
     _jwtHandler     = jwtHandler;
     _userRepository = repository;
     _encrypter      = encrypter;
     _userManager    = userManager;
 }
Esempio n. 9
0
 public TokenService(
     IOptions <JwtSettings> jwtSettings,
     IEncrypter encrypter)
 {
     _jwtSettings = jwtSettings;
     _encrypter   = encrypter;
 }
Esempio n. 10
0
 public AccountService(IJwthandler jwthandler, IUserRepository userRepo, IEncrypter encrypter, ITokenRepository repository)
 {
     _repository = repository;
     _jwthandler = jwthandler;
     _encrypter  = encrypter;
     _userRepo   = userRepo;
 }
Esempio n. 11
0
 public CustomerService(ICustomerRepository customerRepository, IMapper mapper, IEncrypter encrypter, IReservationRepository reservationRepository)
 {
     _customerRepository    = customerRepository;
     _mapper                = mapper;
     _encrypter             = encrypter;
     _reservationRepository = reservationRepository;
 }
Esempio n. 12
0
 public AuthenticationController(ICommandBus commandBus, IQueryBus queryBus,
                                 ILogger <AuthenticationController> logger, IJwtHandler jwtHandler, IEncrypter encrypter)
     : base(commandBus, queryBus, logger)
 {
     _jwtHandler = jwtHandler;
     _encrypter  = encrypter;
 }
 public AdminInitializer(DataContext context, IUnitOfWork unitOfWork, IConfiguration config, IEncrypter encrypter)
 {
     _context    = context;
     _unitOfWork = unitOfWork;
     _config     = config;
     _encrypter  = encrypter;
 }
Esempio n. 14
0
 public UserService(IUserRepository userRepository, IEncrypter encrypter
                    , IJwtHandler jwtHandler)
 {
     this.userRepository = userRepository;
     this.encrypter      = encrypter;
     this.jwtHandler     = jwtHandler;
 }
Esempio n. 15
0
 public LoginUserHandler(IUserRepository userRepository, IEncrypter encrypter, IJwtService jwsService, IMapper mapper)
 {
     this.userRepository = userRepository;
     this.encrypter      = encrypter;
     this.jwsService     = jwsService;
     this.mapper         = mapper;
 }
Esempio n. 16
0
 internal void StartUDP(string Nonce)
 {
     this.SendEncrypter1    = new RC4Encrypter(Nonce: Nonce);
     this.SendEncrypter2    = new RC4Encrypter(Nonce: Nonce);
     this.ReceiveEncrypter1 = new RC4Encrypter(Nonce: Nonce);
     this.ReceiveEncrypter2 = new RC4Encrypter(Nonce: Nonce);
 }
Esempio n. 17
0
 public UserService(GameDBContext context, IEncrypter encrypter, IEmailService emailService, IClanService clanService)
 {
     _context      = context;
     _encrypter    = encrypter;
     _emailService = emailService;
     _clanService  = clanService;
 }
Esempio n. 18
0
        public ISingleSocket StartConnect(IPEndPoint dns, IEncrypter encrypter)
        {
            DummySingleSocket c = new DummySingleSocket();

            connects.Add(new object[] { dns, c });
            return(c);
        }
Esempio n. 19
0
 public UserService(IUserRepository userRepository, IMapper mapper,
                    IEncrypter encrypter)
 {
     _userRepository = userRepository;
     _mapper         = mapper;
     _encrypter      = encrypter;
 }
Esempio n. 20
0
        public void SetPassword(string password, IEncrypter encrypter)
        {
            if (password.Empty())
            {
                throw new DomainException(OperationCodes.InvalidPassword,
                                          "Password can not be empty.");
            }
            if (password.Length < 4)
            {
                throw new DomainException(OperationCodes.InvalidPassword,
                                          "Password must contain at least 4 characters.");
            }
            if (password.Length > 100)
            {
                throw new DomainException(OperationCodes.InvalidPassword,
                                          "Password can not contain more than 100 characters.");
            }

            var salt = encrypter.GetSalt(password);
            var hash = encrypter.GetHash(password, salt);

            Password  = hash;
            Salt      = salt;
            UpdatedAt = DateTime.UtcNow;
        }
Esempio n. 21
0
 public ProfileBusiness(IGeneralRepository general, ISessionProvider session, IEncrypter encrypter, IConfigurationManager config)
 {
     _general   = general;
     _session   = session;
     _encrypter = encrypter;
     _config    = config;
 }
Esempio n. 22
0
 public UserService(IUserRepository repository,
                    IEncrypter encrypter, IJwtHandler jwtHandler)
 {
     _repository = repository;
     _encrypter  = encrypter;
     _jwtHandler = jwtHandler;
 }
Esempio n. 23
0
 public PlayerService(IPlayerRepository playerRepository,
                      IEncrypter encrypter, IMapper mapper)
 {
     _playerRepository = playerRepository;
     _encrypter        = encrypter;
     _mapper           = mapper;
 }
Esempio n. 24
0
 public OwnerService(IOwnerRepository ownerRepository, IRestaurantRepository restaurantRepository, IMapper mapper, IEncrypter encrypter)
 {
     _ownerRepository      = ownerRepository;
     _restaurantRepository = restaurantRepository;
     _mapper    = mapper;
     _encrypter = encrypter;
 }
Esempio n. 25
0
 public BroadcastPoint(IAudioSource audioSource, IEncrypter encrypter, IPAddress ip, int port)
 {
     AudioSource = audioSource;
     Encrypter   = encrypter;
     Ip          = ip;
     Port        = port;
 }
Esempio n. 26
0
        public bool ValidatePassword(string password, IEncrypter encrypter)
        {
            var hashedPassword = encrypter.GetHash(password, Salt);
            var areEqual       = Password.Equals(hashedPassword);

            return(areEqual);
        }
Esempio n. 27
0
        /// <summary>
        /// 开始连接
        /// </summary>
        /// <param name="dns">一个代表远程节点的IPEndPoint</param>
        /// <param name="encrypter">封装连接管理类</param>
        /// <returns>返回一个单套接字</returns>
        public ISingleSocket StartConnect(IPEndPoint dns, IEncrypter encrypter)
        {
            if (encrypter == null)
            {
                encrypter = this.handler;
            }

            Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

            sock.Blocking = false;
            try
            {
                sock.Connect(dns);
            }

            catch
            {
            }

            poll.Register(sock, PollMode.PollIn);
            SingleSocket singleSocket = new SingleSocket(this, sock, encrypter);

            singleSocketDictionary[sock.Handle] = singleSocket;
            return(singleSocket);
        }
Esempio n. 28
0
 public AccessTokenCreator(IContainer container, ITokenStorage tokenStorage, IEncrypter encrypter, IDateHelper dateHelper, IOpenGuid openGuid)
 {
     this.container    = container;
     this.tokenStorage = tokenStorage;
     this.dateHelper   = dateHelper;
     this.openGuid     = openGuid;
     this.encrypter    = encrypter;
 }
Esempio n. 29
0
 public PasswordService(IUserRepository userRepository,
                        IOneTimeSecuredOperationService oneTimeSecuredOperationService,
                        IEncrypter encrypter)
 {
     _userRepository = userRepository.CheckIfNotEmpty();
     _oneTimeSecuredOperationService = oneTimeSecuredOperationService.CheckIfNotEmpty();
     _encrypter = encrypter.CheckIfNotEmpty();
 }
Esempio n. 30
0
 public UserService(IUserRepository userRepository, IEmailSender emailSender, IEncrypter encrypter, IMapper mapper, DataContext context)
 {
     _userRepository = userRepository;
     _encrypter      = encrypter;
     _mapper         = mapper;
     _emailSender    = emailSender;
     _context        = context;
 }
 public AccessTokenCreator(IContainer container, ITokenStorage tokenStorage, IEncrypter encrypter, IDateHelper dateHelper, IOpenGuid openGuid)
 {
     this.container = container;
     this.tokenStorage = tokenStorage;
     this.dateHelper = dateHelper;
     this.openGuid = openGuid;
     this.encrypter = encrypter;
 }
 public DecryptInputIdAttribute(IEncrypter encrypter)
 {
     this.encrypter = encrypter;
 }
 public void Dispose()
 {
     container = null;
     dateHelper = null;
     tokenStorage.Dispose();
     tokenStorage = null;
     openGuid = null;
     encrypter = null;                    
 }
 public EncryptResultIdsAttribute(IEncrypter encrypter)
 {
     this.encrypter = encrypter;
 }
Esempio n. 35
0
 public ApiKeyService(IMongoDatabase database, IEncrypter encrypter, FeatureSettings featureSettings)
 {
     _database = database;
     _encrypter = encrypter;
     _featureSettings = featureSettings;
 }
 public CredentialsProvider(IEncrypter encrypter)
 {
     _encrypter = encrypter;
 }