@oneuptime/common 12.0.13 → 12.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/DatabaseModels/GlobalOidc.ts +20 -0
- package/Models/DatabaseModels/GlobalSso.ts +20 -0
- package/Models/DatabaseModels/MarketingConversion.ts +19 -9
- package/Models/DatabaseModels/NetworkDeviceLinkRule.ts +46 -0
- package/Models/DatabaseModels/OnCallDutyPolicySchedule.ts +14 -0
- package/Models/DatabaseModels/StatusPage.ts +7 -4
- package/Models/DatabaseModels/UserCall.ts +94 -3
- package/Models/DatabaseModels/UserEmail.ts +94 -3
- package/Models/DatabaseModels/UserIncomingCallNumber.ts +94 -3
- package/Models/DatabaseModels/UserPush.ts +37 -0
- package/Models/DatabaseModels/UserSMS.ts +94 -3
- package/Models/DatabaseModels/UserWhatsApp.ts +93 -2
- package/Server/API/BaseAPI.ts +79 -14
- package/Server/API/StatusPageAPI.ts +29 -4
- package/Server/API/UserCallAPI.ts +53 -45
- package/Server/API/UserEmailAPI.ts +53 -44
- package/Server/API/UserIncomingCallNumberAPI.ts +48 -38
- package/Server/API/UserNotificationMethodAdminAPI.ts +481 -0
- package/Server/API/UserPushAPI.ts +126 -2
- package/Server/API/UserSmsAPI.ts +53 -44
- package/Server/API/UserWhatsAppAPI.ts +53 -50
- package/Server/EnvironmentConfig.ts +7 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787142779538-MigrationName.ts +154 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787156982416-MigrationName.ts +17 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787700000000-FixTotpOtpUrlAlgorithm.ts +45 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787800000000-AddScopeToNetworkDeviceLinkRule.ts +19 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787900000000-AddRestrictToAttachedProjectsToGlobalSso.ts +40 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +10 -0
- package/Server/Middleware/SlackAuthorization.ts +43 -6
- package/Server/Middleware/UserAuthorization.ts +236 -26
- package/Server/Middleware/VerificationCodeRateLimit.ts +586 -0
- package/Server/Middleware/WhatsAppAuthorization.ts +43 -3
- package/Server/Services/AnalyticsDatabaseService.ts +169 -0
- package/Server/Services/DatabaseService.ts +101 -0
- package/Server/Services/GlobalOidcProjectService.ts +126 -1
- package/Server/Services/GlobalOidcService.ts +132 -0
- package/Server/Services/GlobalSsoProjectService.ts +126 -1
- package/Server/Services/GlobalSsoService.ts +132 -0
- package/Server/Services/LogAggregationService.ts +5 -0
- package/Server/Services/PushNotificationService.ts +127 -12
- package/Server/Services/TeamMemberService.ts +53 -13
- package/Server/Services/UserCallService.ts +55 -24
- package/Server/Services/UserEmailService.ts +83 -17
- package/Server/Services/UserIncomingCallNumberService.ts +49 -85
- package/Server/Services/UserNotificationMethodAdminService.ts +1527 -0
- package/Server/Services/UserNotificationRuleService.ts +26 -0
- package/Server/Services/UserPushService.ts +89 -0
- package/Server/Services/UserSmsService.ts +50 -17
- package/Server/Services/UserWhatsAppService.ts +48 -15
- package/Server/Types/Database/QueryHelper.ts +30 -0
- package/Server/Utils/AnalyticsDatabase/QuerySettingsHelper.ts +59 -0
- package/Server/Utils/ChannelVerification.ts +510 -0
- package/Server/Utils/CronTab.ts +73 -0
- package/Server/Utils/GlobalSsoAuthorization.ts +175 -0
- package/Server/Utils/Marketing/ConversionUploadProvider.ts +35 -5
- package/Server/Utils/Marketing/Providers/GoogleAds.ts +1 -1
- package/Server/Utils/Marketing/Providers/LinkedIn.ts +1 -1
- package/Server/Utils/Marketing/Providers/Meta.ts +1 -1
- package/Server/Utils/Marketing/Providers/MicrosoftAds.ts +1 -1
- package/Server/Utils/Marketing/Providers/Reddit.ts +1 -1
- package/Server/Utils/Monitor/Criteria/APIRequestCriteria.ts +48 -33
- package/Server/Utils/Monitor/Criteria/DnsMonitorCriteria.ts +35 -30
- package/Server/Utils/Monitor/Criteria/DomainMonitorCriteria.ts +33 -28
- package/Server/Utils/Monitor/Criteria/EvaluateOverTime.ts +475 -47
- package/Server/Utils/Monitor/Criteria/ExternalStatusPageMonitorCriteria.ts +35 -30
- package/Server/Utils/Monitor/Criteria/IncomingRequestCriteria.ts +47 -44
- package/Server/Utils/Monitor/Criteria/SSLMonitorCriteria.ts +33 -28
- package/Server/Utils/Monitor/Criteria/ServerMonitorCriteria.ts +69 -40
- package/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.ts +35 -29
- package/Server/Utils/Monitor/MonitorAlert.ts +24 -21
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +8 -0
- package/Server/Utils/Monitor/MonitorIncident.ts +21 -18
- package/Server/Utils/Monitor/MonitorResource.ts +161 -21
- package/Server/Utils/Monitor/MonitorResourceContext.ts +107 -0
- package/Server/Utils/Monitor/MonitorStepResourceIdentity.ts +442 -0
- package/Server/Utils/Monitor/SeriesResourceLabels.ts +3 -3
- package/Server/Utils/Monitor/SeriesResourceLinker.ts +96 -28
- package/Server/Utils/StatusPageContentSecurityPolicy.ts +56 -0
- package/Server/Utils/StatusPageCustomizationAccess.ts +117 -0
- package/Server/Utils/TotpAuth.ts +137 -9
- package/Server/Utils/UserRegistrationToken.ts +182 -0
- package/Server/Utils/VerificationCode.ts +134 -0
- package/Tests/App/Dashboard/AdminNotificationRulesPage.test.tsx +173 -94
- package/Tests/App/Dashboard/AdminUserNotificationMethodsPage.test.tsx +1151 -0
- package/Tests/App/Dashboard/AdminUserOnCallPages.test.tsx +905 -0
- package/Tests/App/Dashboard/DashboardCommandPalette.test.tsx +338 -0
- package/Tests/App/Dashboard/InvestigationPanel.test.tsx +1 -1
- package/Tests/App/Dashboard/MonitorTypePicker.test.tsx +28 -0
- package/Tests/Models/UserPushCriticalAlertColumn.test.ts +172 -0
- package/Tests/Server/API/BaseAPIGetListParallel.test.ts +519 -0
- package/Tests/Server/API/NotificationChannelVerificationAPI.test.ts +543 -0
- package/Tests/Server/API/StatusPageCustomizationOrigin.test.ts +348 -0
- package/Tests/Server/API/UserIncomingCallNumberApi.test.ts +108 -18
- package/Tests/Server/API/UserNotificationMethodAdminAPI.test.ts +963 -0
- package/Tests/Server/API/UserPushCriticalAlertsApi.test.ts +114 -0
- package/Tests/Server/API/UserSmsApi.test.ts +107 -14
- package/Tests/Server/API/UserTotpAuthAPI.test.ts +427 -0
- package/Tests/Server/Infrastructure/Postgres/FixTotpOtpUrlAlgorithmMigration.test.ts +265 -0
- package/Tests/Server/Infrastructure/Postgres/SchemaMigrationsOrdering.test.ts +227 -0
- package/Tests/Server/Middleware/SlackAuthorization.test.ts +149 -0
- package/Tests/Server/Middleware/UserAuthorization.test.ts +27 -13
- package/Tests/Server/Middleware/UserAuthorizationGlobalSsoGovernance.test.ts +1455 -0
- package/Tests/Server/Middleware/UserAuthorizationSSOProvider.test.ts +91 -2
- package/Tests/Server/Middleware/VerificationCodeRateLimit.test.ts +775 -0
- package/Tests/Server/Middleware/WhatsAppAuthorization.test.ts +233 -0
- package/Tests/Server/Services/AddNetworkDeviceReachabilityColumnsMigration.test.ts +10 -62
- package/Tests/Server/Services/AnalyticsDatabasePaginationStability.test.ts +33 -13
- package/Tests/Server/Services/AnalyticsDatabaseSortKeyBoundary.test.ts +658 -0
- package/Tests/Server/Services/CriticalOnCallAlertDelivery.test.ts +458 -0
- package/Tests/Server/Services/CriticalPushAlertPayload.test.ts +301 -0
- package/Tests/Server/Services/DatabaseServiceAtomicIncrement.test.ts +143 -0
- package/Tests/Server/Services/DeliverNotificationForRuleExtraction.test.ts +1 -0
- package/Tests/Server/Services/DiscoveryScanClaimHookFreeSafety.test.ts +21 -8
- package/Tests/Server/Services/GlobalSsoProviderAuthorization.test.ts +1242 -0
- package/Tests/Server/Services/LogAggregationScanMemory.test.ts +421 -0
- package/Tests/Server/Services/LogAggregationService.test.ts +2 -2
- package/Tests/Server/Services/MonitorResourceProbeAgreementHydration.test.ts +459 -0
- package/Tests/Server/Services/MonitorResourceProbeAgreementReuse.test.ts +10 -0
- package/Tests/Server/Services/NotificationChannelCodeIssuance.test.ts +401 -0
- package/Tests/Server/Services/PushNotificationDeliveryOptions.test.ts +204 -0
- package/Tests/Server/Services/TeamMemberAutoAcceptInvitation.test.ts +21 -1
- package/Tests/Server/Services/TeamMemberInviteRegistrationToken.test.ts +290 -0
- package/Tests/Server/Services/UserNotificationMethodAdminService.test.ts +948 -0
- package/Tests/Server/Services/UserNotificationRuleExecuteItem.test.ts +1 -0
- package/Tests/Server/Services/UserPushCriticalAlertToggle.test.ts +255 -0
- package/Tests/Server/Services/UserTotpAuthEnrolment.test.ts +218 -0
- package/Tests/Server/TestingUtils/AuthenticatorApp.ts +248 -0
- package/Tests/Server/Types/AnalyticsDatabase/AggregateUtilBucketTimestamp.test.ts +416 -0
- package/Tests/Server/Types/Database/Permissions/NotificationChannelVerificationColumns.test.ts +135 -0
- package/Tests/Server/Types/Database/Permissions/OnCallScheduleRelationSelect.test.ts +504 -0
- package/Tests/Server/Types/Database/QueryHelperFindWithSameTextAnyOf.test.ts +91 -0
- package/Tests/Server/Types/Database/QueryHelperManyToManyAndEmptyValues.test.ts +551 -0
- package/Tests/Server/Types/Database/SelectUtil.test.ts +348 -0
- package/Tests/Server/Types/Workflow/Components/JsonToText.test.ts +384 -0
- package/Tests/Server/Types/Workflow/Components/MergeJson.test.ts +403 -0
- package/Tests/Server/Utils/Browser.test.ts +162 -0
- package/Tests/Server/Utils/ChannelVerification.test.ts +689 -0
- package/Tests/Server/Utils/CronTab.test.ts +116 -0
- package/Tests/Server/Utils/Express.test.ts +371 -0
- package/Tests/Server/Utils/GlobalSSOToken.test.ts +581 -0
- package/Tests/Server/Utils/GlobalSsoAuthorization.test.ts +1401 -0
- package/Tests/Server/Utils/Marketing/AdUploadableConversionTypes.test.ts +254 -0
- package/Tests/Server/Utils/Marketing/ConversionUploadProvider.test.ts +1 -1
- package/Tests/Server/Utils/Monitor/Criteria/APIRequestCriteriaEvaluateOverTime.test.ts +508 -0
- package/Tests/Server/Utils/Monitor/Criteria/APIRequestCriteriaPortTimings.test.ts +30 -9
- package/Tests/Server/Utils/Monitor/Criteria/CustomCodeMonitorCriteria.test.ts +707 -0
- package/Tests/Server/Utils/Monitor/Criteria/DnsMonitorCriteria.test.ts +698 -0
- package/Tests/Server/Utils/Monitor/Criteria/EvaluateOverTime.test.ts +987 -0
- package/Tests/Server/Utils/Monitor/Criteria/ExternalStatusPageMonitorCriteria.test.ts +916 -0
- package/Tests/Server/Utils/Monitor/Criteria/IncomingEmailBodyCriteria.test.ts +243 -0
- package/Tests/Server/Utils/Monitor/Criteria/IncomingRequestBodyCriteria.test.ts +278 -0
- package/Tests/Server/Utils/Monitor/Criteria/ProfileMonitorCriteria.test.ts +382 -0
- package/Tests/Server/Utils/Monitor/Criteria/ServerMonitorCriteria.test.ts +1219 -0
- package/Tests/Server/Utils/Monitor/MonitorAlertResourceLinking.test.ts +160 -20
- package/Tests/Server/Utils/Monitor/MonitorDependencySuppressionCreatorSkip.test.ts +13 -8
- package/Tests/Server/Utils/Monitor/MonitorIncidentResourceLinking.test.ts +162 -18
- package/Tests/Server/Utils/Monitor/MonitorResourceContext.test.ts +349 -0
- package/Tests/Server/Utils/Monitor/MonitorResourceIngestedStepSelection.test.ts +86 -0
- package/Tests/Server/Utils/Monitor/MonitorStepResourceIdentity.test.ts +690 -0
- package/Tests/Server/Utils/Monitor/MonitorSummaryPersistence.test.ts +7 -2
- package/Tests/Server/Utils/Monitor/SeriesResourceLinker.test.ts +92 -18
- package/Tests/Server/Utils/PushNotificationUtilCreators.test.ts +267 -0
- package/Tests/Server/Utils/StatusPageContentSecurityPolicy.test.ts +136 -0
- package/Tests/Server/Utils/StatusPageCustomizationAccess.test.ts +223 -0
- package/Tests/Server/Utils/Telemetry/OneuptimeLabel.test.ts +439 -0
- package/Tests/Server/Utils/TotpAuth.test.ts +719 -0
- package/Tests/Server/Utils/UserRegistrationToken.test.ts +322 -0
- package/Tests/Server/Utils/VerificationCode.test.ts +296 -0
- package/Tests/Types/AutoRemediation/AutoRemediationSuggestionStatus.test.ts +192 -0
- package/Tests/Types/Call/CallRequest.test.ts +189 -0
- package/Tests/Types/Dashboard/DashboardSize.test.ts +226 -0
- package/Tests/Types/Incident/IncidentSlaStatus.test.ts +191 -0
- package/Tests/Types/Metrics/MetricDashboardMetricType.test.ts +278 -0
- package/Tests/Types/Metrics/MetricPipelineRuleType.test.ts +517 -0
- package/Tests/Types/Monitor/IncomingMonitorDefaultCriteria.test.ts +470 -0
- package/Tests/Types/Monitor/MonitorCriteriaInstance.test.ts +6 -4
- package/Tests/Types/Monitor/MonitorStepConfigHelpers.test.ts +165 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCatalog.test.ts +262 -5
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCoverage.test.ts +1 -1
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationNotificationMode.test.ts +1 -1
- package/Tests/Types/Monitor/ServiceAlertTemplates.test.ts +905 -0
- package/Tests/Types/NetworkDevice/NetworkDeviceLinkRuleScope.test.ts +215 -0
- package/Tests/Types/Service/ServiceLanguage.test.ts +255 -0
- package/Tests/Types/TextRandomGeneration.test.ts +211 -0
- package/Tests/UI/Components/Button.test.tsx +175 -1
- package/Tests/UI/Components/CodeBlockLanguages.test.tsx +236 -0
- package/Tests/UI/Components/CommandPalette/CommandPalette.test.tsx +568 -0
- package/Tests/UI/Components/CommandPalette/CommandPaletteKeyboard.test.tsx +239 -0
- package/Tests/UI/Components/CommandPalette/CommandPaletteProviders.test.tsx +400 -0
- package/Tests/UI/Components/CommandPalette/PaletteFilter.test.ts +234 -0
- package/Tests/UI/Components/CommandPalette/RecentCommands.test.ts +97 -0
- package/Tests/UI/Components/CountModelSideMenuItemGuard.test.tsx +198 -0
- package/Tests/UI/Components/FeedItemSafeMode.test.tsx +1 -1
- package/Tests/UI/Components/Forms/FormSubmitAnalytics.test.tsx +206 -0
- package/Tests/UI/Components/Forms/Utils/FormFieldSchemaTypeUtil.test.ts +267 -0
- package/Tests/UI/Components/List.test.tsx +9 -2
- package/Tests/UI/Components/ListLoadingStates.test.tsx +173 -0
- package/Tests/UI/Components/MarkdownLazy.test.tsx +113 -0
- package/Tests/UI/Components/MarkdownMermaidRetry.test.tsx +110 -0
- package/Tests/UI/Components/ModelTable/useCustomFieldColumns.test.tsx +8 -0
- package/Tests/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.test.ts +692 -0
- package/Tests/UI/Components/MoreMenuMotion.test.tsx +118 -0
- package/Tests/UI/Components/NavBarCommandKGating.test.tsx +178 -0
- package/Tests/UI/Components/OrderedStatesList.test.tsx +19 -2
- package/Tests/UI/Components/SideOverMotion.test.tsx +109 -0
- package/Tests/UI/Components/Skeleton.test.tsx +71 -0
- package/Tests/UI/Components/TableLoadingStates.test.tsx +279 -0
- package/Tests/UI/Components/Tabs.test.tsx +24 -0
- package/Tests/UI/Components/Toast.test.tsx +130 -7
- package/Tests/UI/Components/ToastStacking.test.tsx +198 -0
- package/Tests/UI/Utils/AIChatExport/ConversationMarkdown.test.ts +774 -0
- package/Tests/UI/Utils/AIChatExport/MarkdownBlocks.test.ts +791 -0
- package/Tests/UI/Utils/AIChatExport/MarkdownSafety.test.ts +544 -0
- package/Tests/UI/Utils/Dropdown.test.ts +423 -0
- package/Tests/UI/Utils/ModelAPITenantHeader.test.ts +122 -0
- package/Tests/UI/Utils/ModelListCache.test.ts +338 -0
- package/Tests/UI/Utils/ProjectListCacheInvalidation.test.ts +225 -0
- package/Tests/Utils/API.test.ts +16 -2
- package/Tests/Utils/Analytics.test.ts +187 -0
- package/Tests/Utils/Dashboard/Components/DashboardKubernetesResourceListShared.test.ts +347 -0
- package/Tests/Utils/Dashboard/Components/DashboardListSharedArgs.test.ts +259 -0
- package/Tests/Utils/Dashboard/Components/DashboardMonitorListComponent.test.ts +466 -0
- package/Tests/Utils/Monitor/MonitorMetricType.test.ts +80 -0
- package/Tests/Utils/Monitor/NetworkDeviceLinkRuleUtil.test.ts +1291 -0
- package/Tests/Utils/NetworkDiscovery/UnclaimedScanDiagnosis.test.ts +214 -0
- package/Tests/Utils/Rum/UrlScrubberSegments.test.ts +362 -0
- package/Types/Email/EmailTemplateType.ts +1 -0
- package/Types/Marketing/MarketingConversion.ts +12 -0
- package/Types/Monitor/CriteriaFilter.ts +9 -0
- package/Types/Monitor/MonitorCriteriaInstance.ts +41 -20
- package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.ts +131 -8
- package/Types/Monitor/Recommendation/MonitorRecommendationTypes.ts +48 -8
- package/Types/Monitor/ServiceAlertTemplates.ts +1352 -0
- package/Types/NetworkDevice/NetworkDeviceLinkRuleScope.ts +51 -0
- package/Types/Permission.ts +35 -0
- package/Types/PushNotification/AndroidNotificationChannel.ts +26 -0
- package/Types/PushNotification/PushNotificationMessage.ts +15 -0
- package/Types/PushNotification/PushNotificationRequest.ts +8 -16
- package/Types/Service/ServiceLanguage.ts +144 -0
- package/Types/Text.ts +111 -19
- package/UI/Components/Button/Button.tsx +27 -14
- package/UI/Components/CodeBlock/CodeBlock.tsx +54 -7
- package/UI/Components/CodeBlock/LanguageRegistry.ts +103 -0
- package/UI/Components/CommandPalette/CommandPalette.tsx +790 -0
- package/UI/Components/CommandPalette/PaletteFilter.ts +196 -0
- package/UI/Components/CommandPalette/PaletteRow.tsx +173 -0
- package/UI/Components/CommandPalette/RecentCommands.ts +57 -0
- package/UI/Components/CommandPalette/Types.ts +49 -0
- package/UI/Components/CommandPalette/UseProviderSearch.ts +129 -0
- package/UI/Components/Dropdown/Dropdown.tsx +6 -1
- package/UI/Components/Feed/FeedItem.tsx +1 -1
- package/UI/Components/FormModal/BasicFormModal.tsx +12 -0
- package/UI/Components/Forms/BasicForm.tsx +13 -1
- package/UI/Components/Forms/BasicModelForm.tsx +2 -1
- package/UI/Components/Forms/ModelForm.tsx +10 -1
- package/UI/Components/Forms/Utils/FormAnalyticsName.ts +39 -0
- package/UI/Components/List/List.tsx +37 -5
- package/UI/Components/List/ListSkeleton.tsx +54 -0
- package/UI/Components/Markdown.tsx/LazyMarkdownViewer.tsx +6 -1
- package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +71 -26
- package/UI/Components/Modal/Modal.tsx +2 -2
- package/UI/Components/ModelFormModal/ModelFormModal.tsx +6 -1
- package/UI/Components/ModelTable/BaseModelTable.tsx +1 -1
- package/UI/Components/ModelTable/useCustomFieldColumns.ts +11 -5
- package/UI/Components/MoreMenu/MoreMenu.tsx +39 -1
- package/UI/Components/Navbar/NavBar.tsx +14 -1
- package/UI/Components/OrderedStatesList/OrderedStatesList.tsx +50 -5
- package/UI/Components/SideMenu/CountModelSideMenuItem.tsx +40 -1
- package/UI/Components/SideOver/SideOver.tsx +37 -2
- package/UI/Components/Skeleton/Skeleton.tsx +53 -0
- package/UI/Components/Table/Table.tsx +74 -44
- package/UI/Components/Table/TableSkeletonRows.tsx +141 -0
- package/UI/Components/Tabs/Tab.tsx +1 -1
- package/UI/Components/Toast/Toast.tsx +118 -53
- package/UI/Components/Toast/ToastInit.tsx +82 -32
- package/UI/Styles/Theme.css +40 -0
- package/UI/Utils/ModelAPI/ModelAPI.ts +20 -10
- package/UI/Utils/ModelListCache.ts +188 -0
- package/UI/Utils/Project.ts +29 -0
- package/Utils/API.ts +6 -1
- package/Utils/Analytics.ts +55 -2
- package/Utils/Monitor/MonitorMetricType.ts +40 -0
- package/Utils/Monitor/NetworkDeviceLinkRuleUtil.ts +587 -37
- package/Utils/NetworkDiscovery/UnclaimedScanDiagnosis.ts +115 -0
- package/build/dist/Models/DatabaseModels/GlobalOidc.js +21 -0
- package/build/dist/Models/DatabaseModels/GlobalOidc.js.map +1 -1
- package/build/dist/Models/DatabaseModels/GlobalSso.js +21 -0
- package/build/dist/Models/DatabaseModels/GlobalSso.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MarketingConversion.js +20 -10
- package/build/dist/Models/DatabaseModels/MarketingConversion.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceLinkRule.js +47 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceLinkRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicySchedule.js +14 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicySchedule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPage.js +4 -4
- package/build/dist/Models/DatabaseModels/StatusPage.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserCall.js +101 -3
- package/build/dist/Models/DatabaseModels/UserCall.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserEmail.js +101 -3
- package/build/dist/Models/DatabaseModels/UserEmail.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserIncomingCallNumber.js +101 -3
- package/build/dist/Models/DatabaseModels/UserIncomingCallNumber.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserPush.js +38 -0
- package/build/dist/Models/DatabaseModels/UserPush.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserSMS.js +101 -3
- package/build/dist/Models/DatabaseModels/UserSMS.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserWhatsApp.js +100 -2
- package/build/dist/Models/DatabaseModels/UserWhatsApp.js.map +1 -1
- package/build/dist/Server/API/BaseAPI.js +69 -13
- package/build/dist/Server/API/BaseAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +25 -4
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/API/UserCallAPI.js +42 -38
- package/build/dist/Server/API/UserCallAPI.js.map +1 -1
- package/build/dist/Server/API/UserEmailAPI.js +42 -38
- package/build/dist/Server/API/UserEmailAPI.js.map +1 -1
- package/build/dist/Server/API/UserIncomingCallNumberAPI.js +37 -32
- package/build/dist/Server/API/UserIncomingCallNumberAPI.js.map +1 -1
- package/build/dist/Server/API/UserNotificationMethodAdminAPI.js +341 -0
- package/build/dist/Server/API/UserNotificationMethodAdminAPI.js.map +1 -0
- package/build/dist/Server/API/UserPushAPI.js +95 -2
- package/build/dist/Server/API/UserPushAPI.js.map +1 -1
- package/build/dist/Server/API/UserSmsAPI.js +42 -38
- package/build/dist/Server/API/UserSmsAPI.js.map +1 -1
- package/build/dist/Server/API/UserWhatsAppAPI.js +42 -40
- package/build/dist/Server/API/UserWhatsAppAPI.js.map +1 -1
- package/build/dist/Server/EnvironmentConfig.js +6 -0
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787142779538-MigrationName.js +89 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787142779538-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787156982416-MigrationName.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787156982416-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787700000000-FixTotpOtpUrlAlgorithm.js +40 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787700000000-FixTotpOtpUrlAlgorithm.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787800000000-AddScopeToNetworkDeviceLinkRule.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787800000000-AddScopeToNetworkDeviceLinkRule.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787900000000-AddRestrictToAttachedProjectsToGlobalSso.js +29 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787900000000-AddRestrictToAttachedProjectsToGlobalSso.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +10 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Middleware/SlackAuthorization.js +28 -4
- package/build/dist/Server/Middleware/SlackAuthorization.js.map +1 -1
- package/build/dist/Server/Middleware/UserAuthorization.js +197 -22
- package/build/dist/Server/Middleware/UserAuthorization.js.map +1 -1
- package/build/dist/Server/Middleware/VerificationCodeRateLimit.js +393 -0
- package/build/dist/Server/Middleware/VerificationCodeRateLimit.js.map +1 -0
- package/build/dist/Server/Middleware/WhatsAppAuthorization.js +32 -2
- package/build/dist/Server/Middleware/WhatsAppAuthorization.js.map +1 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js +136 -0
- package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +74 -0
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/GlobalOidcProjectService.js +105 -0
- package/build/dist/Server/Services/GlobalOidcProjectService.js.map +1 -1
- package/build/dist/Server/Services/GlobalOidcService.js +127 -0
- package/build/dist/Server/Services/GlobalOidcService.js.map +1 -1
- package/build/dist/Server/Services/GlobalSsoProjectService.js +105 -0
- package/build/dist/Server/Services/GlobalSsoProjectService.js.map +1 -1
- package/build/dist/Server/Services/GlobalSsoService.js +127 -0
- package/build/dist/Server/Services/GlobalSsoService.js.map +1 -1
- package/build/dist/Server/Services/LogAggregationService.js +5 -0
- package/build/dist/Server/Services/LogAggregationService.js.map +1 -1
- package/build/dist/Server/Services/PushNotificationService.js +69 -30
- package/build/dist/Server/Services/PushNotificationService.js.map +1 -1
- package/build/dist/Server/Services/TeamMemberService.js +43 -7
- package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
- package/build/dist/Server/Services/UserCallService.js +54 -22
- package/build/dist/Server/Services/UserCallService.js.map +1 -1
- package/build/dist/Server/Services/UserEmailService.js +78 -17
- package/build/dist/Server/Services/UserEmailService.js.map +1 -1
- package/build/dist/Server/Services/UserIncomingCallNumberService.js +45 -74
- package/build/dist/Server/Services/UserIncomingCallNumberService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationMethodAdminService.js +1117 -0
- package/build/dist/Server/Services/UserNotificationMethodAdminService.js.map +1 -0
- package/build/dist/Server/Services/UserNotificationRuleService.js +20 -0
- package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Services/UserPushService.js +77 -0
- package/build/dist/Server/Services/UserPushService.js.map +1 -1
- package/build/dist/Server/Services/UserSmsService.js +50 -17
- package/build/dist/Server/Services/UserSmsService.js.map +1 -1
- package/build/dist/Server/Services/UserWhatsAppService.js +48 -15
- package/build/dist/Server/Services/UserWhatsAppService.js.map +1 -1
- package/build/dist/Server/Types/Database/QueryHelper.js +27 -0
- package/build/dist/Server/Types/Database/QueryHelper.js.map +1 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/QuerySettingsHelper.js +46 -0
- package/build/dist/Server/Utils/AnalyticsDatabase/QuerySettingsHelper.js.map +1 -1
- package/build/dist/Server/Utils/ChannelVerification.js +348 -0
- package/build/dist/Server/Utils/ChannelVerification.js.map +1 -0
- package/build/dist/Server/Utils/CronTab.js +66 -0
- package/build/dist/Server/Utils/CronTab.js.map +1 -1
- package/build/dist/Server/Utils/GlobalSsoAuthorization.js +112 -0
- package/build/dist/Server/Utils/GlobalSsoAuthorization.js.map +1 -0
- package/build/dist/Server/Utils/Marketing/ConversionUploadProvider.js +17 -1
- package/build/dist/Server/Utils/Marketing/ConversionUploadProvider.js.map +1 -1
- package/build/dist/Server/Utils/Marketing/Providers/GoogleAds.js +1 -1
- package/build/dist/Server/Utils/Marketing/Providers/GoogleAds.js.map +1 -1
- package/build/dist/Server/Utils/Marketing/Providers/LinkedIn.js +1 -1
- package/build/dist/Server/Utils/Marketing/Providers/LinkedIn.js.map +1 -1
- package/build/dist/Server/Utils/Marketing/Providers/Meta.js +1 -1
- package/build/dist/Server/Utils/Marketing/Providers/Meta.js.map +1 -1
- package/build/dist/Server/Utils/Marketing/Providers/MicrosoftAds.js +1 -1
- package/build/dist/Server/Utils/Marketing/Providers/MicrosoftAds.js.map +1 -1
- package/build/dist/Server/Utils/Marketing/Providers/Reddit.js +1 -1
- package/build/dist/Server/Utils/Marketing/Providers/Reddit.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/APIRequestCriteria.js +37 -35
- package/build/dist/Server/Utils/Monitor/Criteria/APIRequestCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/DnsMonitorCriteria.js +21 -25
- package/build/dist/Server/Utils/Monitor/Criteria/DnsMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/DomainMonitorCriteria.js +20 -22
- package/build/dist/Server/Utils/Monitor/Criteria/DomainMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/EvaluateOverTime.js +370 -42
- package/build/dist/Server/Utils/Monitor/Criteria/EvaluateOverTime.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/ExternalStatusPageMonitorCriteria.js +21 -25
- package/build/dist/Server/Utils/Monitor/Criteria/ExternalStatusPageMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/IncomingRequestCriteria.js +34 -37
- package/build/dist/Server/Utils/Monitor/Criteria/IncomingRequestCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/SSLMonitorCriteria.js +21 -25
- package/build/dist/Server/Utils/Monitor/Criteria/SSLMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/ServerMonitorCriteria.js +64 -52
- package/build/dist/Server/Utils/Monitor/Criteria/ServerMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js +25 -29
- package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js +20 -17
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +8 -0
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js +17 -14
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorResource.js +123 -23
- package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorResourceContext.js +95 -0
- package/build/dist/Server/Utils/Monitor/MonitorResourceContext.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorStepResourceIdentity.js +313 -0
- package/build/dist/Server/Utils/Monitor/MonitorStepResourceIdentity.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js +3 -3
- package/build/dist/Server/Utils/Monitor/SeriesResourceLinker.js +67 -26
- package/build/dist/Server/Utils/Monitor/SeriesResourceLinker.js.map +1 -1
- package/build/dist/Server/Utils/StatusPageContentSecurityPolicy.js +39 -0
- package/build/dist/Server/Utils/StatusPageContentSecurityPolicy.js.map +1 -0
- package/build/dist/Server/Utils/StatusPageCustomizationAccess.js +85 -0
- package/build/dist/Server/Utils/StatusPageCustomizationAccess.js.map +1 -0
- package/build/dist/Server/Utils/TotpAuth.js +127 -8
- package/build/dist/Server/Utils/TotpAuth.js.map +1 -1
- package/build/dist/Server/Utils/UserRegistrationToken.js +170 -0
- package/build/dist/Server/Utils/UserRegistrationToken.js.map +1 -0
- package/build/dist/Server/Utils/VerificationCode.js +120 -0
- package/build/dist/Server/Utils/VerificationCode.js.map +1 -0
- package/build/dist/Types/Email/EmailTemplateType.js +1 -0
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
- package/build/dist/Types/Marketing/MarketingConversion.js +10 -0
- package/build/dist/Types/Marketing/MarketingConversion.js.map +1 -1
- package/build/dist/Types/Monitor/CriteriaFilter.js +1 -0
- package/build/dist/Types/Monitor/CriteriaFilter.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js +42 -21
- package/build/dist/Types/Monitor/MonitorCriteriaInstance.js.map +1 -1
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +77 -5
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js.map +1 -1
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js +18 -6
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js.map +1 -1
- package/build/dist/Types/Monitor/ServiceAlertTemplates.js +1028 -0
- package/build/dist/Types/Monitor/ServiceAlertTemplates.js.map +1 -0
- package/build/dist/Types/NetworkDevice/NetworkDeviceLinkRuleScope.js +46 -0
- package/build/dist/Types/NetworkDevice/NetworkDeviceLinkRuleScope.js.map +1 -0
- package/build/dist/Types/Permission.js +33 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/PushNotification/AndroidNotificationChannel.js +27 -0
- package/build/dist/Types/PushNotification/AndroidNotificationChannel.js.map +1 -0
- package/build/dist/Types/Service/ServiceLanguage.js +96 -0
- package/build/dist/Types/Service/ServiceLanguage.js.map +1 -0
- package/build/dist/Types/Text.js +82 -17
- package/build/dist/Types/Text.js.map +1 -1
- package/build/dist/UI/Components/Button/Button.js +22 -14
- package/build/dist/UI/Components/Button/Button.js.map +1 -1
- package/build/dist/UI/Components/CodeBlock/CodeBlock.js +35 -3
- package/build/dist/UI/Components/CodeBlock/CodeBlock.js.map +1 -1
- package/build/dist/UI/Components/CodeBlock/LanguageRegistry.js +57 -0
- package/build/dist/UI/Components/CodeBlock/LanguageRegistry.js.map +1 -0
- package/build/dist/UI/Components/CommandPalette/CommandPalette.js +439 -0
- package/build/dist/UI/Components/CommandPalette/CommandPalette.js.map +1 -0
- package/build/dist/UI/Components/CommandPalette/PaletteFilter.js +135 -0
- package/build/dist/UI/Components/CommandPalette/PaletteFilter.js.map +1 -0
- package/build/dist/UI/Components/CommandPalette/PaletteRow.js +83 -0
- package/build/dist/UI/Components/CommandPalette/PaletteRow.js.map +1 -0
- package/build/dist/UI/Components/CommandPalette/RecentCommands.js +47 -0
- package/build/dist/UI/Components/CommandPalette/RecentCommands.js.map +1 -0
- package/build/dist/UI/Components/CommandPalette/Types.js +2 -0
- package/build/dist/UI/Components/CommandPalette/Types.js.map +1 -0
- package/build/dist/UI/Components/CommandPalette/UseProviderSearch.js +88 -0
- package/build/dist/UI/Components/CommandPalette/UseProviderSearch.js.map +1 -0
- package/build/dist/UI/Components/Dropdown/Dropdown.js +6 -1
- package/build/dist/UI/Components/Dropdown/Dropdown.js.map +1 -1
- package/build/dist/UI/Components/Feed/FeedItem.js +1 -1
- package/build/dist/UI/Components/Feed/FeedItem.js.map +1 -1
- package/build/dist/UI/Components/FormModal/BasicFormModal.js +2 -1
- package/build/dist/UI/Components/FormModal/BasicFormModal.js.map +1 -1
- package/build/dist/UI/Components/Forms/BasicForm.js +10 -1
- package/build/dist/UI/Components/Forms/BasicForm.js.map +1 -1
- package/build/dist/UI/Components/Forms/BasicModelForm.js +2 -1
- package/build/dist/UI/Components/Forms/BasicModelForm.js.map +1 -1
- package/build/dist/UI/Components/Forms/ModelForm.js +4 -1
- package/build/dist/UI/Components/Forms/ModelForm.js.map +1 -1
- package/build/dist/UI/Components/Forms/Utils/FormAnalyticsName.js +33 -0
- package/build/dist/UI/Components/Forms/Utils/FormAnalyticsName.js.map +1 -0
- package/build/dist/UI/Components/List/List.js +19 -5
- package/build/dist/UI/Components/List/List.js.map +1 -1
- package/build/dist/UI/Components/List/ListSkeleton.js +21 -0
- package/build/dist/UI/Components/List/ListSkeleton.js.map +1 -0
- package/build/dist/UI/Components/Markdown.tsx/LazyMarkdownViewer.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +52 -25
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js.map +1 -1
- package/build/dist/UI/Components/Modal/Modal.js +2 -2
- package/build/dist/UI/Components/ModelFormModal/ModelFormModal.js +2 -1
- package/build/dist/UI/Components/ModelFormModal/ModelFormModal.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/useCustomFieldColumns.js +9 -2
- package/build/dist/UI/Components/ModelTable/useCustomFieldColumns.js.map +1 -1
- package/build/dist/UI/Components/MoreMenu/MoreMenu.js +32 -1
- package/build/dist/UI/Components/MoreMenu/MoreMenu.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBar.js +5 -1
- package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
- package/build/dist/UI/Components/OrderedStatesList/OrderedStatesList.js +29 -5
- package/build/dist/UI/Components/OrderedStatesList/OrderedStatesList.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/CountModelSideMenuItem.js +23 -1
- package/build/dist/UI/Components/SideMenu/CountModelSideMenuItem.js.map +1 -1
- package/build/dist/UI/Components/SideOver/SideOver.js +23 -2
- package/build/dist/UI/Components/SideOver/SideOver.js.map +1 -1
- package/build/dist/UI/Components/Skeleton/Skeleton.js +23 -0
- package/build/dist/UI/Components/Skeleton/Skeleton.js.map +1 -0
- package/build/dist/UI/Components/Table/Table.js +35 -24
- package/build/dist/UI/Components/Table/Table.js.map +1 -1
- package/build/dist/UI/Components/Table/TableSkeletonRows.js +52 -0
- package/build/dist/UI/Components/Table/TableSkeletonRows.js.map +1 -0
- package/build/dist/UI/Components/Tabs/Tab.js +1 -1
- package/build/dist/UI/Components/Tabs/Tab.js.map +1 -1
- package/build/dist/UI/Components/Toast/Toast.js +77 -23
- package/build/dist/UI/Components/Toast/Toast.js.map +1 -1
- package/build/dist/UI/Components/Toast/ToastInit.js +37 -15
- package/build/dist/UI/Components/Toast/ToastInit.js.map +1 -1
- package/build/dist/UI/Utils/ModelAPI/ModelAPI.js +18 -9
- package/build/dist/UI/Utils/ModelAPI/ModelAPI.js.map +1 -1
- package/build/dist/UI/Utils/ModelListCache.js +126 -0
- package/build/dist/UI/Utils/ModelListCache.js.map +1 -0
- package/build/dist/UI/Utils/Project.js +24 -1
- package/build/dist/UI/Utils/Project.js.map +1 -1
- package/build/dist/Utils/API.js +6 -1
- package/build/dist/Utils/API.js.map +1 -1
- package/build/dist/Utils/Analytics.js +50 -2
- package/build/dist/Utils/Analytics.js.map +1 -1
- package/build/dist/Utils/Monitor/MonitorMetricType.js +37 -0
- package/build/dist/Utils/Monitor/MonitorMetricType.js.map +1 -1
- package/build/dist/Utils/Monitor/NetworkDeviceLinkRuleUtil.js +318 -37
- package/build/dist/Utils/Monitor/NetworkDeviceLinkRuleUtil.js.map +1 -1
- package/build/dist/Utils/NetworkDiscovery/UnclaimedScanDiagnosis.js +87 -0
- package/build/dist/Utils/NetworkDiscovery/UnclaimedScanDiagnosis.js.map +1 -0
- package/jest.config.json +1 -1
- package/package.json +2 -3
- package/Server/Utils/Monitor/MonitorClusterContext.ts +0 -182
- package/Tests/__mocks__/otpauth.js +0 -30
- package/build/dist/Server/Utils/Monitor/MonitorClusterContext.js +0 -141
- package/build/dist/Server/Utils/Monitor/MonitorClusterContext.js.map +0 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import Hostname from "../../Types/API/Hostname";
|
|
2
|
+
import StatusPageDomainService from "../Services/StatusPageDomainService";
|
|
3
|
+
const BUILT_IN_PRIMARY_HOSTS = new Set([
|
|
4
|
+
"localhost",
|
|
5
|
+
"ingress",
|
|
6
|
+
]);
|
|
7
|
+
const INVALID_HOST_AUTHORITY_CHARACTER = /[\s/?#]/;
|
|
8
|
+
/**
|
|
9
|
+
* Parse the HTTP Host authority without consulting Express' `req.hostname`.
|
|
10
|
+
*
|
|
11
|
+
* Express may derive `req.hostname` from X-Forwarded-Host when `trust proxy`
|
|
12
|
+
* is enabled. That header is caller-controlled on several of the Nginx routes
|
|
13
|
+
* in this repository, so it cannot decide whether tenant-controlled code is
|
|
14
|
+
* returned. Nginx overwrites the actual Host header with `$host`, which makes
|
|
15
|
+
* the raw Host the appropriate input to this security boundary.
|
|
16
|
+
*/
|
|
17
|
+
export const normalizeStatusPageRequestHost = (rawHost) => {
|
|
18
|
+
const authority = (rawHost === null || rawHost === void 0 ? void 0 : rawHost.trim()) || "";
|
|
19
|
+
if (!authority ||
|
|
20
|
+
authority.includes("@") ||
|
|
21
|
+
authority.includes(",") ||
|
|
22
|
+
INVALID_HOST_AUTHORITY_CHARACTER.test(authority) ||
|
|
23
|
+
!Hostname.isValid(authority)) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
let hostname = Hostname.fromAuthority(authority)
|
|
28
|
+
.hostname.trim()
|
|
29
|
+
.toLowerCase();
|
|
30
|
+
// Treat the fully-qualified spelling of a DNS name as the same host.
|
|
31
|
+
if (hostname.endsWith(".")) {
|
|
32
|
+
hostname = hostname.slice(0, -1);
|
|
33
|
+
}
|
|
34
|
+
return hostname || null;
|
|
35
|
+
}
|
|
36
|
+
catch (_a) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
export const isPrimaryStatusPageHost = (hostname) => {
|
|
41
|
+
if (BUILT_IN_PRIMARY_HOSTS.has(hostname)) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
const configuredHostValue = process.env["HOST"] || "localhost";
|
|
45
|
+
const configuredHost = normalizeStatusPageRequestHost(configuredHostValue);
|
|
46
|
+
/*
|
|
47
|
+
* A malformed deployment HOST means we cannot prove that any incoming host
|
|
48
|
+
* is isolated from the authenticated application. Disable customizations
|
|
49
|
+
* globally until the configuration is corrected.
|
|
50
|
+
*/
|
|
51
|
+
if (!configuredHost) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
return hostname === configuredHost;
|
|
55
|
+
};
|
|
56
|
+
export const canServeStatusPageCustomizations = async (data) => {
|
|
57
|
+
const requestHost = normalizeStatusPageRequestHost(data.req.get("host"));
|
|
58
|
+
if (!requestHost || isPrimaryStatusPageHost(requestHost)) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
const statusPageDomain = await StatusPageDomainService.findOneBy({
|
|
63
|
+
query: {
|
|
64
|
+
fullDomain: requestHost,
|
|
65
|
+
statusPageId: data.statusPageId,
|
|
66
|
+
isCnameVerified: true,
|
|
67
|
+
domain: {
|
|
68
|
+
isVerified: true,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
select: {
|
|
72
|
+
_id: true,
|
|
73
|
+
},
|
|
74
|
+
props: {
|
|
75
|
+
isRoot: true,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
return Boolean(statusPageDomain);
|
|
79
|
+
}
|
|
80
|
+
catch (_a) {
|
|
81
|
+
// A lookup failure must never fall back to serving tenant-controlled code.
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=StatusPageCustomizationAccess.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusPageCustomizationAccess.js","sourceRoot":"","sources":["../../../../Server/Utils/StatusPageCustomizationAccess.ts"],"names":[],"mappings":"AAEA,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAEhD,OAAO,uBAAuB,MAAM,qCAAqC,CAAC;AAG1E,MAAM,sBAAsB,GAAgB,IAAI,GAAG,CAAS;IAC1D,WAAW;IACX,SAAS;CACV,CAAC,CAAC;AAEH,MAAM,gCAAgC,GAAW,SAAS,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAEtB,CAAC,OAA2B,EAAiB,EAAE;IAClE,MAAM,SAAS,GAAW,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE,KAAI,EAAE,CAAC;IAEhD,IACE,CAAC,SAAS;QACV,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC;QACvB,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC;QACvB,gCAAgC,CAAC,IAAI,CAAC,SAAS,CAAC;QAChD,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,EAC5B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH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AW;gBACvB,YAAY,EAAE,IAAI,CAAC,YAAY;gBAC/B,eAAe,EAAE,IAAI;gBACrB,MAAM,EAAE;oBACN,UAAU,EAAE,IAAI;iBACP;aACZ;YACD,MAAM,EAAE;gBACN,GAAG,EAAE,IAAI;aACV;YACD,KAAK,EAAE;gBACL,MAAM,EAAE,IAAI;aACb;SACF,CAAC,CAAC;QAEL,OAAO,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACnC,CAAC;IAAC,WAAM,CAAC;QACP,2EAA2E;QAC3E,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -9,6 +9,59 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import * as OTPAuth from "otpauth";
|
|
11
11
|
import CaptureSpan from "./Telemetry/CaptureSpan";
|
|
12
|
+
/**
|
|
13
|
+
* The HMAC algorithm every new enrolment is issued with.
|
|
14
|
+
*
|
|
15
|
+
* RFC 6238 fixes SHA1 as the default and every authenticator implements it.
|
|
16
|
+
* The `algorithm` parameter in an otpauth:// URI is, in practice, advisory:
|
|
17
|
+
* Google Authenticator and Microsoft Authenticator parse the URI, ignore the
|
|
18
|
+
* parameter, and compute SHA1 anyway. A server that issues `algorithm=SHA256`
|
|
19
|
+
* therefore hands those apps a QR code they will silently mis-implement — the
|
|
20
|
+
* app shows a confident six digits, the server computes a completely different
|
|
21
|
+
* six digits, and enrolment can never succeed no matter how many codes the
|
|
22
|
+
* user tries. That is the failure this constant exists to prevent.
|
|
23
|
+
*
|
|
24
|
+
* SHA1 is not a weakness here. HMAC-SHA1 is unaffected by the collision
|
|
25
|
+
* attacks that retired SHA1 for signatures (RFC 6234 / RFC 2104), and the
|
|
26
|
+
* output is truncated to six digits over a 30 second window regardless — the
|
|
27
|
+
* brute-force surface is the 10^6 code space, not the hash.
|
|
28
|
+
*/
|
|
29
|
+
export const DefaultTotpAlgorithm = "SHA1";
|
|
30
|
+
/**
|
|
31
|
+
* Algorithms a submitted token is checked against, in order.
|
|
32
|
+
*
|
|
33
|
+
* OneUptime issued `SHA256` enrolments before this was understood. Those
|
|
34
|
+
* secrets are still in the database and still work in the minority of apps
|
|
35
|
+
* that do honour the parameter (1Password, Bitwarden, Aegis, FreeOTP), so
|
|
36
|
+
* dropping SHA256 from verification would lock those accounts out of their
|
|
37
|
+
* own logins.
|
|
38
|
+
*
|
|
39
|
+
* The cost is exactly one bit: two algorithms across the validation window
|
|
40
|
+
* means twice as many six-digit strings are accepted at any instant. Against
|
|
41
|
+
* a 10^6 code space that is still a vanishing fraction, and the tests pin the
|
|
42
|
+
* bound so it cannot quietly grow.
|
|
43
|
+
*
|
|
44
|
+
* Retiring SHA256 needs more than time passing. Nothing on the row records
|
|
45
|
+
* which algorithm the user's app actually computes, so "no legacy rows remain"
|
|
46
|
+
* is not a question the database can answer today — removing it means either
|
|
47
|
+
* storing the algorithm that verified, or accepting that some long-dormant
|
|
48
|
+
* account re-enrols instead of logging in.
|
|
49
|
+
*/
|
|
50
|
+
export const SupportedTotpAlgorithms = ["SHA1", "SHA256"];
|
|
51
|
+
/**
|
|
52
|
+
* Number of 30 second steps either side of now that a token is accepted for.
|
|
53
|
+
*
|
|
54
|
+
* Three steps is +/- 90 seconds, which absorbs ordinary phone/server clock
|
|
55
|
+
* drift and the user typing the last digit as the code rolls over.
|
|
56
|
+
*/
|
|
57
|
+
export const TotpValidationWindow = 3;
|
|
58
|
+
/**
|
|
59
|
+
* Number of digits in a token, and the length of the time step in seconds.
|
|
60
|
+
* Both are the values Google Authenticator assumes, and — like `algorithm` —
|
|
61
|
+
* both are parameters it ignores when told anything else.
|
|
62
|
+
*/
|
|
63
|
+
export const TotpDigits = 6;
|
|
64
|
+
export const TotpPeriodInSeconds = 30;
|
|
12
65
|
/**
|
|
13
66
|
* Utility class for handling TOTP authentication.
|
|
14
67
|
*/
|
|
@@ -32,26 +85,82 @@ export default class TotpAuth {
|
|
|
32
85
|
email: data.email,
|
|
33
86
|
}),
|
|
34
87
|
// Algorithm used for the HMAC function.
|
|
35
|
-
algorithm:
|
|
88
|
+
algorithm: data.algorithm || DefaultTotpAlgorithm,
|
|
36
89
|
// Length of the generated tokens.
|
|
37
|
-
digits:
|
|
90
|
+
digits: TotpDigits,
|
|
38
91
|
// Interval of time for which a token is valid, in seconds.
|
|
39
|
-
period:
|
|
92
|
+
period: TotpPeriodInSeconds,
|
|
40
93
|
// Arbitrary key encoded in Base32 or OTPAuth.Secret instance.
|
|
41
94
|
secret: data.secret,
|
|
42
95
|
});
|
|
43
96
|
return totp;
|
|
44
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Strips the formatting authenticator apps add for readability.
|
|
100
|
+
*
|
|
101
|
+
* Google Authenticator renders a code as "123 456" and both the iOS and
|
|
102
|
+
* Android clipboards keep that space when the user copies it. Rejecting the
|
|
103
|
+
* paste is a self-inflicted "Invalid code" for a user who supplied exactly
|
|
104
|
+
* the right secret material, so the separators are removed before the token
|
|
105
|
+
* is compared. Anything that is not a digit is dropped, which also covers
|
|
106
|
+
* the hyphen some apps use and stray whitespace from a trimmed paste.
|
|
107
|
+
*
|
|
108
|
+
* @param token - The raw token as submitted.
|
|
109
|
+
* @returns The token reduced to its digits.
|
|
110
|
+
*/
|
|
111
|
+
static normalizeToken(token) {
|
|
112
|
+
/*
|
|
113
|
+
* The token arrives straight off a JSON body, so it is only a string
|
|
114
|
+
* because the client chose to send one. A number or an object here must
|
|
115
|
+
* fail verification, not throw out of `.replace` and surface as a 500.
|
|
116
|
+
*/
|
|
117
|
+
if (typeof token !== "string" || !token) {
|
|
118
|
+
return "";
|
|
119
|
+
}
|
|
120
|
+
return token.replace(/\D/g, "");
|
|
121
|
+
}
|
|
45
122
|
/**
|
|
46
123
|
* Verifies if a given token matches the provided secret key.
|
|
47
124
|
* @param data - The data object containing the secret key and token.
|
|
48
125
|
* @returns A boolean indicating whether the token is valid or not.
|
|
49
126
|
*/
|
|
50
127
|
static verifyToken(data) {
|
|
51
|
-
const { secret,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
128
|
+
const { secret, email } = data;
|
|
129
|
+
if (!secret) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
const token = this.normalizeToken(data.token);
|
|
133
|
+
/*
|
|
134
|
+
* otpauth compares the submitted string against the codes it generates,
|
|
135
|
+
* so a token of the wrong length can never match — but it would still be
|
|
136
|
+
* run through one HMAC per algorithm per window step first. Reject it up
|
|
137
|
+
* front instead.
|
|
138
|
+
*/
|
|
139
|
+
if (token.length !== TotpDigits) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
for (const algorithm of SupportedTotpAlgorithms) {
|
|
143
|
+
let totp;
|
|
144
|
+
try {
|
|
145
|
+
totp = this.getTotp({ secret, email, algorithm });
|
|
146
|
+
}
|
|
147
|
+
catch (_a) {
|
|
148
|
+
/*
|
|
149
|
+
* A secret that is not valid base32 throws in the OTPAuth.Secret
|
|
150
|
+
* constructor. That is a corrupt row, not a wrong code, and it fails
|
|
151
|
+
* identically for every algorithm — so stop rather than repeat it.
|
|
152
|
+
*/
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
const delta = totp.validate({
|
|
156
|
+
token,
|
|
157
|
+
window: TotpValidationWindow,
|
|
158
|
+
});
|
|
159
|
+
if (delta !== null) {
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return false;
|
|
55
164
|
}
|
|
56
165
|
/**
|
|
57
166
|
* Generates a URI for the given secret key and user email, which can be used to set up two-factor authentication.
|
|
@@ -60,7 +169,11 @@ export default class TotpAuth {
|
|
|
60
169
|
*/
|
|
61
170
|
static generateUri(data) {
|
|
62
171
|
const { secret, userEmail } = data;
|
|
63
|
-
const totp = this.getTotp({
|
|
172
|
+
const totp = this.getTotp({
|
|
173
|
+
secret,
|
|
174
|
+
email: userEmail,
|
|
175
|
+
algorithm: DefaultTotpAlgorithm,
|
|
176
|
+
});
|
|
64
177
|
return totp.toString();
|
|
65
178
|
}
|
|
66
179
|
}
|
|
@@ -82,6 +195,12 @@ __decorate([
|
|
|
82
195
|
__metadata("design:paramtypes", [Object]),
|
|
83
196
|
__metadata("design:returntype", OTPAuth.TOTP)
|
|
84
197
|
], TotpAuth, "getTotp", null);
|
|
198
|
+
__decorate([
|
|
199
|
+
CaptureSpan(),
|
|
200
|
+
__metadata("design:type", Function),
|
|
201
|
+
__metadata("design:paramtypes", [String]),
|
|
202
|
+
__metadata("design:returntype", String)
|
|
203
|
+
], TotpAuth, "normalizeToken", null);
|
|
85
204
|
__decorate([
|
|
86
205
|
CaptureSpan(),
|
|
87
206
|
__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TotpAuth.js","sourceRoot":"","sources":["../../../../Server/Utils/TotpAuth.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAElD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B;;;OAGG;IAEW,AAAP,MAAM,CAAC,cAAc;QAC1B,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC;IACrC,CAAC;IAGa,AAAP,MAAM,CAAC,QAAQ,CAAC,IAAsB;QAC3C,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC/B,CAAC;IAGa,AAAP,MAAM,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"TotpAuth.js","sourceRoot":"","sources":["../../../../Server/Utils/TotpAuth.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAElD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAW,MAAM,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;GAm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;IACzB,CAAC;CACF;AA1Ie;IADb,WAAW,EAAE;;;;oCAGb;AAGa;IADb,WAAW,EAAE;;;;8BAGb;AAGa;IADb,WAAW,EAAE;;;oCAKV,OAAO,CAAC,IAAI;6BAmBf;AAgBa;IADb,WAAW,EAAE;;;;oCAYb;AAQa;IADb,WAAW,EAAE;;;;iCAiDb;AAQa;IADb,WAAW,EAAE;;;;iCAcb"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { AccountsRoute } from "../../ServiceRoute";
|
|
11
|
+
import Route from "../../Types/API/Route";
|
|
12
|
+
import URL from "../../Types/API/URL";
|
|
13
|
+
import OneUptimeDate from "../../Types/Date";
|
|
14
|
+
import ObjectID from "../../Types/ObjectID";
|
|
15
|
+
import EmailVerificationToken from "../../Models/DatabaseModels/EmailVerificationToken";
|
|
16
|
+
import DatabaseConfig from "../DatabaseConfig";
|
|
17
|
+
import EmailVerificationTokenService from "../Services/EmailVerificationTokenService";
|
|
18
|
+
import CaptureSpan from "./Telemetry/CaptureSpan";
|
|
19
|
+
/*
|
|
20
|
+
* An invited user exists in the database before they have ever authenticated.
|
|
21
|
+
* TeamMemberService creates the row so the membership has something to point
|
|
22
|
+
* at, and that row carries no password until the person registers.
|
|
23
|
+
*
|
|
24
|
+
* /signup is what hands that unclaimed row over, so the hand-over has to be
|
|
25
|
+
* gated on something only the mailbox owner can hold. Knowing the address is
|
|
26
|
+
* not enough: addresses at a company are guessable by construction, which is
|
|
27
|
+
* exactly how GHSA-qg84-6hrg-mr5g turned a pending invitation into an account
|
|
28
|
+
* takeover -- the guard there was `if (alreadySavedUser.password)`, and an
|
|
29
|
+
* unclaimed row's password is null, which is falsy.
|
|
30
|
+
*
|
|
31
|
+
* This token is that gate. It is minted when the invitation is sent, travels
|
|
32
|
+
* only inside the invitation email, and is spent the first time it is used.
|
|
33
|
+
*
|
|
34
|
+
* It reuses EmailVerificationToken rather than adding a table of its own: the
|
|
35
|
+
* shape is identical (user, email, opaque token, expiry) and the semantics are
|
|
36
|
+
* the same claim -- "the holder of this controls this mailbox". Spending one is
|
|
37
|
+
* therefore also proof of address ownership, which is why the signup path marks
|
|
38
|
+
* the account verified on the way through.
|
|
39
|
+
*/
|
|
40
|
+
/*
|
|
41
|
+
* Invitations are read when the person gets round to them, not when they are
|
|
42
|
+
* sent, so these live longer than the 24 hours an email-verification link gets.
|
|
43
|
+
* Expiring in a week still bounds how long a leaked invite mail stays useful.
|
|
44
|
+
*/
|
|
45
|
+
export const REGISTRATION_TOKEN_EXPIRY_IN_DAYS = 7;
|
|
46
|
+
export default class UserRegistrationToken {
|
|
47
|
+
/*
|
|
48
|
+
* Mint a token for `email` and return it. The caller is responsible for
|
|
49
|
+
* putting it somewhere only the mailbox owner will see -- which in practice
|
|
50
|
+
* means a link in an email addressed to that same mailbox, and nowhere else.
|
|
51
|
+
* It must never be written into an API response.
|
|
52
|
+
*/
|
|
53
|
+
static async generateRegistrationToken(data) {
|
|
54
|
+
const token = ObjectID.generate();
|
|
55
|
+
const emailVerificationToken = new EmailVerificationToken();
|
|
56
|
+
emailVerificationToken.userId = data.userId;
|
|
57
|
+
emailVerificationToken.email = data.email;
|
|
58
|
+
emailVerificationToken.token = token;
|
|
59
|
+
emailVerificationToken.expires = OneUptimeDate.getSomeDaysAfter(REGISTRATION_TOKEN_EXPIRY_IN_DAYS);
|
|
60
|
+
await EmailVerificationTokenService.create({
|
|
61
|
+
data: emailVerificationToken,
|
|
62
|
+
props: {
|
|
63
|
+
isRoot: true,
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
return token;
|
|
67
|
+
}
|
|
68
|
+
/*
|
|
69
|
+
* The /accounts/register link an invited person follows. The email is carried
|
|
70
|
+
* alongside the token only to prefill (and lock) the form field; the token is
|
|
71
|
+
* the part that authorizes anything.
|
|
72
|
+
*/
|
|
73
|
+
static async getRegistrationLink(data) {
|
|
74
|
+
const host = await DatabaseConfig.getHost();
|
|
75
|
+
const httpProtocol = await DatabaseConfig.getHttpProtocol();
|
|
76
|
+
return URL.fromString(new URL(httpProtocol, host, new Route(AccountsRoute.toString())).toString())
|
|
77
|
+
.addRoute("/register")
|
|
78
|
+
.addQueryParam("email", data.email.toString(), true)
|
|
79
|
+
.addQueryParam("token", data.token.toString(), true);
|
|
80
|
+
}
|
|
81
|
+
// Mint a token and build the link that carries it, in one step.
|
|
82
|
+
static async generateRegistrationLink(data) {
|
|
83
|
+
const token = await this.generateRegistrationToken({
|
|
84
|
+
userId: data.userId,
|
|
85
|
+
email: data.email,
|
|
86
|
+
});
|
|
87
|
+
return await this.getRegistrationLink({
|
|
88
|
+
email: data.email,
|
|
89
|
+
token: token,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/*
|
|
93
|
+
* Spend a token. Returns true only if it exists, was minted for this exact
|
|
94
|
+
* address, has not expired, and had not already been spent.
|
|
95
|
+
*
|
|
96
|
+
* The delete is what makes it single-use, and it is deliberately the last
|
|
97
|
+
* word: `deleteOneBy` reports how many rows it removed, so two requests
|
|
98
|
+
* racing on the same token produce exactly one winner (the loser deletes
|
|
99
|
+
* nothing and gets false back) rather than two callers who both read a live
|
|
100
|
+
* token and both proceed.
|
|
101
|
+
*
|
|
102
|
+
* Every failure returns the same `false`. The caller must not report which
|
|
103
|
+
* check failed -- "expired" and "no such token" would tell someone probing
|
|
104
|
+
* with guessed tokens which of them had ever been real.
|
|
105
|
+
*/
|
|
106
|
+
static async consumeRegistrationToken(data) {
|
|
107
|
+
const savedToken = await EmailVerificationTokenService.findOneBy({
|
|
108
|
+
query: {
|
|
109
|
+
token: data.token,
|
|
110
|
+
},
|
|
111
|
+
select: {
|
|
112
|
+
_id: true,
|
|
113
|
+
email: true,
|
|
114
|
+
expires: true,
|
|
115
|
+
},
|
|
116
|
+
props: {
|
|
117
|
+
isRoot: true,
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
if (!savedToken || !savedToken.email || !savedToken.expires) {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
/*
|
|
124
|
+
* A token is bound to the address it was mailed to. Without this, a token
|
|
125
|
+
* from any invitation the attacker had legitimately received would claim
|
|
126
|
+
* any other unclaimed account. Email lowercases on construction, so the
|
|
127
|
+
* string comparison is already case-insensitive.
|
|
128
|
+
*/
|
|
129
|
+
if (savedToken.email.toString() !== data.email.toString()) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
if (OneUptimeDate.hasExpired(savedToken.expires)) {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
const deletedCount = await EmailVerificationTokenService.deleteOneBy({
|
|
136
|
+
query: {
|
|
137
|
+
_id: savedToken._id,
|
|
138
|
+
},
|
|
139
|
+
props: {
|
|
140
|
+
isRoot: true,
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
return deletedCount === 1;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
__decorate([
|
|
147
|
+
CaptureSpan(),
|
|
148
|
+
__metadata("design:type", Function),
|
|
149
|
+
__metadata("design:paramtypes", [Object]),
|
|
150
|
+
__metadata("design:returntype", Promise)
|
|
151
|
+
], UserRegistrationToken, "generateRegistrationToken", null);
|
|
152
|
+
__decorate([
|
|
153
|
+
CaptureSpan(),
|
|
154
|
+
__metadata("design:type", Function),
|
|
155
|
+
__metadata("design:paramtypes", [Object]),
|
|
156
|
+
__metadata("design:returntype", Promise)
|
|
157
|
+
], UserRegistrationToken, "getRegistrationLink", null);
|
|
158
|
+
__decorate([
|
|
159
|
+
CaptureSpan(),
|
|
160
|
+
__metadata("design:type", Function),
|
|
161
|
+
__metadata("design:paramtypes", [Object]),
|
|
162
|
+
__metadata("design:returntype", Promise)
|
|
163
|
+
], UserRegistrationToken, "generateRegistrationLink", null);
|
|
164
|
+
__decorate([
|
|
165
|
+
CaptureSpan(),
|
|
166
|
+
__metadata("design:type", Function),
|
|
167
|
+
__metadata("design:paramtypes", [Object]),
|
|
168
|
+
__metadata("design:returntype", Promise)
|
|
169
|
+
], UserRegistrationToken, "consumeRegistrationToken", null);
|
|
170
|
+
//# sourceMappingURL=UserRegistrationToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserRegistrationToken.js","sourceRoot":"","sources":["../../../../Server/Utils/UserRegistrationToken.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAC1C,OAAO,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,sBAAsB,MAAM,oDAAoD,CAAC;AACxF,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,6BAA6B,MAAM,2CAA2C,CAAC;AACtF,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAW,CAAC,CAAC;AAE3D,MAAM,CAAC,OAAO,OAAO,qBAAqB;IACxC;;;;;OAKG;IAEiB,AAAb,M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;AAnIqB;IADnB,WAAW,EAAE;;;;4DAwBb;AAQmB;IADnB,WAAW,EAAE;;;;sDAkBb;AAImB;IADnB,WAAW,EAAE;;;;2DAcb;AAiBmB;IADnB,WAAW,EAAE;;;;2DAiDb"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { EncryptionSecret } from "../EnvironmentConfig";
|
|
2
|
+
import crypto from "crypto";
|
|
3
|
+
/*
|
|
4
|
+
* The cryptography behind notification-channel ownership checks: the codes
|
|
5
|
+
* mailed/texted/read out to a user to prove they hold the address or number
|
|
6
|
+
* they just added.
|
|
7
|
+
*
|
|
8
|
+
* This is deliberately server-only. Common/Types/Text is bundled into the
|
|
9
|
+
* dashboard and therefore has to tolerate a runtime with no CSPRNG; a code
|
|
10
|
+
* minted here has no such excuse, so nothing in this file falls back to
|
|
11
|
+
* Math.random. If the platform cannot produce secure randomness, generation
|
|
12
|
+
* throws and the channel simply cannot be added.
|
|
13
|
+
*
|
|
14
|
+
* WHY THE STORED VALUE IS A DIGEST
|
|
15
|
+
*
|
|
16
|
+
* A six-digit code is only a secret for as long as it is in flight. Storing
|
|
17
|
+
* the plaintext puts a live account-takeover token in a database column, a
|
|
18
|
+
* backup, a replica and every log line that ever dumps the row - and the
|
|
19
|
+
* column sits on a table (UserEmail and friends) whose entire access-control
|
|
20
|
+
* design exists because reading somebody else's row IS the attack. Keeping a
|
|
21
|
+
* keyed digest means a database dump alone yields nothing: the attacker also
|
|
22
|
+
* needs the deployment's EncryptionSecret, and even holding both, recovering
|
|
23
|
+
* the code means re-running the HMAC over the code space per row, because...
|
|
24
|
+
*
|
|
25
|
+
* WHY THE ROW ID IS IN THE MESSAGE
|
|
26
|
+
*
|
|
27
|
+
* ...the digest is domain-separated by the row it belongs to. Without that,
|
|
28
|
+
* one HMAC table of all 10^6 codes inverts every row in the table at once,
|
|
29
|
+
* and two rows that happened to draw the same code would be visibly equal.
|
|
30
|
+
* With it, the same code on two rows produces two unrelated digests.
|
|
31
|
+
*
|
|
32
|
+
* A fast hash is right here, unlike a password: the input is a value the
|
|
33
|
+
* server minted at random, so there is nothing to guess offline that the
|
|
34
|
+
* attempt counter is not already bounding online. The scheme version prefix
|
|
35
|
+
* is there so a future change of construction can be told apart from this one
|
|
36
|
+
* rather than silently invalidating or, worse, colliding with it.
|
|
37
|
+
*/
|
|
38
|
+
const HASH_SCHEME_VERSION = "v1";
|
|
39
|
+
/*
|
|
40
|
+
* Six digits, matching what the notification templates and the dashboard's
|
|
41
|
+
* code input already expect. The code space is small on purpose - it has to
|
|
42
|
+
* be readable off a phone screen - which is exactly why every control around
|
|
43
|
+
* it (expiry, attempt counter, lockout, rate limit) is load-bearing rather
|
|
44
|
+
* than defence in depth.
|
|
45
|
+
*/
|
|
46
|
+
export const VERIFICATION_CODE_LENGTH = 6;
|
|
47
|
+
export default class VerificationCode {
|
|
48
|
+
/*
|
|
49
|
+
* A fresh code, drawn uniformly from the whole code space.
|
|
50
|
+
*
|
|
51
|
+
* crypto.randomInt does the rejection sampling itself, so there is no modulo
|
|
52
|
+
* bias here and no need to hand-roll one. Leading zeros are kept: "000123"
|
|
53
|
+
* is a perfectly good code, and dropping them would quietly shrink the
|
|
54
|
+
* space by 10%.
|
|
55
|
+
*/
|
|
56
|
+
static generate(length = VERIFICATION_CODE_LENGTH) {
|
|
57
|
+
let code = "";
|
|
58
|
+
for (let i = 0; i < length; i++) {
|
|
59
|
+
code += crypto.randomInt(0, 10).toString();
|
|
60
|
+
}
|
|
61
|
+
return code;
|
|
62
|
+
}
|
|
63
|
+
/*
|
|
64
|
+
* The digest to store for `code` on the row identified by `channelId`.
|
|
65
|
+
*
|
|
66
|
+
* Both inputs are length-prefixed into the message rather than merely
|
|
67
|
+
* concatenated, so no pair of (id, code) values can be rearranged into the
|
|
68
|
+
* same byte string as another pair.
|
|
69
|
+
*/
|
|
70
|
+
static hashCode(data) {
|
|
71
|
+
const message = [
|
|
72
|
+
HASH_SCHEME_VERSION,
|
|
73
|
+
data.channelId.toString(),
|
|
74
|
+
data.code,
|
|
75
|
+
]
|
|
76
|
+
.map((part) => {
|
|
77
|
+
return `${part.length}:${part}`;
|
|
78
|
+
})
|
|
79
|
+
.join("");
|
|
80
|
+
return crypto
|
|
81
|
+
.createHmac("sha256", EncryptionSecret.toString())
|
|
82
|
+
.update(message)
|
|
83
|
+
.digest("hex");
|
|
84
|
+
}
|
|
85
|
+
/*
|
|
86
|
+
* Compare two digests without leaking, through timing, how many leading
|
|
87
|
+
* bytes matched.
|
|
88
|
+
*
|
|
89
|
+
* `===` on strings short-circuits at the first differing character, and the
|
|
90
|
+
* attacker here controls the plaintext that produces one side of the
|
|
91
|
+
* comparison. That is a much weaker oracle than it is for a password check -
|
|
92
|
+
* they would be recovering a digest of a value that expires in minutes - but
|
|
93
|
+
* a constant-time compare costs nothing and removes the question.
|
|
94
|
+
*
|
|
95
|
+
* Lengths are compared first. Both digests are always 64 hex characters, so
|
|
96
|
+
* an early return only happens on malformed input, where the length is not
|
|
97
|
+
* the secret.
|
|
98
|
+
*/
|
|
99
|
+
static isHashEqual(a, b) {
|
|
100
|
+
if (!a || !b || a.length !== b.length) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
return crypto.timingSafeEqual(Buffer.from(a, "utf8"), Buffer.from(b, "utf8"));
|
|
104
|
+
}
|
|
105
|
+
/*
|
|
106
|
+
* A digest that no code can ever produce, for burning the outstanding
|
|
107
|
+
* challenge.
|
|
108
|
+
*
|
|
109
|
+
* Used when a row is locked out or successfully verified. The column is NOT
|
|
110
|
+
* NULL, so "there is no live code" cannot be expressed as null; it is
|
|
111
|
+
* expressed as a digest drawn at random from a 256-bit space, which the
|
|
112
|
+
* 10^6 possible codes cannot hit. Rotating rather than leaving the old
|
|
113
|
+
* digest in place matters: it means a lockout is not merely a pause an
|
|
114
|
+
* attacker can wait out with the same target still valid behind it.
|
|
115
|
+
*/
|
|
116
|
+
static generateUnusableHash() {
|
|
117
|
+
return crypto.randomBytes(32).toString("hex");
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=VerificationCode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VerificationCode.js","sourceRoot":"","sources":["../../../../Server/Utils/VerificationCode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,MAAM,mBAAmB,GAAW,IAAI,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAW,CAAC,CAAC;AAElD,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACnC;;;;;;;OAOG;IACI,MAAM,CAAC,QAAQ,CAAC,SAAiB,wBAAwB;QAC9D,IAAI,IAAI,GAAW,EAAE,CAAC;QAEtB,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACxC,IAAI,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC7C,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,QAAQ,CAAC,IAA2C;QAChE,MAAM,OAAO,GAAW;YACtB,mBAAmB;YACnB,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE;YACzB,IAAI,CAAC,IAAI;SACV;aACE,GAAG,CAAC,CAAC,IAAY,EAAE,EAAE;YACpB,OAAO,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;QAClC,CAAC,CAAC;aACD,IAAI,CAAC,EAAE,CAAC,CAAC;QAEZ,OAAO,MAAM;aACV,UAAU,CAAC,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,EAAE,CAAC;aACjD,MAAM,CAAC,OAAO,CAAC;aACf,MAAM,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC;IAED;;;;;;;;;;;;;OAaG;IACI,MAAM,CAAC,WAAW,CAAC,CAAS,EAAE,CAAS;QAC5C,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;YACtC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,MAAM,CAAC,eAAe,CAC3B,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,EACtB,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CACvB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;OAUG;IACI,MAAM,CAAC,oBAAoB;QAChC,OAAO,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;CACF"}
|
|
@@ -4,6 +4,7 @@ var EmailTemplateType;
|
|
|
4
4
|
EmailTemplateType["ForgotPassword"] = "ForgotPassword.hbs";
|
|
5
5
|
EmailTemplateType["ProbeOffline"] = "ProbeOffline.hbs";
|
|
6
6
|
EmailTemplateType["SignupWelcomeEmail"] = "SignupWelcomeEmail.hbs";
|
|
7
|
+
EmailTemplateType["CompleteRegistration"] = "CompleteRegistration.hbs";
|
|
7
8
|
EmailTemplateType["ProbeConnectionStatusChange"] = "ProbeConnectionStatusChange.hbs";
|
|
8
9
|
EmailTemplateType["AIAgentConnectionStatusChange"] = "AIAgentConnectionStatusChange.hbs";
|
|
9
10
|
EmailTemplateType["AIAgentOwnerAdded"] = "AIAgentOwnerAdded.hbs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailTemplateType.js","sourceRoot":"","sources":["../../../../Types/Email/EmailTemplateType.ts"],"names":[],"mappings":"AAAA,IAAK,
|
|
1
|
+
{"version":3,"file":"EmailTemplateType.js","sourceRoot":"","sources":["../../../../Types/Email/EmailTemplate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CAAA;IACzD,wFAAmE,CAAA;IACnE,sFAAiE,CAAA;IAEjE,oGAA+E,CAAA;IAC/E,0FAAqE,CAAA;IACrE,wGAAmF,CAAA;IACnF,8GAAyF,CAAA;IACzF,oHAA+F,CAAA;IAC/F,0FAAqE,CAAA;IACrE,sEAAiD,CAAA;IACjD,gGAA2E,CAAA;IAC3E,wDAAmC,CAAA;IACnC,8DAAyC,CAAA;IACzC,oEAA+C,CAAA;IAC/C,8DAAyC,CAAA;IACzC,4EAAuD,CAAA;IACvD,kFAA6D,CAAA;IAE7D,4EAAuD,CAAA;IACvD,oFAA+D,CAAA;IAC/D,oFAA+D,CAAA;IAC/D,0EAAqD,CAAA;IACrD,8FAAyE,CAAA;IAEzE,kFAA6D,CAAA;IAC7D,4CAAuB,CAAA;IAEvB,gFAA2D,CAAA;IAC3D,kEAA6C,CAAA;IAC7C,wEAAmD,CAAA;IAEnD,8FAAyE,CAAA;IACzE,4FAAuE,CAAA;AACzE,CAAC,EAhGI,iBAAiB,KAAjB,iBAAiB,QAgGrB;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
export var MarketingConversionType;
|
|
2
2
|
(function (MarketingConversionType) {
|
|
3
3
|
MarketingConversionType["SignUp"] = "SignUp";
|
|
4
|
+
// A verified Cal.com booking. See Docs/analytics/enterprise-conversion-tracking.md.
|
|
5
|
+
MarketingConversionType["MeetingBooked"] = "MeetingBooked";
|
|
4
6
|
MarketingConversionType["PaidSubscription"] = "PaidSubscription";
|
|
5
7
|
})(MarketingConversionType || (MarketingConversionType = {}));
|
|
8
|
+
/*
|
|
9
|
+
* Conversion types that ad platforms have an explicit conversion-action
|
|
10
|
+
* mapping for. Every provider picks its platform conversion action by
|
|
11
|
+
* branching on SignUp vs not-SignUp, so a type that is not listed here would
|
|
12
|
+
* be uploaded as a purchase — add a type only once every provider has a
|
|
13
|
+
* mapping for it. Types left out stay ledger-only and are recorded as Skipped.
|
|
14
|
+
*/
|
|
15
|
+
export const AdUploadableMarketingConversionTypes = [MarketingConversionType.SignUp, MarketingConversionType.PaidSubscription];
|
|
6
16
|
export var MarketingConversionUploadStatus;
|
|
7
17
|
(function (MarketingConversionUploadStatus) {
|
|
8
18
|
MarketingConversionUploadStatus["Uploaded"] = "Uploaded";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarketingConversion.js","sourceRoot":"","sources":["../../../../Types/Marketing/MarketingConversion.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"MarketingConversion.js","sourceRoot":"","sources":["../../../../Types/Marketing/MarketingConversion.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,uBAKX;AALD,WAAY,uBAAuB;IACjC,4CAAiB,CAAA;IACjB,oFAAoF;IACpF,0DAA+B,CAAA;IAC/B,gEAAqC,CAAA;AACvC,CAAC,EALW,uBAAuB,KAAvB,uBAAuB,QAKlC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAC/C,CAAC,uBAAuB,CAAC,MAAM,EAAE,uBAAuB,CAAC,gBAAgB,CAAC,CAAC;AAE7E,MAAM,CAAN,IAAY,+BAKX;AALD,WAAY,+BAA+B;IACzC,wDAAqB,CAAA;IACrB,oDAAiB,CAAA;IACjB,gEAAgE;IAChE,sDAAmB,CAAA;AACrB,CAAC,EALW,+BAA+B,KAA/B,+BAA+B,QAK1C"}
|
|
@@ -328,6 +328,7 @@ export const CriteriaFilterSchema = Zod.object({
|
|
|
328
328
|
evaluateOverTimeOptions: Zod.object({
|
|
329
329
|
timeValueInMinutes: Zod.number().optional(),
|
|
330
330
|
evaluateOverTimeType: Zod.string().optional(),
|
|
331
|
+
onNoDataPolicy: Zod.string().optional(),
|
|
331
332
|
}).optional(),
|
|
332
333
|
});
|
|
333
334
|
//# sourceMappingURL=CriteriaFilter.js.map
|