Ejemplo n.º 1
0
        private const long _fileSizeLeeway = 1024L * 1024L; // 1MB

        public SendService(
            ISendRepository sendRepository,
            IUserRepository userRepository,
            IUserService userService,
            IOrganizationRepository organizationRepository,
            ISendFileStorageService sendFileStorageService,
            IPasswordHasher <User> passwordHasher,
            IPushNotificationService pushService,
            IReferenceEventService referenceEventService,
            GlobalSettings globalSettings,
            IPolicyRepository policyRepository,
            ICurrentContext currentContext)
        {
            _sendRepository         = sendRepository;
            _userRepository         = userRepository;
            _userService            = userService;
            _policyRepository       = policyRepository;
            _organizationRepository = organizationRepository;
            _sendFileStorageService = sendFileStorageService;
            _passwordHasher         = passwordHasher;
            _pushService            = pushService;
            _referenceEventService  = referenceEventService;
            _globalSettings         = globalSettings;
            _currentContext         = currentContext;
        }
Ejemplo n.º 2
0
        public UserServiceTests()
        {
            _userRepository             = Substitute.For <IUserRepository>();
            _cipherRepository           = Substitute.For <ICipherRepository>();
            _organizationUserRepository = Substitute.For <IOrganizationUserRepository>();
            _organizationRepository     = Substitute.For <IOrganizationRepository>();
            _mailService             = Substitute.For <IMailService>();
            _pushService             = Substitute.For <IPushNotificationService>();
            _userStore               = Substitute.For <IUserStore <User> >();
            _optionsAccessor         = Substitute.For <IOptions <IdentityOptions> >();
            _passwordHasher          = Substitute.For <IPasswordHasher <User> >();
            _userValidators          = new List <IUserValidator <User> >();
            _passwordValidators      = new List <IPasswordValidator <User> >();
            _keyNormalizer           = Substitute.For <ILookupNormalizer>();
            _errors                  = new IdentityErrorDescriber();
            _services                = Substitute.For <IServiceProvider>();
            _logger                  = Substitute.For <ILogger <UserManager <User> > >();
            _licenseService          = Substitute.For <ILicensingService>();
            _eventService            = Substitute.For <IEventService>();
            _applicationCacheService = Substitute.For <IApplicationCacheService>();
            _dataProtectionProvider  = Substitute.For <IDataProtectionProvider>();
            _paymentService          = Substitute.For <IPaymentService>();
            _policyRepository        = Substitute.For <IPolicyRepository>();
            _referenceEventService   = Substitute.For <IReferenceEventService>();
            _fido2                  = Substitute.For <IFido2>();
            _currentContext         = new CurrentContext(null);
            _globalSettings         = new GlobalSettings();
            _organizationService    = Substitute.For <IOrganizationService>();
            _providerUserRepository = Substitute.For <IProviderUserRepository>();

            _sut = new UserService(
                _userRepository,
                _cipherRepository,
                _organizationUserRepository,
                _organizationRepository,
                _mailService,
                _pushService,
                _userStore,
                _optionsAccessor,
                _passwordHasher,
                _userValidators,
                _passwordValidators,
                _keyNormalizer,
                _errors,
                _services,
                _logger,
                _licenseService,
                _eventService,
                _applicationCacheService,
                _dataProtectionProvider,
                _paymentService,
                _policyRepository,
                _referenceEventService,
                _fido2,
                _currentContext,
                _globalSettings,
                _organizationService,
                _providerUserRepository
                );
        }
Ejemplo n.º 3
0
 public CipherService(
     ICipherRepository cipherRepository,
     IFolderRepository folderRepository,
     ICollectionRepository collectionRepository,
     IUserRepository userRepository,
     IOrganizationRepository organizationRepository,
     ICollectionCipherRepository collectionCipherRepository,
     IPushNotificationService pushService,
     IAttachmentStorageService attachmentStorageService,
     IEventService eventService,
     IUserService userService,
     IPolicyRepository policyRepository,
     GlobalSettings globalSettings,
     IReferenceEventService referenceEventService)
 {
     _cipherRepository           = cipherRepository;
     _folderRepository           = folderRepository;
     _collectionRepository       = collectionRepository;
     _userRepository             = userRepository;
     _organizationRepository     = organizationRepository;
     _collectionCipherRepository = collectionCipherRepository;
     _pushService = pushService;
     _attachmentStorageService = attachmentStorageService;
     _eventService             = eventService;
     _userService           = userService;
     _policyRepository      = policyRepository;
     _globalSettings        = globalSettings;
     _referenceEventService = referenceEventService;
 }
Ejemplo n.º 4
0
 public StripeController(
     GlobalSettings globalSettings,
     IOptions <BillingSettings> billingSettings,
     IWebHostEnvironment hostingEnvironment,
     IOrganizationService organizationService,
     IOrganizationRepository organizationRepository,
     ITransactionRepository transactionRepository,
     IUserService userService,
     IAppleIapService appleIapService,
     IMailService mailService,
     IReferenceEventService referenceEventService,
     ILogger <StripeController> logger,
     ITaxRateRepository taxRateRepository)
 {
     _billingSettings        = billingSettings?.Value;
     _hostingEnvironment     = hostingEnvironment;
     _organizationService    = organizationService;
     _organizationRepository = organizationRepository;
     _transactionRepository  = transactionRepository;
     _userService            = userService;
     _appleIapService        = appleIapService;
     _mailService            = mailService;
     _referenceEventService  = referenceEventService;
     _taxRateRepository      = taxRateRepository;
     _logger    = logger;
     _btGateway = new Braintree.BraintreeGateway
     {
         Environment = globalSettings.Braintree.Production ?
                       Braintree.Environment.PRODUCTION : Braintree.Environment.SANDBOX,
         MerchantId = globalSettings.Braintree.MerchantId,
         PublicKey  = globalSettings.Braintree.PublicKey,
         PrivateKey = globalSettings.Braintree.PrivateKey
     };
 }
Ejemplo n.º 5
0
 public OrganizationsController(
     IOrganizationRepository organizationRepository,
     IOrganizationUserRepository organizationUserRepository,
     ICipherRepository cipherRepository,
     ICollectionRepository collectionRepository,
     IGroupRepository groupRepository,
     IPolicyRepository policyRepository,
     IPaymentService paymentService,
     IApplicationCacheService applicationCacheService,
     GlobalSettings globalSettings,
     IReferenceEventService referenceEventService,
     IUserService userService)
 {
     _organizationRepository     = organizationRepository;
     _organizationUserRepository = organizationUserRepository;
     _cipherRepository           = cipherRepository;
     _collectionRepository       = collectionRepository;
     _groupRepository            = groupRepository;
     _policyRepository           = policyRepository;
     _paymentService             = paymentService;
     _applicationCacheService    = applicationCacheService;
     _globalSettings             = globalSettings;
     _referenceEventService      = referenceEventService;
     _userService = userService;
 }
Ejemplo n.º 6
0
 public OrganizationsController(
     IOrganizationRepository organizationRepository,
     IOrganizationUserRepository organizationUserRepository,
     IOrganizationConnectionRepository organizationConnectionRepository,
     ISelfHostedSyncSponsorshipsCommand syncSponsorshipsCommand,
     ICipherRepository cipherRepository,
     ICollectionRepository collectionRepository,
     IGroupRepository groupRepository,
     IPolicyRepository policyRepository,
     IPaymentService paymentService,
     ILicensingService licensingService,
     IApplicationCacheService applicationCacheService,
     GlobalSettings globalSettings,
     IReferenceEventService referenceEventService,
     IUserService userService)
 {
     _organizationRepository           = organizationRepository;
     _organizationUserRepository       = organizationUserRepository;
     _organizationConnectionRepository = organizationConnectionRepository;
     _syncSponsorshipsCommand          = syncSponsorshipsCommand;
     _cipherRepository        = cipherRepository;
     _collectionRepository    = collectionRepository;
     _groupRepository         = groupRepository;
     _policyRepository        = policyRepository;
     _paymentService          = paymentService;
     _licensingService        = licensingService;
     _applicationCacheService = applicationCacheService;
     _globalSettings          = globalSettings;
     _referenceEventService   = referenceEventService;
     _userService             = userService;
 }
Ejemplo n.º 7
0
 public UserService(
     IUserRepository userRepository,
     ICipherRepository cipherRepository,
     IOrganizationUserRepository organizationUserRepository,
     IOrganizationRepository organizationRepository,
     IU2fRepository u2fRepository,
     IMailService mailService,
     IPushNotificationService pushService,
     IUserStore <User> store,
     IOptions <IdentityOptions> optionsAccessor,
     IPasswordHasher <User> passwordHasher,
     IEnumerable <IUserValidator <User> > userValidators,
     IEnumerable <IPasswordValidator <User> > passwordValidators,
     ILookupNormalizer keyNormalizer,
     IdentityErrorDescriber errors,
     IServiceProvider services,
     ILogger <UserManager <User> > logger,
     ILicensingService licenseService,
     IEventService eventService,
     IApplicationCacheService applicationCacheService,
     IDataProtectionProvider dataProtectionProvider,
     IPaymentService paymentService,
     IPolicyRepository policyRepository,
     IReferenceEventService referenceEventService,
     CurrentContext currentContext,
     GlobalSettings globalSettings)
     : base(
         store,
         optionsAccessor,
         passwordHasher,
         userValidators,
         passwordValidators,
         keyNormalizer,
         errors,
         services,
         logger)
 {
     _userRepository             = userRepository;
     _cipherRepository           = cipherRepository;
     _organizationUserRepository = organizationUserRepository;
     _organizationRepository     = organizationRepository;
     _u2fRepository                    = u2fRepository;
     _mailService                      = mailService;
     _pushService                      = pushService;
     _identityOptions                  = optionsAccessor?.Value ?? new IdentityOptions();
     _identityErrorDescriber           = errors;
     _passwordHasher                   = passwordHasher;
     _passwordValidators               = passwordValidators;
     _licenseService                   = licenseService;
     _eventService                     = eventService;
     _applicationCacheService          = applicationCacheService;
     _paymentService                   = paymentService;
     _policyRepository                 = policyRepository;
     _organizationServiceDataProtector = dataProtectionProvider.CreateProtector(
         "OrganizationServiceDataProtector");
     _referenceEventService = referenceEventService;
     _currentContext        = currentContext;
     _globalSettings        = globalSettings;
 }
Ejemplo n.º 8
0
 public GroupService(
     IEventService eventService,
     IOrganizationRepository organizationRepository,
     IOrganizationUserRepository organizationUserRepository,
     IGroupRepository groupRepository,
     IReferenceEventService referenceEventService)
 {
     _eventService               = eventService;
     _organizationRepository     = organizationRepository;
     _organizationUserRepository = organizationUserRepository;
     _groupRepository            = groupRepository;
     _referenceEventService      = referenceEventService;
 }
Ejemplo n.º 9
0
 public CollectionService(
     IEventService eventService,
     IOrganizationRepository organizationRepository,
     IOrganizationUserRepository organizationUserRepository,
     ICollectionRepository collectionRepository,
     IUserRepository userRepository,
     IMailService mailService,
     IReferenceEventService referenceEventService)
 {
     _eventService               = eventService;
     _organizationRepository     = organizationRepository;
     _organizationUserRepository = organizationUserRepository;
     _collectionRepository       = collectionRepository;
     _userRepository             = userRepository;
     _mailService           = mailService;
     _referenceEventService = referenceEventService;
 }