protected void btnAuthenticate_Click(object sender, EventArgs e) { string[] urls = txtUrls.Text.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries); StringBuilder newUrls = new StringBuilder(); foreach (string url in urls) { string urlWithoutHashAndUpdatedExpiration = RemoveHashAndUpdateExpiration(url, dateExpiration.SelectedDateTime); string newUrl = urlWithoutHashAndUpdatedExpiration; string query = URLHelper.GetQuery(newUrl).TrimStart('?'); if (RESTServiceHelper.TryParseRestUrlPath(newUrl, out string absolutePathPrefix, out string relativeRestPath)) { string domain = URLHelper.GetDomain(newUrl); newUrl = URLHelper.RemoveQuery(relativeRestPath); // Rewrite the URL to physical URL string[] rewritten = BaseRESTService.RewriteRESTUrl(newUrl, query, domain, "GET"); newUrl = absolutePathPrefix + rewritten[0].TrimStart('~') + "?" + rewritten[1]; newUrl = HttpUtility.UrlDecode(newUrl); // Get the hash from real URL newUrls.AppendLine(URLHelper.AddParameterToUrl(urlWithoutHashAndUpdatedExpiration, "hash", RESTServiceHelper.GetUrlPathAndQueryHash(newUrl))); }
private void InitializeHealthMonitors() { ILoginWithNEP loginWithNEP; RESTServiceHelper restServiceHelper; componentHealthMonitors = new List <ComponentHealthMonitor>(); //Agents HealthMonitor CurrentRequest.Resolver = GetResolver("AgentHealthMonitor"); componentHealthMonitors.Add(new AgentsHealthMonitor(CurrentRequest.Resolver.Resolve <IDBAccess>())); //Database HealthMonitor CurrentRequest.Resolver = GetResolver("DatabaseHealthMonitor"); componentHealthMonitors.Add(new DatabaseHealthMonitor(CurrentRequest.Resolver.Resolve <IDBAccess>())); //Diskspace HealthMonitor CurrentRequest.Resolver = GetResolver("DiskspaceHealthMonitor"); componentHealthMonitors.Add(new DiskSpaceHealthMonitor(CurrentRequest.Resolver.Resolve <CMS.AMS.Common>())); //FolderPermissions HealthMonitor CurrentRequest.Resolver = GetResolver("FolderPermissionsHealthMonitor"); componentHealthMonitors.Add(new FolderPermissionsHealthMonitor(CurrentRequest.Resolver.Resolve <CMS.AMS.Common>())); //Messaging HealthMonitor CurrentRequest.Resolver = GetResolver("MessagingHealthMonitor"); loginWithNEP = new LoginWithNEP(CurrentRequest.Resolver.Resolve <IDBAccess>(), CurrentRequest.Resolver.Resolve <ILogger>(), CurrentRequest.Resolver.Resolve <IErrorHandler>()); restServiceHelper = new RESTServiceHelper(); restServiceHelper.m_LoginWithNEP = loginWithNEP; componentHealthMonitors.Add(new MessagingHealthMonitor(restServiceHelper, CurrentRequest.Resolver.Resolve <CMS.AMS.Common>())); //OCD HealthMonitor CurrentRequest.Resolver = GetResolver("OCDHealthMonitor"); loginWithNEP = new LoginWithNEP(CurrentRequest.Resolver.Resolve <IDBAccess>(), CurrentRequest.Resolver.Resolve <ILogger>(), CurrentRequest.Resolver.Resolve <IErrorHandler>()); restServiceHelper = new RESTServiceHelper(); restServiceHelper.m_LoginWithNEP = loginWithNEP; componentHealthMonitors.Add(new OCDHealthMonitor(restServiceHelper, CurrentRequest.Resolver.Resolve <CMS.AMS.Common>())); }