예제 #1
0
 public TokenController(OmbiUserManager um, IOptions <TokenAuthentication> ta, IAuditRepository audit, ITokenRepository token)
 {
     _userManager = um;
     _tokenAuthenticationOptions = ta.Value;
     _audit = audit;
     _token = token;
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AuditFactory"/> class.
 /// </summary>
 /// <param name="auditRepository">The audit repository.</param>
 /// <param name="lookupValueRepository">The lookup value repository.</param>
 public AuditFactory(
     IAuditRepository auditRepository,
     ILookupValueRepository lookupValueRepository)
 {
     _auditRepository       = auditRepository;
     _lookupValueRepository = lookupValueRepository;
 }
예제 #3
0
 public AuditHelper(
     IJsonHelper jsonHelper,
     IAuditRepository auditRepository)
 {
     this.jsonHelper      = jsonHelper;
     this.auditRepository = auditRepository;
 }
예제 #4
0
 public DataTypeService(
     IDataValueEditorFactory dataValueEditorFactory,
     ICoreScopeProvider provider,
     ILoggerFactory loggerFactory,
     IEventMessagesFactory eventMessagesFactory,
     IDataTypeRepository dataTypeRepository,
     IDataTypeContainerRepository dataTypeContainerRepository,
     IAuditRepository auditRepository,
     IEntityRepository entityRepository,
     IContentTypeRepository contentTypeRepository,
     IIOHelper ioHelper,
     ILocalizedTextService localizedTextService,
     ILocalizationService localizationService,
     IShortStringHelper shortStringHelper,
     IJsonSerializer jsonSerializer,
     IEditorConfigurationParser editorConfigurationParser)
     : base(provider, loggerFactory, eventMessagesFactory)
 {
     _dataValueEditorFactory      = dataValueEditorFactory;
     _dataTypeRepository          = dataTypeRepository;
     _dataTypeContainerRepository = dataTypeContainerRepository;
     _auditRepository             = auditRepository;
     _entityRepository            = entityRepository;
     _contentTypeRepository       = contentTypeRepository;
     _ioHelper                  = ioHelper;
     _localizedTextService      = localizedTextService;
     _localizationService       = localizationService;
     _shortStringHelper         = shortStringHelper;
     _jsonSerializer            = jsonSerializer;
     _editorConfigurationParser = editorConfigurationParser;
 }
예제 #5
0
 public MemberTypeService(IScopeProvider provider, ILogger logger, IEventMessagesFactory eventMessagesFactory, IMemberService memberService,
                          IMemberTypeRepository memberTypeRepository, IAuditRepository auditRepository, IEntityRepository entityRepository)
     : base(provider, logger, eventMessagesFactory, memberTypeRepository, auditRepository, null, entityRepository)
 {
     MemberService         = memberService;
     _memberTypeRepository = memberTypeRepository;
 }
        public DbPatientRepository( ApplicationDbContext db,
                                    IAuditRepository auditRepo )
        {
            _db = db;
            _auditRepo = auditRepo;

        } // Injection Constructor
예제 #7
0
 public DeleteAuditUseCase(IWorkflowCore workflowCore, IAuditRepository auditRepository, IEmailSender emailSender, ISectorPlantRepository sectorPlantRepository)
 {
     _workflowCore          = workflowCore;
     _auditRepository       = auditRepository;
     _emailSender           = emailSender;
     _sectorPlantRepository = sectorPlantRepository;
 }
예제 #8
0
 public ActivateUserStrategy(IUserReadRepository userReadRepository, IUserWriteRepository userWriteRepository, IAuditRepository auditRepository, IServiceBus serviceBus)
 {
     _userReadRepository  = userReadRepository;
     _userWriteRepository = userWriteRepository;
     _auditRepository     = auditRepository;
     _serviceBus          = serviceBus;
 }
예제 #9
0
        public DbGlucoseEntriesRepository( ApplicationDbContext db,
                                    IAuditRepository auditRepo )
        {
            _db = db;
            _auditRepo = auditRepo;

        } // Injection Constructor
예제 #10
0
 public AuditController(IAuditRepository repo, IHttpContextAccessor httpContextAccessor)
 {
     Repo            = repo;
     ContextAccessor = httpContextAccessor;
     RequestUser     = ContextAccessor.HttpContext != null && ContextAccessor.HttpContext.User.Identity.IsAuthenticated ?
                       ContextAccessor.HttpContext.User.Identity.Name : "UnAuthenticated";
 }
예제 #11
0
 public DeploymentController(IApplicationRepository applicationRepository, IDeploymentRepository deploymentRepository, IApplicationHashingService applicationHashingService, IAuditRepository auditRepository)
 {
     this.applicationRepository     = applicationRepository;
     this.deploymentRepository      = deploymentRepository;
     this.applicationHashingService = applicationHashingService;
     this.auditRepository           = auditRepository;
 }
 public SettingsController(ISettingsRepository settingsRepository, IAuditRepository auditRepository, IErrorRepository errorRepository, IHeartbeatRepository heartbeatRepository)
 {
     _settingsRepository  = settingsRepository;
     _auditRepository     = auditRepository;
     _errorRepository     = errorRepository;
     _heartbeatRepository = heartbeatRepository;
 }
예제 #13
0
 public MediaTypeService(IScopeProvider provider, ILogger logger, IEventMessagesFactory eventMessagesFactory, IMediaService mediaService,
                         IMediaTypeRepository mediaTypeRepository, IAuditRepository auditRepository, IMediaTypeContainerRepository entityContainerRepository,
                         IEntityRepository entityRepository)
     : base(provider, logger, eventMessagesFactory, mediaTypeRepository, auditRepository, entityContainerRepository, entityRepository)
 {
     MediaService = mediaService;
 }
예제 #14
0
 public void Setup()
 {
     _testmarkRepository  = new MarkRepository();
     _testAuditRepository = new AuditRepository();
     _testMarkService     = new MarkService(_testmarkRepository);
     _testAuditService    = new AuditService(_testAuditRepository);
 }
예제 #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AuditFactory"/> class.
 /// </summary>
 /// <param name="auditRepository">The audit repository.</param>
 /// <param name="lookupValueRepository">The lookup value repository.</param>
 public AuditFactory(
     IAuditRepository auditRepository,
     ILookupValueRepository lookupValueRepository )
 {
     _auditRepository = auditRepository;
     _lookupValueRepository = lookupValueRepository;
 }
        public DbExerciseEntryRepository( ApplicationDbContext db,
                                    IAuditRepository auditRepo )
        {
            _db = db;
            _auditRepo = auditRepo;

        } // Injection Constructor
 public MemberTypeService(ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, IMemberService memberService,
                          IMemberTypeRepository memberTypeRepository, IAuditRepository auditRepository, IMemberTypeContainerRepository entityContainerRepository, IEntityRepository entityRepository, IEventAggregator eventAggregator)
     : base(provider, loggerFactory, eventMessagesFactory, memberTypeRepository, auditRepository, entityContainerRepository, entityRepository, eventAggregator)
 {
     MemberService         = memberService;
     _memberTypeRepository = memberTypeRepository;
 }
예제 #18
0
 public ContentTypeService(IScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory, IContentService contentService,
                           IContentTypeRepository repository, IAuditRepository auditRepository, IDocumentTypeContainerRepository entityContainerRepository, IEntityRepository entityRepository,
                           IEventAggregator eventAggregator)
     : base(provider, loggerFactory, eventMessagesFactory, repository, auditRepository, entityContainerRepository, entityRepository, eventAggregator)
 {
     ContentService = contentService;
 }
예제 #19
0
 public VerifyMobileStrategy(ICandidateReadRepository candidateReadRepository, ICandidateWriteRepository candidateWriteRepository, IAuditRepository auditRepository, IServiceBus serviceBus)
 {
     _candidateReadRepository  = candidateReadRepository;
     _candidateWriteRepository = candidateWriteRepository;
     _auditRepository          = auditRepository;
     _serviceBus = serviceBus;
 }
예제 #20
0
 public FileService(
     ICoreScopeProvider uowProvider,
     ILoggerFactory loggerFactory,
     IEventMessagesFactory eventMessagesFactory,
     IStylesheetRepository stylesheetRepository,
     IScriptRepository scriptRepository,
     ITemplateRepository templateRepository,
     IPartialViewRepository partialViewRepository,
     IPartialViewMacroRepository partialViewMacroRepository,
     IAuditRepository auditRepository,
     IShortStringHelper shortStringHelper,
     IOptions <GlobalSettings> globalSettings,
     IHostingEnvironment hostingEnvironment)
     : base(uowProvider, loggerFactory, eventMessagesFactory)
 {
     _stylesheetRepository       = stylesheetRepository;
     _scriptRepository           = scriptRepository;
     _templateRepository         = templateRepository;
     _partialViewRepository      = partialViewRepository;
     _partialViewMacroRepository = partialViewMacroRepository;
     _auditRepository            = auditRepository;
     _shortStringHelper          = shortStringHelper;
     _globalSettings             = globalSettings.Value;
     _hostingEnvironment         = hostingEnvironment;
 }
예제 #21
0
        public ApiBootstrapper(IAuditRepository repository)
        {
            if(repository == null)
                throw new ArgumentNullException("repository");

            _repository = repository;
        }
 public DeploymentController(IApplicationRepository applicationRepository, IDeploymentRepository deploymentRepository, IApplicationHashingService applicationHashingService, IAuditRepository auditRepository)
 {
     this.applicationRepository = applicationRepository;
     this.deploymentRepository = deploymentRepository;
     this.applicationHashingService = applicationHashingService;
     this.auditRepository = auditRepository;
 }
예제 #23
0
 public MacroService(IScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory,
                     IMacroRepository macroRepository, IAuditRepository auditRepository)
     : base(provider, loggerFactory, eventMessagesFactory)
 {
     _macroRepository = macroRepository;
     _auditRepository = auditRepository;
 }
예제 #24
0
 public AuditService(IStateService stateService, IDiffService diffService, IAuditRepository auditRepository)
 {
     _stateService    = stateService;
     _diffService     = diffService;
     _auditRepository = auditRepository;
     _trackedItems    = new List <TrackedItem>();
 }
예제 #25
0
 private DBContext()
 {
     _accounts           = new AccountRepository();
     _accountTypes       = new AccountTypeRepository();
     _audits             = new AuditRepository();
     _categories         = new CategoryRepository();
     _containers         = new ContainerRepository();
     _dimensions         = new DimensionRepository();
     _facilities         = new FacilityRepository();
     _facilityTypes      = new FacilityTypeRepository();
     _priorities         = new PriorityRepository();
     _users              = new UserRepository();
     _packagingLevels    = new PackagingLevelRepository();
     _pictures           = new PictureRepository();
     _projects           = new ProjectRepository();
     _ratings            = new RatingRepository();
     _requests           = new RequestRepository();
     _requestItems       = new RequestItemRepository();
     _requestItemTypes   = new RequestItemTypeRepository();
     _roles              = new RoleRepository();
     _sources            = new SourceRepository();
     _status             = new StatusRepository();
     _status             = new StatusRepository();
     _tasks              = new TaskRespository();
     _dcIssueItems       = new DCIssueItemRepository();
     _dcIssues           = new DCIssueRepository();
     _dcIssuesFacilities = new DCIssueFacilityRepository();
     _failedSamples      = new FailedSampleRepository();
     _requestCategories  = new RequestCategoryRepository();
 }
예제 #26
0
파일: NewKeeper.cs 프로젝트: mgladilov/Cas
 public NewKeeper(CasEnvironment casEnvironment, IAuditRepository auditRepository)
 {
     _casEnvironment  = casEnvironment;
     _auditRepository = auditRepository;
     _filesSmartCore  = new FilesSmartCore(_casEnvironment);
     _apiProvider     = casEnvironment.ApiProvider;
 }
 public DbDeveloperRepository(ApplicationDbContext db,
                              IAuditRepository auditRepository,
                              IApplicationUserRepository userRepo)
 {
     _db       = db;
     _userRepo = userRepo;
 } // constructor
예제 #28
0
 public ClientAreaController(IAuditRepository auditRepository, IPurchaseOrderRepository purchaseOrderRepository, IChatModelRepository chatModelRepository, UserManager <ApplicationUser> userManager, IUserRepository userRolesRepository)
 {
     AuditRepository         = auditRepository;
     PurchaseOrderRepository = purchaseOrderRepository;
     ChatModelRepository     = chatModelRepository;
     _userManager            = userManager;
     UserRepository          = userRolesRepository;
 }
예제 #29
0
        public void Setup()
        {
            var mockConfig = new Mock <IAppConfiguration>();

            mockConfig.Setup <string>(p => p.GetString("ConnectionStrings:ActionAudit"))
            .Returns("Server=(localdb)\\mssqllocaldb;Database=dbActionAudit;Trusted_Connection=True;MultipleActiveResultSets=true");
            repository = new AuditRepository(mockConfig.Object);
        }
 public SetPendingDeletionStrategy(IConfigurationService configurationService, IUserWriteRepository userWriteRepository, IAuditRepository auditRepository, ILogService logService, IServiceBus serviceBus)
     : base(configurationService)
 {
     _userWriteRepository = userWriteRepository;
     _auditRepository     = auditRepository;
     _logService          = logService;
     _serviceBus          = serviceBus;
 }
 public LocalizationService(IScopeProvider provider, ILogger logger, IEventMessagesFactory eventMessagesFactory,
                            IDictionaryRepository dictionaryRepository, IAuditRepository auditRepository, ILanguageRepository languageRepository)
     : base(provider, logger, eventMessagesFactory)
 {
     _dictionaryRepository = dictionaryRepository;
     _auditRepository      = auditRepository;
     _languageRepository   = languageRepository;
 }
예제 #32
0
 public AuditServices(IAuditRepository auditRepository)
 {
     if (auditRepository == null)
     {
         throw new ArgumentNullException("AuditRepository");
     }
     _AuditRepository = auditRepository;
 }
예제 #33
0
 public DbApplicationUserRepository(ApplicationDbContext db,
                                    IAuditRepository auditRepo,
                                    UserManager <ApplicationUser> userManager)
 {
     _db          = db;
     _auditRepo   = auditRepo;
     _userManager = userManager;
 } // constructor
예제 #34
0
        public TransactionMonitorWorker(string instanceId, IMessageReceiver messageReceiver, IAuditRepository repository)
            : base(instanceId, messageReceiver)
        {
            if(repository == null)
                throw new ArgumentNullException("repository");

            _repository = repository;
            _deserializer = new TransactionEventConverter();
        }
예제 #35
0
        public NancyHostLauncherWorker(string instanceId, Uri baseUri, IAuditRepository repository)
        {
            if(instanceId == null)
                throw new ArgumentNullException("instanceId");
            if(baseUri == null)
                throw new ArgumentNullException("baseUri");
            if (repository == null)
                throw new ArgumentNullException("repository");

            InstanceId = instanceId;
            _baseUri = baseUri;
            _repository = repository;
        }
예제 #36
0
        public AuditManager(IApplicationHashingService hashingService, IAuditRepository auditRepository,
            IDeploymentRepository deploymentRepository, IApplicationRepository applicationRepository, IMailService mailService)
        {
            this.hashingService = hashingService ?? DIContainer.Container.GetInstance<IApplicationHashingService>();
            this.auditRepository = auditRepository ?? DIContainer.Container.GetInstance<IAuditRepository>();
            this.deploymentRepository = deploymentRepository ?? DIContainer.Container.GetInstance<IDeploymentRepository>();
            this.applicationRepository = applicationRepository ?? DIContainer.Container.GetInstance<IApplicationRepository>();
            this.mailService = mailService ?? DIContainer.Container.GetInstance<IMailService>();

            var seconds = Configuration.AuditTimerInSeconds;
            if (seconds > 59)
            {
                timer = new Timer(seconds * 1000);
                timer.Elapsed += Timer_Elapsed;
            }
        }
예제 #37
0
        public AuditViewModel(IAuditRepository repo, IUserNotify notify)
        {
            this.repo = repo;
            this.notify = notify;

            try
            {
                UsersList = repo.AuditLogRepo.GetAllUsers();
                searchCommand = ViewModelSource.Create(() => new AuditSearchCommand(this, repo.AuditLogRepo, notify));
            }
            catch(RepositoryException ex)
            {
                log.Warn("AuditViewModel " + ex.ToString());
                notify.ShowWarning(Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Message),
            Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Header));
            }

        }
        protected override void InitializeService()
        {
            _workerCount = Int32.Parse(ConfigurationManager.AppSettings["WorkerCount"]);
            _apiEndpoint = new Uri(ConfigurationManager.AppSettings["ApiRoot"]);

            string databaseToUse = ConfigurationManager.AppSettings["UseDatabase"];

            if (String.Equals("MongoDB", databaseToUse))
            {
                string connnectionString = ConfigurationManager.ConnectionStrings["MongoAuditDB"].ConnectionString;
                string collectionName = ConfigurationManager.AppSettings["EventCollectionName"];
                _repository = new MongoDbAuditRepository(connnectionString, collectionName);
            }
            else if (String.Equals("Postgres", databaseToUse))
            {
                string connectionString = ConfigurationManager.ConnectionStrings["PostgresAuditDB"].ConnectionString;
                _repository = new PostgresAuditRepository(connectionString);
            }
            else
            {
                throw new ConfigurationErrorsException("Invalid database type.");
            }
        }
예제 #39
0
 public AuditService(IAuditRepository auditRepository)
 {
     _auditRepository = auditRepository;
 }
예제 #40
0
        public AuditModule(IAuditRepository repository) : base("/audit")
        {
            _repository = repository;
            _hostName = ConfigurationManager.AppSettings["ApiRoot"];

            Get["/transactions"] = parameters =>
            {
                var startTimeParam = (string)Request.Query["start"];
                var endTimeParam = (string)Request.Query["end"];
                DateTime startTime;
                DateTime endTime;

                try
                {
                    startTime = String.IsNullOrWhiteSpace(startTimeParam)
                        ? DateTime.MinValue
                        : Convert.ToDateTime(startTimeParam);
                }
                catch (FormatException)
                {
                    return new Response
                    {
                        StatusCode = HttpStatusCode.BadRequest,
                        ReasonPhrase = "Parameter \"start\" is not of a valid format."
                    };
                }

                try
                {
                    endTime = String.IsNullOrWhiteSpace(endTimeParam)
                        ? DateTime.MaxValue
                        : Convert.ToDateTime(endTimeParam);
                }
                catch (FormatException)
                {
                    return new Response
                    {
                        StatusCode = HttpStatusCode.BadRequest,
                        ReasonPhrase = "Parameter \"end\" is not of a valid format."
                    };
                }

                LogDumplogEvent(Request, null);
                var queryResults = _repository.GetAllLogs(startTime, endTime);
                return BuildXmlResponse(queryResults);
            };

            Get["/transactions/{FileName}"] = parameters =>
            {
                var fileName = (string) parameters.FileName;
                var startTimeParam = (string) Request.Query["start"];
                var endTimeParam = (string) Request.Query["end"];
                DateTime startTime;
                DateTime endTime;

                try
                {
                    startTime = String.IsNullOrWhiteSpace(startTimeParam)
                        ? DateTime.MinValue
                        : Convert.ToDateTime(startTimeParam);
                }
                catch (FormatException)
                {
                    return new Response
                    {
                        StatusCode = HttpStatusCode.BadRequest,
                        ReasonPhrase = "Parameter \"start\" is not of a valid format."
                    };
                }

                try
                {
                    endTime = String.IsNullOrWhiteSpace(endTimeParam)
                        ? DateTime.MaxValue
                        : Convert.ToDateTime(endTimeParam);
                }
                catch (FormatException)
                {
                    return new Response
                    {
                        StatusCode = HttpStatusCode.BadRequest,
                        ReasonPhrase = "Parameter \"end\" is not of a valid format."
                    };
                }

                LogDumplogEvent(Request, null);
                var queryResults = _repository.GetAllLogs(startTime, endTime);
                return BuildFileDownloadResponse(fileName, queryResults);
            };

            Get["/users/{Id}"] = parameters =>
            {
                var userId = parameters.Id;
                var startTimeParam = (string) Request.Query["start"];
                var endTimeParam = (string) Request.Query["end"];
                DateTime startTime;
                DateTime endTime;

                try
                {
                    startTime = String.IsNullOrWhiteSpace(startTimeParam)
                        ? DateTime.MinValue
                        : Convert.ToDateTime(startTimeParam);
                }
                catch (FormatException)
                {
                    return new Response
                    {
                        StatusCode = HttpStatusCode.BadRequest,
                        ReasonPhrase = "Parameter \"start\" is not of a valid format."
                    };
                }

                try
                {
                    endTime = String.IsNullOrWhiteSpace(endTimeParam)
                        ? DateTime.MaxValue
                        : Convert.ToDateTime(endTimeParam);
                }
                catch (FormatException)
                {
                    return new Response
                    {
                        StatusCode = HttpStatusCode.BadRequest,
                        ReasonPhrase = "Parameter \"end\" is not of a valid format."
                    };
                }

                LogDumplogEvent(Request, userId);
                var queryResults = _repository.GetLogsForUser(userId, startTime, endTime);
                return BuildXmlResponse(queryResults);
            };

            Get["/users/{Id}/{FileName}"] = parameters =>
            {
                var userId = (string) parameters.Id;
                var fileName = (string) parameters.FileName;
                var startTimeParam = (string) Request.Query["start"];
                var endTimeParam = (string) Request.Query["end"];
                DateTime startTime;
                DateTime endTime;

                try
                {
                    startTime = String.IsNullOrWhiteSpace(startTimeParam)
                        ? DateTime.MinValue
                        : Convert.ToDateTime(startTimeParam);
                }
                catch (FormatException)
                {
                    return new Response
                    {
                        StatusCode = HttpStatusCode.BadRequest,
                        ReasonPhrase = "Parameter \"start\" is not of a valid format."
                    };
                }

                try
                {
                    endTime = String.IsNullOrWhiteSpace(endTimeParam)
                        ? DateTime.MaxValue
                        : Convert.ToDateTime(endTimeParam);
                }
                catch (FormatException)
                {
                    return new Response
                    {
                        StatusCode = HttpStatusCode.BadRequest,
                        ReasonPhrase = "Parameter \"end\" is not of a valid format."
                    };
                }

                LogDumplogEvent(Request, userId);
                var queryResults = _repository.GetLogsForUser(userId, startTime, endTime);
                return BuildFileDownloadResponse(fileName, queryResults);
            };
        }
예제 #41
0
 public AuditLogger(int userId)
 {
     _repository = new EFAuditRepository();
     _userId = userId;
 }