Exemple #1
0
 public IssueController(IGetIssueQuery getIssueQuery,
                        IAdjustRulesCommand adjustRulesCommand,
                        IGetApplicationErrorsQuery getApplicationErrorsQuery,
                        IPagingViewModelGenerator pagingViewModelGenerator,
                        IUpdateIssueDetailsCommand updateIssueDetailsCommand,
                        ErrorditeConfiguration configuration,
                        IDeleteIssueErrorsCommand deleteIssueErrorsCommand,
                        IDeleteIssueCommand deleteIssueCommand,
                        IGetIssueReportDataQuery getIssueReportDataQuery,
                        IGetExtraDataKeysForIssueQuery getExtraDataKeysForIssueQuery,
                        IAddCommentCommand addCommentCommand,
                        IEncryptor encryptor,
                        IGetOrganisationQuery getOrganisationQuery)
 {
     _getIssueQuery                 = getIssueQuery;
     _adjustRulesCommand            = adjustRulesCommand;
     _getApplicationErrorsQuery     = getApplicationErrorsQuery;
     _pagingViewModelGenerator      = pagingViewModelGenerator;
     _updateIssueDetailsCommand     = updateIssueDetailsCommand;
     _configuration                 = configuration;
     _deleteIssueErrorsCommand      = deleteIssueErrorsCommand;
     _deleteIssueCommand            = deleteIssueCommand;
     _getIssueReportDataQuery       = getIssueReportDataQuery;
     _getExtraDataKeysForIssueQuery = getExtraDataKeysForIssueQuery;
     _addCommentCommand             = addCommentCommand;
     _encryptor            = encryptor;
     _getOrganisationQuery = getOrganisationQuery;
 }
Exemple #2
0
        public void WhenRateLimitIsExceeded()
        {
            var rule = new RateLimiterRule
            {
                Count   = 10,
                Minutes = 1
            };
            const string applicationId = "test";
            var          config        = new ErrorditeConfiguration {
                RateLimiterRules = new List <RateLimiterRule> {
                    rule
                }
            };

            var rateLimiter = new ExceptionRateLimiter(config, new UtcDateTime());

            for (int count = 1; count <= 100; count++)
            {
                if (count <= 10)
                {
                    Assert.That(rateLimiter.Accept(applicationId) == null);
                }
                else
                {
                    Assert.That(rateLimiter.Accept(applicationId) != null);
                }
            }
        }
Exemple #3
0
        public static void ConfigureBundleAndAWSSettings(this IDocumentStore store, ErrorditeConfiguration configuration, string databaseName, string bundleName)
        {
            using (var session = store.OpenSession())
            {
                session.Advanced.UseOptimisticConcurrency = true;

                var dbDoc          = session.Load <RavenJObject>("Raven/Databases/" + databaseName);
                var settings       = dbDoc["Settings"].Value <RavenJObject>();
                var secureSettings = dbDoc["SecuredSettings"].Value <RavenJObject>();
                var activeBundles  = settings[Constants.ActiveBundles] ?? "";
                var bundles        = activeBundles.Value <string>()
                                     .Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries)
                                     .Select(x => x.Trim())
                                     .ToArray();

                settings["Raven/AWSAccessKey"]       = configuration.AWSAccessKey;
                secureSettings["Raven/AWSSecretKey"] = configuration.AWSSecretKey;

                if (!bundles.Contains(bundleName))
                {
                    settings[Constants.ActiveBundles] = string.Join(";", bundles.Concat(new[] { bundleName }).ToArray());
                }

                session.Store(dbDoc);
                session.SaveChanges();
            }
        }
 public override string ConvertToSimpleMessage(ErrorditeConfiguration configuration)
 {
     return(string.Format(@"<b>{0}:</b> new issue <a href=""{1}""  target=""_blank"">{2}: {3}</a>",
                          ApplicationName,
                          IssueUrl(configuration),
                          IssueId,
                          IssueName));
 }
 public override string ConvertToNonHtmlMessage(ErrorditeConfiguration configuration)
 {
     return(string.Format(@"{0}: new issue created named '{1}', view the issue here... {2}",
                          ApplicationName,
                          IssueName,
                          IssueUrl(configuration)
                          ));
 }
Exemple #6
0
 public ChangeSubscriptionCommand(ErrorditeConfiguration configuration,
                                  IGetOrganisationStatisticsQuery getOrganisationStatisticsQuery,
                                  IGetAvailablePaymentPlansQuery getAvailablePaymentPlansQuery)
 {
     _configuration = configuration;
     _getOrganisationStatisticsQuery = getOrganisationStatisticsQuery;
     _getAvailablePaymentPlansQuery  = getAvailablePaymentPlansQuery;
 }
Exemple #7
0
 public override string ConvertToNonHtmlMessage(ErrorditeConfiguration configuration)
 {
     return(string.Format(@"{0}: solved issue named '{1}' has recurred, view the issue here... {2}",
                          ApplicationName,
                          IssueName,
                          IssueUrl(configuration)
                          ));
 }
 public HomeController(ErrorditeConfiguration configuration,
                       IShardedRavenDocumentStoreFactory storeFactory,
                       IAppSession session)
 {
     _configuration = configuration;
     _storeFactory  = storeFactory;
     _session       = session;
 }
 public EditGroupCommand(IGetUsersQuery getUsersQuery,
                         ErrorditeConfiguration configuration,
                         IAuthorisationManager authorisationManager)
 {
     _getUsersQuery        = getUsersQuery;
     _configuration        = configuration;
     _authorisationManager = authorisationManager;
 }
 public override string ConvertToNonHtmlMessage(ErrorditeConfiguration configuration)
 {
     return(string.Format(@"{0}: instance of issue '{1}' has occurred. Notification Frequency: {2}, view the issue here... {3}",
                          ApplicationName,
                          IssueName,
                          NotificationFrequency,
                          IssueUrl(configuration)));
 }
 public AttachToExistingIssueCommand(ISendNotificationCommand sendNotificationCommand,
                                     ErrorditeConfiguration configuration,
                                     IMakeExceededErrorsUnloggedCommand makeExceededErrorsUnloggedCommand)
 {
     _sendNotificationCommand           = sendNotificationCommand;
     _configuration                     = configuration;
     _makeExceededErrorsUnloggedCommand = makeExceededErrorsUnloggedCommand;
 }
 public override string ConvertToSimpleMessage(ErrorditeConfiguration configuration)
 {
     return(string.Format(@"<b>{0}:</b> issue <a href=""{1}""  target=""_blank"">{2}: {3}</a> has occurred. Notification Frequency: {4}",
                          ApplicationName,
                          IssueUrl(configuration),
                          IssueId,
                          IssueName,
                          NotificationFrequency));
 }
Exemple #13
0
 public ErrorditeCore(IGetUsersQuery getUsersQuery, IGetApplicationsQuery getApplicationsQuery, IGetGroupsQuery getGroupsQuery, ErrorditeConfiguration configuration, AppContext appContext, IAppSession session)
 {
     _getUsersQuery        = getUsersQuery;
     _getApplicationsQuery = getApplicationsQuery;
     _getGroupsQuery       = getGroupsQuery;
     Configuration         = configuration;
     AppContext            = appContext;
     Session = session;
 }
 public ReprocessIssueErrorsCommand(IAuthorisationManager authorisationManager,
                                    IGetApplicationErrorsQuery getApplicationErrorsQuery,
                                    ErrorditeConfiguration configuration,
                                    IReceiveErrorCommand receiveErrorCommand)
 {
     _authorisationManager      = authorisationManager;
     _getApplicationErrorsQuery = getApplicationErrorsQuery;
     _configuration             = configuration;
     _receiveErrorCommand       = receiveErrorCommand;
 }
 public AdjustRulesCommand(IGetErrorsThatDoNotMatchNewRulesQuery getErrorsThatDoNotMatchNewRulesQuery,
                           IMoveErrorsToNewIssueCommand moveErrorsToNewIssueCommand,
                           IAuthorisationManager authorisationManager,
                           ErrorditeConfiguration configuration)
 {
     _getErrorsThatDoNotMatchNewRulesQuery = getErrorsThatDoNotMatchNewRulesQuery;
     _moveErrorsToNewIssueCommand          = moveErrorsToNewIssueCommand;
     _authorisationManager = authorisationManager;
     _configuration        = configuration;
 }
Exemple #16
0
        public static List <SelectListItem> GetRuleProperties(this ErrorditeConfiguration configuration, string selectedValue)
        {
            var selectList = new List <SelectListItem>(configuration.ErrorPropertiesForFiltering.Select(property => new SelectListItem
            {
                Value    = property,
                Text     = Resources.Rules.ResourceManager.GetString("ErrorProperty_{0}".FormatWith(property)),
                Selected = property == selectedValue
            }));

            return(selectList);
        }
 public SQSQueueProcessor(IEnumerable <ServiceConfiguration> serviceConfigurations,
                          AmazonSQS amazonSQS,
                          IRequestThrottler requestThrottler,
                          ICreateSQSQueueCommand createSQSQueueCommand,
                          ErrorditeConfiguration configuration)
 {
     _serviceConfiguration  = serviceConfigurations.First(c => c.IsActive);
     _amazonSQS             = amazonSQS;
     _requestThrottler      = requestThrottler;
     _createSQSQueueCommand = createSQSQueueCommand;
     _configuration         = configuration;
 }
 public ProcessIncomingExceptionCommand(IGetApplicationByTokenQuery getApplicationByToken,
                                        ErrorditeConfiguration configuration,
                                        IReceiveErrorCommand receiveErrorCommand,
                                        IExceptionRateLimiter exceptionRateLimiter,
                                        IMessageSender sender)
 {
     _getApplicationByToken = getApplicationByToken;
     _configuration         = configuration;
     _receiveErrorCommand   = receiveErrorCommand;
     _exceptionRateLimiter  = exceptionRateLimiter;
     _sender = sender;
 }
Exemple #19
0
 public IssuesController(IPagingViewModelGenerator pagingViewModelGenerator,
                         IGetApplicationIssuesQuery getApplicationIssuesQuery,
                         IMatchRuleFactoryFactory matchRuleFactoryFactory,
                         ErrorditeConfiguration configuration,
                         IAddIssueCommand addIssueCommand,
                         IGetIssueQuery getIssueQuery,
                         IMergeIssuesCommand mergeIssuesCommand,
                         IBatchStatusUpdateCommand batchStatusUpdateCommand,
                         IBatchDeleteIssuesCommand batchDeleteIssuesCommand)
 {
     _pagingViewModelGenerator  = pagingViewModelGenerator;
     _getApplicationIssuesQuery = getApplicationIssuesQuery;
     _matchRuleFactoryFactory   = matchRuleFactoryFactory;
     _configuration             = configuration;
     _addIssueCommand           = addIssueCommand;
     _getIssueQuery             = getIssueQuery;
     _mergeIssuesCommand        = mergeIssuesCommand;
     _batchStatusUpdateCommand  = batchStatusUpdateCommand;
     _batchDeleteIssuesCommand  = batchDeleteIssuesCommand;
 }
Exemple #20
0
        public static void ConfigurePeriodicBackup(this IDocumentStore store, ErrorditeConfiguration configuration, string databaseName)
        {
            using (var session = store.OpenSession(databaseName))
            {
                session.Advanced.UseOptimisticConcurrency = true;

                var backupDoc = session.Load <PeriodicBackupSetup>(PeriodicBackupSetup.RavenDocumentKey);

                if (backupDoc == null)
                {
                    backupDoc = new PeriodicBackupSetup
                    {
                        IntervalMilliseconds = configuration.RavenBackupInterval,
                        AwsRegionEndpoint    = RegionEndpoint.EUWest1.SystemName,
                        S3BucketName         = databaseName,
                    };

                    session.Store(backupDoc, PeriodicBackupSetup.RavenDocumentKey);
                    session.SaveChanges();
                }
            }
        }
Exemple #21
0
 public CreateInvoiceCommand(ErrorditeConfiguration configuration)
 {
     _configuration = configuration;
 }
 public EditApplicationCommand(IAuthorisationManager authorisationManager, ErrorditeConfiguration configuration)
 {
     _authorisationManager = authorisationManager;
     _configuration        = configuration;
 }
 public ExceptionRateLimiter(ErrorditeConfiguration configuration, IDateTime dateTime)
 {
     _configuration = configuration;
     _dateTime      = dateTime;
 }
Exemple #24
0
 public CancelSubscriptionCommand(ErrorditeConfiguration configuration)
 {
     _configuration = configuration;
 }
 public ActivateOrganisationCommand(IGetApplicationsQuery getApplicationsQuery, ErrorditeConfiguration configuration)
 {
     _getApplicationsQuery = getApplicationsQuery;
     _configuration        = configuration;
 }
 public GetUsersQuery(IGetGroupsQuery getGroupsQuery, ErrorditeConfiguration configuration)
 {
     _getGroupsQuery = getGroupsQuery;
     _configuration  = configuration;
 }
Exemple #27
0
 public virtual string ConvertToNonHtmlMessage(ErrorditeConfiguration configuration)
 {
     return(string.Empty);
 }
Exemple #28
0
 public SendNotificationsCommand(ErrorditeConfiguration configuration,
                                 IGetUsersQuery getUsersQuery)
 {
     _getUsersQuery = getUsersQuery;
     _configuration = configuration;
 }
Exemple #29
0
 public MergeIssuesCommand(IAuthorisationManager authorisationManager, ErrorditeConfiguration configuration)
 {
     _authorisationManager = authorisationManager;
     _configuration        = configuration;
 }
 public FlushOrganisationCacheCommitAction(ErrorditeConfiguration configration, Organisation organisation)
 {
     _configration = configration;
     _organisation = organisation;
 }