UrlChecker Class

This class exists to allow us to generate proper URL's for the NavigationManager when moving from page to page.
It also allows us to check if a specific url matches a specific page.

Definition

Namespace: MobileTrack.Web.Components.Extensions
Assembly: MobileTrack.Web.Components (in MobileTrack.Web.Components.dll) Version: 0.7+ce90b2cf6b782b8d7b7fd47b3c546987c652c00f
public static class UrlChecker
Inheritance
Object    UrlChecker

Remarks

To ensure the Regexes are as fast as possible, they are all pre-compiled and culture/ignore case invariant. Mbr/> URLs are case-insensitive anyway and not based on culture.
Also, all Regex checks are designed to check if a string follows a specific pattern exactly, as often URL's can have extra sections at the end that belong to different pages.
(For example: the overview page is /admin/company/{companyId}/{environmentId}, but the accounts page is /admin/company/{companyId}/{environmentId}/accounts).
If we didn't check the URL exactly, we will end up with false positives.

As we're dealing with Regex's here, we need to ensure that Regex DDoS attacks are not possible.
For more information about how Regex DoS attacks work, See here. This is why all regex's here have a timeout of 100ms;
if the regex takes longer than 100ms to execute, we will work from the assumption we're dealing with a ReDoS attack and stop the execution.
(Otherwise we'd be getting deadlocks)

Methods

CheckIfUrlBelongsToCompanyAdminPage Checks whether the current URL is a company admin page. This is useful to discern if we are working on such a page during preload.
If , it means we're now in an admin page and need to reload the data. If , it means we're in a different page and don't need to reload the data.
GenerateAdminUrlToCompany Generates an admin URL to the Company overview page.
GenerateUrlToAccount Generates a URL to an Account page, or th page to create a new account.
GenerateUrlToAccountsOverviewPage Generates a URL to the Accounts overview page
GenerateUrlToAlertRule Generates a URL to Alert rule page
GenerateUrlToAlertType Generates a URL to Alert type page
GenerateUrlToCompanyActionFlowsPage Generates a URL to the company's action flows page.
GenerateUrlToCompanyLogs Generates a URL to the Company Logs page.
GenerateUrlToCompanySettingsPage Generates a URL to the company's settings page.
GenerateUrlToCompanyTemplatesPage Generates a URL to the company's templates page.
GenerateUrlToCustomPageTrashPage Generates a URL to the custom page's trash page.
GenerateUrlToDashboardEditor Generates a URL to the Dashboard editor page
GenerateUrlToDevice Generates a URL to the DeviceDto page of user device
GenerateUrlToDevicesOverviewPage Generates a URL to the Devices overview page
GenerateUrlToEnvironmentT(UserSessionData, T) Generates a URL to the EnvironmentDto page of user environment
GenerateUrlToEnvironmentT(UserSessionData, T, EditorActiveTab) Generates a URL to the EnvironmentDto page of user environment
GenerateUrlToEnvironmentEdit Generates a URL to the EnvironmentDto page of user environment
GenerateUrlToEnvironmentsOverviewPage Generates a URL to the Environments overview page
GenerateUrlToFileOverviewPage Generates a URL to the Files overview page
GenerateUrlToGeofencesOverviewPage Generates a URL to the Geofence overview page
GenerateUrlToGlobalMapMarkersOverviewPage Generates a URL to the Map markers
GenerateUrlToHomePage(AccountDto) Generates a URL to the home page the currentUser is a part of
GenerateUrlToHomePage(UserSessionData) Generates a URL to the home page the currentUser is a part of
GenerateUrlToIpAddressWhiteBlackListPage Generates a URL to the company's trash page.
GenerateUrlToMapMarker Generates a URL to the MapMarkerDto page of user mapMarker
GenerateUrlToMapMarkersOverviewPage Generates a URL to the Map markers
GenerateUrlToNewEnvironment Generates a URL to the EnvironmentDto page to create a new environment.
GenerateUrlToNotificationSettings Generates a URL to the notifications settings page.
GenerateUrlToPublicMap Generates a URL for publicly viewing a map without having to sign in.
GenerateUrlToSettingsPage Generates a URL to the user's settings page.
GenerateUrlToTrashPage Generates a URL to the company's trash page.

See Also