private HashedByteIdGenerator GetSut(IFastHasher hasher = null, ISafeRandom random = null, IMemoryProtectedBytes sessionSalt = null) { if (hasher == null) { var mockHasher = new Mock <IFastHasher>(); mockHasher.Setup(m => m.ComputeFast(It.IsAny <byte[]>())) #if !(NETCOREAPP3_1 || NETCOREAPP3_0) .Returns((byte[] b) => b[b.Length - 1]);
private HashedByteIdGenerator GetSut(IFastHasher hasher = null, ISafeRandom random = null, IByteArrayProtector protector = null) { if (hasher == null) { var mockHasher = new Mock <IFastHasher>(); mockHasher.Setup(m => m.ComputeFast(It.IsAny <byte[]>())).Returns((byte[] b) => b[b.Length - 1]); hasher = mockHasher.Object; } return(new HashedByteIdGenerator(hasher, random ?? Stubs.Get <ISafeRandom>(), protector ?? Mock.Of <IByteArrayProtector>())); }
public PathProvider(IFastHasher hasher, IOptions <AppSetting> options) { _hasher = hasher; _appSetting = options.Value; if (_appSetting.ApiBaseUrl.EndsWith("/")) { _appSetting.ApiBaseUrl = _appSetting.ApiBaseUrl.Substring(0, _appSetting.ApiBaseUrl.Length - 1); } }
internal HashedByteIdGenerator(IFastHasher fastHasher, ISafeRandom safeRandom, IMemoryProtectedBytes sessionSalt) { if (sessionSalt == null) { throw new ArgumentNullException(nameof(sessionSalt)); } _fastHasher = fastHasher ?? throw new ArgumentNullException(nameof(fastHasher)); _safeRandom = safeRandom ?? throw new ArgumentNullException(nameof(safeRandom)); _sessionSalt = new AsyncLazy <IMemoryProtectedBytes>(() => InitializeSaltAsync(sessionSalt)); }
public AppAuthService(IEntityService <UserAccount> entityService, IEntityService <RealEstate> estateEntityService, IOptions <AuthSetting> authOptions, IOptions <AppSetting> appOptions, IPasswordService passwordService, IFastHasher hasher, IUserGroupProvider groupProvider) { _entityService = entityService; _estateEntityService = estateEntityService; _passwordService = passwordService; _hasher = hasher; _groupProvider = groupProvider; _authSetting = authOptions.Value; _appSetting = appOptions.Value; }
public UserAccountController(IModelService <UserAccount, UserAccountDto> modelService, IUserProvider userProvider, IUserGroupProvider groupProvider, IFastHasher fastHasher, IUploadHelperService uploadHelperService, IPathProvider pathProvider) : base(modelService) { _userProvider = userProvider; _uploadHelperService = uploadHelperService; _pathProvider = pathProvider; _fastHasher = fastHasher; _groupProvider = groupProvider; var administratorGroupId = groupProvider[UserGroup.Administrator].Id; modelService.SetBaseFilter(i => i.Where(u => u.IsActive == true && u.UserAccountGroup.FirstOrDefault(g => g.UserAccountId == u.Id).UserGroupId != administratorGroupId)); }
public AgentController(IModelService <Agent, AgentDto> modelService, IEntityService <UserAccount> userAccountService, IEntityService <Agent> agentService, IFastHasher fastHasher, IUserProvider userProvider, IPasswordService passwordService, IPathProvider pathProvider) : base(modelService) { _userAccountService = userAccountService; _agentService = agentService; _fastHasher = fastHasher; _userProvider = userProvider; _passwordService = passwordService; _pathProvider = pathProvider; modelService.SetBaseFilter(filter => filter.Where(a => a.RealEstateId == _userProvider.RealEstateId && !a.Deleted && a.UserAccount.IsActive != false)); }
public RequestController(IModelService <Request, RequestDto> modelService, IFastHasher hasher, IUserProvider userProvider, IEntityService <RequestState> requestStateService, IEntityService <RequestAgent> requestAgentService, IEntityService <Property> propertyService, IEntityService <Workflow> workflowService, IEntityService <WorkflowStep> workflowStepService, IUpdateSignaler signaler, IEntityService <UserAccount> userAccountService) : base(modelService) { _hasher = hasher; _userProvider = userProvider; _requestStateService = requestStateService; _requestAgentService = requestAgentService; _propertyService = propertyService; _workflowService = workflowService; _workflowStepService = workflowStepService; _signaler = signaler; _userAccountService = userAccountService; }
internal HashedByteIdGenerator(IFastHasher fastHasher, ISafeRandom safeRandom, IByteArrayProtector memoryProtector) { if (fastHasher == null) { throw new ArgumentNullException(nameof(fastHasher)); } if (safeRandom == null) { throw new ArgumentNullException(nameof(safeRandom)); } if (memoryProtector == null) { throw new ArgumentNullException(nameof(memoryProtector)); } _fastHasher = fastHasher; _safeRandom = safeRandom; _memoryProtector = memoryProtector; }
internal StateStamper(ISerializer serializer, IFastHasher fastHasher) : base(fastHasher) { _serializer = serializer; }
protected StamperBase(IFastHasher fastHasher) { _fastHasher = fastHasher; }
internal IlCodeStamper(IFastHasher fastHasher) : base(fastHasher) { }
public UploadHelperService(IFileService fileService, IImageService imageService, IFastHasher hasher) { _hasher = hasher; FileService = fileService; ImageService = imageService; }