@yuriai/web 0.2.40-beta.4 → 0.2.40-beta.5
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/dist/assets/{AgentAvatar-BmT_6apW.js → AgentAvatar-B7KbxN8Y.js} +1 -1
- package/dist/assets/AssistantConversationSurface-BnK_KTBO.js +3 -0
- package/dist/assets/{AssistantUnreadBadge-C34eOGCL.js → AssistantUnreadBadge-vu4ZhTft.js} +1 -1
- package/dist/assets/{AssistantView-0nXkM9VG.js → AssistantView-CEfEWUIr.js} +1 -1
- package/dist/assets/DiagramView-Dlzr08J_.js +1 -0
- package/dist/assets/{FadeInOnReveal-CCVdl9Vt.js → FadeInOnReveal-DMRmNsau.js} +1 -1
- package/dist/assets/{GuiPluginPage-BMt5AMqg.js → GuiPluginPage-DVug4z_p.js} +1 -1
- package/dist/assets/GuiPluginSurface-L43o6Xv8.js +1 -0
- package/dist/assets/{GuiPluginWindow-BVvzrnp1.js → GuiPluginWindow-tHXkS18H.js} +1 -1
- package/dist/assets/{Icon-B5nBc6dO.js → Icon-DizeYahT.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-Bv5mmf2U.js → ImageLoadingPlaceholder-BZC5m_km.js} +1 -1
- package/dist/assets/LoadingImage-Csw4L-Dr.js +1 -0
- package/dist/assets/MarkdownRenderer-D_0iKhQN.js +2 -0
- package/dist/assets/MarkdownRendererImpl-BZ0XgjS0.js +10 -0
- package/dist/assets/MarkstreamRendererImpl-DBd6Glg9.js +3 -0
- package/dist/assets/MobileDetailNavigation-xgwvsQuR.js +1 -0
- package/dist/assets/{MobileResizableSheet-D5PcZMuI.js → MobileResizableSheet-CQQ7O-2X.js} +1 -1
- package/dist/assets/MobileShareBridge-IO45gM2G.js +3 -0
- package/dist/assets/MobileSurface-DmYgZONB.js +2 -0
- package/dist/assets/{MultiRunWindow-rMqP99ID.js → MultiRunWindow-fJ3XfntS.js} +1 -1
- package/dist/assets/OnboardingScreen-MJS5T5rL.js +1 -0
- package/dist/assets/{OverlayScrollbar-Byx2H3pc.js → OverlayScrollbar-jtMYTn1y.js} +1 -1
- package/dist/assets/SettingsView-ZWFLpPSI.js +29 -0
- package/dist/assets/{SettingsWindow-U-RDDOS7.js → SettingsWindow-DGRmrIWz.js} +1 -1
- package/dist/assets/SetupTourDialog-BYbAubwA.js +1 -0
- package/dist/assets/TerminalView-CoJ6_9P1.js +8 -0
- package/dist/assets/ToolOutputDialog-5xBwOJ6a.js +16 -0
- package/dist/assets/VoiceSettings-CN33koSc.js +2 -0
- package/dist/assets/{YuriLogo-B58GIl2v.js → YuriLogo-CvyJy_R9.js} +1 -1
- package/dist/assets/YuriWordmark-DnFAS-Ko.js +1 -0
- package/dist/assets/{assistant-attachment-cache-Cmzt4xXE.js → assistant-attachment-cache-D-LmCflm.js} +1 -1
- package/dist/assets/bootstrap-eLlfzqAI.js +1 -0
- package/dist/assets/{capgoAdapter-B5NImlKh.js → capgoAdapter-CCLtBZL1.js} +1 -1
- package/dist/assets/{checkbox-Bdj4n5cI.js → checkbox-rOV6DjeG.js} +1 -1
- package/dist/assets/client-uz8O6TPX.js +7 -0
- package/dist/assets/{collapsible-D1JZOgJZ.js → collapsible-CKswuqAw.js} +1 -1
- package/dist/assets/{context-menu-DDX0ZFhc.js → context-menu-B4njwT_M.js} +1 -1
- package/dist/assets/{desktopHosts-DovfbQPm.js → desktopHosts-135cuRCE.js} +1 -1
- package/dist/assets/{desktopRelayRestore-D4pbpNKN.js → desktopRelayRestore-1aUztDPU.js} +1 -1
- package/dist/assets/{device-DNG0cNwQ.js → device-QL8KNSLM.js} +1 -1
- package/dist/assets/{diagram-C72TQWfh.js → diagram-BppQ_USn.js} +1 -1
- package/dist/assets/{dialog-CIKJalI5.js → dialog-Bg8MJnOV.js} +1 -1
- package/dist/assets/{es-D0Q_CV0t.js → es-Ba3NUCtE.js} +3 -3
- package/dist/assets/{fileMentionTouchSelection-tnd9RDDh.js → fileMentionTouchSelection-D-AdTJVr.js} +1 -1
- package/dist/assets/fileReferenceActions-cYqdsXFz.js +1 -0
- package/dist/assets/{fr-DrO5SAKl.js → fr-CRhp3hyT.js} +3 -3
- package/dist/assets/{gitApi-BI8OG_ts.js → gitApi-DVx_V1x6.js} +11 -7
- package/dist/assets/gitApiHttp-DvTBxvX8.js +3 -0
- package/dist/assets/historyImportQueries-D_9RlrLp.js +1 -0
- package/dist/assets/host-DrGjjO6K.js +1 -0
- package/dist/assets/{i18n-UaLestuf.js → i18n-RH7UieOS.js} +1 -1
- package/dist/assets/image-loading-DBqnxgDH.js +1 -0
- package/dist/assets/{input-gVHSS0EB.js → input-DRjuZMeA.js} +1 -1
- package/dist/assets/input-store-CjUOfpyA.js +1 -0
- package/dist/assets/insertionBoundaries-DZtQt2Ah.js +1 -0
- package/dist/assets/{ja-BNeP9_GU.js → ja-D-UPjDY2.js} +3 -3
- package/dist/assets/{ko-DRRFD_7l.js → ko-x-z9J5z7.js} +3 -3
- package/dist/assets/main-BMFY9mtb.js +2 -0
- package/dist/assets/main-D2s9J_jN.js +169 -0
- package/dist/assets/{markdownHeightCache-B-FoaQ1U.js → markdownHeightCache-BL99DlhC.js} +1 -1
- package/dist/assets/{markdownTheme-CHNl6tUv.js → markdownTheme-DFDWa8Gh.js} +1 -1
- package/dist/assets/mcpQueries-HzYMEVWd.js +1 -0
- package/dist/assets/miniChat-BbJ0GKpk.js +2 -0
- package/dist/assets/mobile-_zUth69Z.js +2 -0
- package/dist/assets/mobileBackNavigation--ZdrI-Yj.js +1 -0
- package/dist/assets/mobileConnections-C3eGEOPy.js +2 -0
- package/dist/assets/multirun-CDYNyLBH.js +3 -0
- package/dist/assets/{native-config-DqDXViVx.js → native-config-DOawZfln.js} +1 -1
- package/dist/assets/navigation-Ibk_Pw-q.js +2 -0
- package/dist/assets/{pl-BnW5wJrl.js → pl-Cqo1FJwM.js} +3 -3
- package/dist/assets/platform-wF65ZFgV.js +1 -0
- package/dist/assets/project-preview-2H-TmJkd.js +1 -0
- package/dist/assets/projectActions-50e_f9dI.js +1 -0
- package/dist/assets/projectMeta-D1Ytss9U.js +1 -0
- package/dist/assets/prompt-attachment-upload-BNhDXymd.js +1 -0
- package/dist/assets/{pt-BR-fZW8CCVQ.js → pt-BR-C930XU1k.js} +3 -3
- package/dist/assets/pwa-CXupOTsD.js +2 -0
- package/dist/assets/queue-abort-optimistic-CQXpIlq6.js +1 -0
- package/dist/assets/{react-DeB-Vc_L.js → react-CgRToPwO.js} +1 -1
- package/dist/assets/{readiness-CIlvQ-aQ.js → readiness-BfuZm6Yw.js} +2 -2
- package/dist/assets/relay-preview-frame-src-BPyz3nXA.js +1 -0
- package/dist/assets/remote-input-store-BOdCWpQY.js +1 -0
- package/dist/assets/remoteProjectQueries-CkxdZNw4.js +1 -0
- package/dist/assets/renderElectronMiniChatApp-pJ59iC34.js +2 -0
- package/dist/assets/renderMobileApp-BQFC-gOA.js +29 -0
- package/dist/assets/{runtime-file-download-DMY1k1af.js → runtime-file-download-D11Nnedg.js} +1 -1
- package/dist/assets/runtime-file-resource-CuLP3xp7.js +6 -0
- package/dist/assets/runtimeConfig-tHm7o_0I.js +2 -0
- package/dist/assets/{runtimeEndpointReset-BOdd_mJM.css → runtimeEndpointReset-BUGfn7y0.css} +1 -1
- package/dist/assets/runtimeEndpointReset-BhHWFNvo.js +150 -0
- package/dist/assets/safeStorage-DTOhKN0V.js +1 -0
- package/dist/assets/scheduledTaskNavigation-BIDtQ4wN.js +1 -0
- package/dist/assets/{select-BwCKwnTH.js → select-B1On-Y4Z.js} +1 -1
- package/dist/assets/sessionLookup-RcyTTDOy.js +1 -0
- package/dist/assets/sortable-tabs-strip-nD1Me06z.js +1 -0
- package/dist/assets/{speechSettingsQueries-C5mPRWIv.js → speechSettingsQueries-BYhNpzDJ.js} +1 -1
- package/dist/assets/src-BZCFf9_1.css +2 -0
- package/dist/assets/{store-CzVMz42v.js → store-DunGyOfe.js} +4 -4
- package/dist/assets/terminalApi-madXrfqA.js +1 -0
- package/dist/assets/{textarea-CaTDyZrS.js → textarea-Qt06OhhX.js} +1 -1
- package/dist/assets/{tooltip-BvZzoiqg.js → tooltip-D382RCy1.js} +1 -1
- package/dist/assets/tour-CQMBn8gJ.js +1 -0
- package/dist/assets/{types-Bm8kDgSv.js → types-CHszLAS3.js} +1 -1
- package/dist/assets/{uk-C4OKsNRv.js → uk-OXQSdzuT.js} +3 -3
- package/dist/assets/{useAppFontEffects-C9IaiJgF.js → useAppFontEffects-CqXrCJVt.js} +63 -58
- package/dist/assets/useAppFontEffects-K31q-1OV.css +1 -0
- package/dist/assets/useAssistantUIStore-jOKVcBK8.js +1 -0
- package/dist/assets/useDesktopWindowControlsLayout-KH4UP7Gj.js +1 -0
- package/dist/assets/{useDictation-Sk20Gi0T.js → useDictation-Bs7TWO9r.js} +1 -1
- package/dist/assets/useEffectiveDirectory-CCKRdyK9.js +1 -0
- package/dist/assets/useFontPreferences-CPrl1_3z.js +1 -0
- package/dist/assets/{useMobileHtmlPreviewStore-C03uVLfX.js → useMobileHtmlPreviewStore-EOAzZiAy.js} +1 -1
- package/dist/assets/useMobileNavigationStore-BNtVrnSw.js +13 -0
- package/dist/assets/usePluginsStore-bMuGciUE.js +1 -0
- package/dist/assets/useProjectRuntimeAPIs-BFCXBu2J.js +1 -0
- package/dist/assets/{useStreamingTextThrottle-CeKHHK13.js → useStreamingTextThrottle-C8xAqcgP.js} +1 -1
- package/dist/assets/{useThemeSystem-CNzUUkFn.js → useThemeSystem-C57Z9mV2.js} +1 -1
- package/dist/assets/useUIStore-Cfmg-aDQ.js +1 -0
- package/dist/assets/uuid-D-SDZijH.js +1 -0
- package/dist/assets/{vendor-base-ui-CzHs0bHY.js → vendor-base-ui-z2M4boRm.js} +1 -1
- package/dist/assets/{vendor-cmdk-C_tivUtr.js → vendor-cmdk-BgHvMv5l.js} +1 -1
- package/dist/assets/{vendor-dnd-kit-accessibility-BOtnpZt5.js → vendor-dnd-kit-accessibility-gVi9ga0x.js} +1 -1
- package/dist/assets/{vendor-dnd-kit-core-DK4OoOTr.js → vendor-dnd-kit-core-Dd5yS2-T.js} +1 -1
- package/dist/assets/{vendor-dnd-kit-sortable-Cv69eQm1.js → vendor-dnd-kit-sortable-CV-SGi8y.js} +1 -1
- package/dist/assets/{vendor-framer-motion-DDMKlXiP.js → vendor-framer-motion-CF9BQLta.js} +1 -1
- package/dist/assets/{vendor-markstream-react-6zxyQLCD.js → vendor-markstream-react-TwEpkgfP.js} +3 -3
- package/dist/assets/vendor-motion-Dv27UnOI.js +1 -0
- package/dist/assets/{vendor-pierre-diffs-BFiZ3IhI.js → vendor-pierre-diffs-tqo4Z3TC.js} +1 -1
- package/dist/assets/{vendor-react-DlzBev0S.js → vendor-react-P8wFrkcT.js} +1 -1
- package/dist/assets/{vendor-react-drawio-Dyg1-39Q.js → vendor-react-drawio-CQW1YP2l.js} +1 -1
- package/dist/assets/vendor-reactuses-core-Dyjw5sZR.js +1 -0
- package/dist/assets/{vendor-sonner-BEHGipm5.js → vendor-sonner-B5HgJenP.js} +1 -1
- package/dist/assets/{vendor-stream-diffs-wcQxoPZk.js → vendor-stream-diffs-DCMtZcS3.js} +2 -2
- package/dist/assets/vendor-tanstack-query-core-BSjXNgF_.js +1 -0
- package/dist/assets/vendor-tanstack-react-query-B-KblYBV.js +1 -0
- package/dist/assets/{vendor-tanstack-react-virtual-DSFNK3qc.js → vendor-tanstack-react-virtual-BkuqzrEV.js} +1 -1
- package/dist/assets/{vendor-zustand-vDaAPGfl.js → vendor-zustand-Cwko4FG1.js} +1 -1
- package/dist/assets/{zh-CN-ieAs59w6.js → zh-CN-B5X8yCZV.js} +3 -3
- package/dist/assets/{zh-TW-WWTW1fkP.js → zh-TW-CF6zr1fk.js} +3 -3
- package/dist/index.html +32 -27
- package/dist/mini-chat.html +32 -27
- package/dist/mobile.html +2 -2
- package/package.json +3 -2
- package/server/index.d.ts +19 -0
- package/server/index.js +35 -5
- package/server/lib/client-auth/remote-clients.js +11 -0
- package/server/lib/content-search/DOCUMENTATION.md +5 -0
- package/server/lib/content-search/routes.js +4 -0
- package/server/lib/content-search/routes.test.js +10 -0
- package/server/lib/event-stream/DOCUMENTATION.md +5 -0
- package/server/lib/event-stream/runtime.js +3 -0
- package/server/lib/event-stream/upstream-reader.js +1 -1
- package/server/lib/gui-customization/skill/references/remote-connections.md +11 -0
- package/server/lib/message-queue/DOCUMENTATION.md +4 -0
- package/server/lib/message-queue/service.js +2 -1
- package/server/lib/message-queue/service.test.js +11 -0
- package/server/lib/notifications/emitter-runtime.js +5 -0
- package/server/lib/opencode/DOCUMENTATION.md +28 -0
- package/server/lib/opencode/core-routes.js +14 -2
- package/server/lib/opencode/core-routes.test.js +28 -0
- package/server/lib/opencode/feature-routes-runtime.js +6 -1
- package/server/lib/opencode/proxy.js +1 -0
- package/server/lib/opencode/routes.js +18 -4
- package/server/lib/opencode/routes.test.js +22 -0
- package/server/lib/opencode/settings-helpers.js +26 -0
- package/server/lib/opencode/settings-helpers.test.js +20 -0
- package/server/lib/opencode/settings-runtime.js +5 -3
- package/server/lib/opencode/settings-runtime.test.js +35 -0
- package/server/lib/preview/DOCUMENTATION.md +73 -0
- package/server/lib/preview/file-preview-path.js +37 -0
- package/server/lib/preview/file-target.js +38 -0
- package/server/lib/preview/file-target.test.js +111 -0
- package/server/lib/preview/proxy-runtime.js +110 -17
- package/server/lib/projects/DOCUMENTATION.md +6 -0
- package/server/lib/relay/tunnel-host.js +1 -0
- package/server/lib/remote-hosts/DOCUMENTATION.md +269 -0
- package/server/lib/remote-hosts/configuration.js +15 -0
- package/server/lib/remote-hosts/deadline.js +22 -0
- package/server/lib/remote-hosts/deadline.test.js +64 -0
- package/server/lib/remote-hosts/fixtures/settings-server.mjs +26 -0
- package/server/lib/remote-hosts/gateway.js +644 -0
- package/server/lib/remote-hosts/json-lifecycle.test.js +55 -0
- package/server/lib/remote-hosts/preview-scope.js +23 -0
- package/server/lib/remote-hosts/relay-client.ts +3 -0
- package/server/lib/remote-hosts/routes.js +432 -0
- package/server/lib/remote-hosts/routes.test.js +1176 -0
- package/server/lib/remote-hosts/settings-production.test.js +145 -0
- package/server/lib/remote-hosts/store.js +110 -0
- package/server/lib/remote-hosts/store.test.js +33 -0
- package/server/lib/remote-hosts/transport.js +113 -0
- package/server/lib/session-folders/routes.js +1 -0
- package/server/lib/transcript-cache/DOCUMENTATION.md +4 -0
- package/server/lib/transcript-cache/routes.js +3 -0
- package/server/lib/transcript-cache/service.js +15 -0
- package/server/lib/transcript-cache/service.test.js +13 -0
- package/server/lib/ui-auth/DOCUMENTATION.md +18 -0
- package/server/lib/ui-auth/ui-auth.js +30 -2
- package/server/lib/ui-auth/ui-auth.test.js +46 -1
- package/dist/assets/AssistantConversationSurface-B-D-mLgs.js +0 -3
- package/dist/assets/DiagramView-BU6jWxKJ.js +0 -1
- package/dist/assets/GuiPluginSurface-kxAcgmf1.js +0 -1
- package/dist/assets/LoadingImage-BzBw_1lI.js +0 -1
- package/dist/assets/MarkdownRenderer-CoMohPOZ.js +0 -2
- package/dist/assets/MarkdownRendererImpl-DoZW1UKH.js +0 -10
- package/dist/assets/MarkstreamRendererImpl-B3zd5x2O.js +0 -3
- package/dist/assets/MobileDetailNavigation-bEZ_NA03.js +0 -1
- package/dist/assets/MobileShareBridge-Cjukxazk.js +0 -3
- package/dist/assets/MobileTabPageHeader-Da1maXx-.js +0 -2
- package/dist/assets/OnboardingScreen-CZhqHzAj.js +0 -1
- package/dist/assets/SettingsView-7Bea2DvF.js +0 -29
- package/dist/assets/SetupTourDialog-CKec5tUy.js +0 -1
- package/dist/assets/TerminalView-CS1oSAuY.js +0 -8
- package/dist/assets/ToolOutputDialog-BWhrFvvI.js +0 -10
- package/dist/assets/VoiceSettings-7aFmJq9Z.js +0 -2
- package/dist/assets/YuriWordmark--S-QEpRp.js +0 -1
- package/dist/assets/appThemeRegistry-LyWTE-mT.js +0 -1
- package/dist/assets/bootstrap-BhC95qVC.js +0 -1
- package/dist/assets/fileQueries-D9l0crnM.js +0 -1
- package/dist/assets/fileReferenceActions-BmquJskG.js +0 -1
- package/dist/assets/gitApiHttp-D4d-rgcR.js +0 -9
- package/dist/assets/historyImportQueries-DkB2_92i.js +0 -1
- package/dist/assets/host-kMLXU0hK.js +0 -1
- package/dist/assets/image-loading-BrDob6MW.js +0 -1
- package/dist/assets/insertionBoundaries-B-yZI6iY.js +0 -1
- package/dist/assets/main-BfAN93rT.js +0 -169
- package/dist/assets/main-DYWwmI_W.js +0 -2
- package/dist/assets/mcpQueries-CehWHIB1.js +0 -1
- package/dist/assets/miniChat-BlkcLQBr.js +0 -2
- package/dist/assets/mobile-I3Xe5NtO.js +0 -2
- package/dist/assets/mobileBackNavigation-BFUH-c-G.js +0 -1
- package/dist/assets/mobileConnections-BFvtbJXX.js +0 -2
- package/dist/assets/multirun-DdEjp77z.js +0 -3
- package/dist/assets/pathNormalization-ewtPqJWn.js +0 -1
- package/dist/assets/platform-DMsFWy1a.js +0 -1
- package/dist/assets/projectActions-C-9Z8R7y.js +0 -1
- package/dist/assets/projectMeta-BKgum5WN.js +0 -1
- package/dist/assets/pwa-BvKUY4Hk.js +0 -2
- package/dist/assets/queue-abort-optimistic-BcbiNk8t.js +0 -1
- package/dist/assets/renderElectronMiniChatApp-DIjWdFHu.js +0 -2
- package/dist/assets/renderMobileApp-CE0QyOH0.js +0 -29
- package/dist/assets/runtime-file-resource-CL7EVzOG.js +0 -2
- package/dist/assets/runtimeConfig-uhjQn4kK.js +0 -2
- package/dist/assets/runtimeEndpointReset-DezNESKT.js +0 -149
- package/dist/assets/scheduledTaskNavigation-FMDNRUnX.js +0 -1
- package/dist/assets/sessionLookup-DzKZsy-W.js +0 -1
- package/dist/assets/sortable-tabs-strip-m5JQrTx4.js +0 -1
- package/dist/assets/src-HgtAe3Q4.css +0 -2
- package/dist/assets/terminalApi-DK4KmfFn.js +0 -1
- package/dist/assets/touch-gestures-CErgaXZ7.js +0 -1
- package/dist/assets/tour-DDI0Zg7l.js +0 -1
- package/dist/assets/useAppFontEffects-RpgNbjA4.css +0 -1
- package/dist/assets/useAssistantUIStore-nNYL140o.js +0 -1
- package/dist/assets/useDesktopWindowControlsLayout-C3M12PjJ.js +0 -1
- package/dist/assets/useEffectiveDirectory-Do4UqfZR.js +0 -1
- package/dist/assets/useFontPreferences-DxzruDDQ.js +0 -1
- package/dist/assets/useMobileNavigationStore-InwdmuDX.js +0 -17
- package/dist/assets/usePluginsStore-BH4-CNcj.js +0 -1
- package/dist/assets/useUIStore-vvNwcOk3.js +0 -1
- package/dist/assets/useWorkerHighlightedLines-0XahwAbS.js +0 -7
- package/dist/assets/vendor-motion-C9oiAdx-.js +0 -1
- package/dist/assets/vendor-reactuses-core-CuTmqEMK.js +0 -1
- package/dist/assets/vendor-tanstack-query-core-Y_YoRHtC.js +0 -1
- package/dist/assets/vendor-tanstack-react-query-B-Wpqq5J.js +0 -1
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { it, expect, vi } from 'vitest';
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import http from 'node:http';
|
|
6
|
+
import { fork } from 'node:child_process';
|
|
7
|
+
import { once } from 'node:events';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { createProjectIdFromPath } from '../projects/project-id.js';
|
|
10
|
+
|
|
11
|
+
it('production bootstrap discovers cross-client references and persists Hub-only layout across restart, partition and failure', async () => {
|
|
12
|
+
const root = await fs.mkdtemp(path.join(os.tmpdir(), 'remote-settings-production-'));
|
|
13
|
+
const otherRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'remote-settings-other-'));
|
|
14
|
+
const children = new Set();
|
|
15
|
+
const streams = new Set();
|
|
16
|
+
const remoteRequests = [];
|
|
17
|
+
const upstream = http.createServer(async (req, res) => {
|
|
18
|
+
const pathname = new URL(req.url, 'http://fixture.invalid').pathname;
|
|
19
|
+
const reply = (body, status = 200) => { res.writeHead(status, { 'content-type': 'application/json' }); res.end(JSON.stringify(body)); };
|
|
20
|
+
if (req.headers.authorization === 'Bearer fixture-remote') remoteRequests.push([req.method, pathname]);
|
|
21
|
+
if (pathname === '/api/info' || pathname === '/health') return reply({ version: '2.2.1', healthy: true });
|
|
22
|
+
if (pathname === '/api/hosts/capabilities') return reply({ remoteProjects: true, protocol: 1, instanceId: 'fixture' });
|
|
23
|
+
if (pathname === '/api/projects' && req.method === 'POST') {
|
|
24
|
+
let raw = ''; for await (const chunk of req) raw += chunk;
|
|
25
|
+
const input = JSON.parse(raw);
|
|
26
|
+
return reply({ project: { id: `remote-${input.path}`, path: input.path }, created: true });
|
|
27
|
+
}
|
|
28
|
+
if (['/api/event', '/api/global/event', '/api/hosts/status-stream'].includes(pathname)) {
|
|
29
|
+
res.writeHead(200, { 'content-type': 'text/event-stream' }); res.write(': ready\n\n');
|
|
30
|
+
const timer = setInterval(() => res.write(': heartbeat\n\n'), 100);
|
|
31
|
+
streams.add(res); res.on('close', () => { clearInterval(timer); streams.delete(res); }); return;
|
|
32
|
+
}
|
|
33
|
+
if (pathname === '/api/git/worktrees') return reply([]);
|
|
34
|
+
if (pathname === '/api/yuri/session-index/sync') { for await (const chunk of req) void chunk; return reply({}, 202); }
|
|
35
|
+
if (pathname === '/api/yuri/session-index') return reply({ directories: [], pinnedSessionIds: [] });
|
|
36
|
+
return reply({}, 404);
|
|
37
|
+
});
|
|
38
|
+
await new Promise(resolve => upstream.listen(0, '127.0.0.1', resolve));
|
|
39
|
+
const upstreamOrigin = `http://127.0.0.1:${upstream.address().port}`;
|
|
40
|
+
const start = async directory => {
|
|
41
|
+
const child = fork(path.join(path.dirname(fileURLToPath(import.meta.url)), 'fixtures/settings-server.mjs'), [], { stdio: ['ignore', 'ignore', 'pipe', 'ipc'] });
|
|
42
|
+
children.add(child);
|
|
43
|
+
let errors = ''; child.stderr.on('data', value => { errors += value; });
|
|
44
|
+
const ready = new Promise((resolve, reject) => {
|
|
45
|
+
child.on('message', message => { if (message.tokens) resolve(message); });
|
|
46
|
+
child.once('exit', code => reject(new Error(`server exited ${code}: ${errors}`)));
|
|
47
|
+
});
|
|
48
|
+
child.send({ root: directory, upstream: upstreamOrigin,
|
|
49
|
+
hosts: ['one', 'two'].map(id => ({ id, name: id, source: 'direct', apiUrl: upstreamOrigin, clientToken: 'fixture-remote' })) });
|
|
50
|
+
const info = await ready;
|
|
51
|
+
const request = async (route, body, client = 0, method = body === undefined ? 'GET' : 'PUT') => {
|
|
52
|
+
const response = await fetch(info.origin + route, { method,
|
|
53
|
+
signal: AbortSignal.timeout(5000),
|
|
54
|
+
headers: { authorization: `Bearer ${info.tokens[client]}`, 'content-type': 'application/json' },
|
|
55
|
+
...(body === undefined ? {} : { body: JSON.stringify(body) }) });
|
|
56
|
+
return { status: response.status, body: response.status === 204 ? null : await response.json() };
|
|
57
|
+
};
|
|
58
|
+
const stop = async () => { const exit = once(child, 'exit'); child.send('stop'); await exit; children.delete(child); };
|
|
59
|
+
return { ...info, request, stop };
|
|
60
|
+
};
|
|
61
|
+
try {
|
|
62
|
+
let a = await start(root);
|
|
63
|
+
expect((await a.request('/api/config/settings/bootstrap')).body.hasRemoteProjects).toBe(false);
|
|
64
|
+
expect((await a.request('/api/config/settings?bootstrap=true')).body.hasRemoteProjects).toBe(false);
|
|
65
|
+
const controller = new AbortController();
|
|
66
|
+
let frames = '';
|
|
67
|
+
const stream = await fetch(a.origin + '/api/global/event', { headers: { authorization: `Bearer ${a.tokens[1]}` },
|
|
68
|
+
signal: AbortSignal.any([controller.signal, AbortSignal.timeout(10000)]) });
|
|
69
|
+
const consuming = (async () => { for await (const data of stream.body) frames += Buffer.from(data).toString(); })().catch(() => {});
|
|
70
|
+
await new Promise(resolve => setTimeout(resolve, 150));
|
|
71
|
+
expect(remoteRequests).toEqual([]);
|
|
72
|
+
const first = await a.request('/api/hosts/one/projects', { path: '/remote/does-not-exist-on-hub' }, 0, 'POST');
|
|
73
|
+
expect(first.status).toBe(200);
|
|
74
|
+
await vi.waitFor(() => expect(frames).toContain('yuri:project-order-changed'));
|
|
75
|
+
expect((await a.request('/api/config/settings/bootstrap', undefined, 1)).body.hasRemoteProjects).toBe(true);
|
|
76
|
+
const second = await a.request('/api/hosts/two/projects', { path: '/other/remote' }, 0, 'POST');
|
|
77
|
+
expect(second.status).toBe(200);
|
|
78
|
+
const local = { id: createProjectIdFromPath(root), path: root };
|
|
79
|
+
expect((await a.request('/api/config/settings', { projects: [local] })).status).toBe(200);
|
|
80
|
+
const original = (await a.request('/api/config/settings')).body;
|
|
81
|
+
const hubId = original.hubProjectLayout.hubId;
|
|
82
|
+
const layout = { hubId, order: [first.body.project.id, local.id, second.body.project.id], collapsed: { [first.body.project.id]: true, [local.id]: false } };
|
|
83
|
+
const beforeLayout = remoteRequests.length;
|
|
84
|
+
const tipCount = () => (frames.match(/yuri:project-order-changed/g) || []).length;
|
|
85
|
+
await vi.waitFor(() => expect(tipCount()).toBeGreaterThanOrEqual(3));
|
|
86
|
+
const beforeLayoutTips = tipCount();
|
|
87
|
+
expect((await a.request('/api/config/settings', { hubProjectLayout: layout })).body.hubProjectLayout).toEqual(layout);
|
|
88
|
+
await vi.waitFor(() => expect(tipCount()).toBeGreaterThan(beforeLayoutTips));
|
|
89
|
+
expect((await a.request('/api/config/settings', undefined, 1)).body.hubProjectLayout).toEqual(layout);
|
|
90
|
+
expect(remoteRequests.slice(beforeLayout).some(([, p]) => p === '/api/config/settings')).toBe(false);
|
|
91
|
+
const partial = await a.request('/api/config/settings', { hubProjectLayout: { hubId, order: [local.id], collapsed: { [local.id]: true } } }, 1);
|
|
92
|
+
const merged = { hubId, order: [local.id, first.body.project.id, second.body.project.id], collapsed: { [first.body.project.id]: true, [local.id]: true } };
|
|
93
|
+
expect(partial.body.hubProjectLayout).toEqual(merged);
|
|
94
|
+
expect(partial.body.projects).toEqual(original.projects);
|
|
95
|
+
expect((await a.request('/api/hosts/projects')).body.projects).toHaveLength(2);
|
|
96
|
+
await new Promise(resolve => setTimeout(resolve, 25));
|
|
97
|
+
const beforeInvalidTips = tipCount();
|
|
98
|
+
expect((await a.request('/api/config/settings', { hubProjectLayout: { ...layout, hubId: 'other-hub' } })).status).toBe(409);
|
|
99
|
+
expect((await a.request('/api/config/settings', { hubProjectLayout: { hubId, order: ['/bad'], collapsed: [] } })).status).toBe(400);
|
|
100
|
+
expect((await a.request('/api/config/settings', { hasRemoteProjects: false })).body.hasRemoteProjects).toBe(true);
|
|
101
|
+
const settingsPath = path.join(root, 'hub', 'settings.json');
|
|
102
|
+
const saved = await fs.readFile(settingsPath, 'utf8');
|
|
103
|
+
await fs.rename(settingsPath, settingsPath + '.backup'); await fs.mkdir(settingsPath);
|
|
104
|
+
expect((await a.request('/api/config/settings', { hubProjectLayout: layout })).status).toBe(500);
|
|
105
|
+
await fs.rmdir(settingsPath); await fs.rename(settingsPath + '.backup', settingsPath);
|
|
106
|
+
expect(await fs.readFile(settingsPath, 'utf8')).toBe(saved);
|
|
107
|
+
expect((await a.request('/api/config/settings')).body.hubProjectLayout).toEqual(merged);
|
|
108
|
+
await new Promise(resolve => setTimeout(resolve, 25));
|
|
109
|
+
expect(tipCount()).toBe(beforeInvalidTips);
|
|
110
|
+
controller.abort(); await consuming; await a.stop();
|
|
111
|
+
a = await start(root);
|
|
112
|
+
expect((await a.request('/api/config/settings/bootstrap')).body.hasRemoteProjects).toBe(true);
|
|
113
|
+
expect((await a.request('/api/config/settings')).body.hubProjectLayout).toEqual(merged);
|
|
114
|
+
const lastController = new AbortController();
|
|
115
|
+
let lastFrames = '';
|
|
116
|
+
const lastStream = await fetch(a.origin + '/api/global/event', {
|
|
117
|
+
headers: { authorization: `Bearer ${a.tokens[1]}` }, signal: AbortSignal.any([lastController.signal, AbortSignal.timeout(10000)]) });
|
|
118
|
+
const lastConsuming = (async () => { for await (const data of lastStream.body) lastFrames += Buffer.from(data).toString(); })().catch(() => {});
|
|
119
|
+
const b = await start(otherRoot);
|
|
120
|
+
const other = (await b.request('/api/config/settings')).body;
|
|
121
|
+
expect(other.hubProjectLayout.hubId).not.toBe(hubId);
|
|
122
|
+
expect(other.hubProjectLayout.order).toEqual([]);
|
|
123
|
+
expect(other.hasRemoteProjects).toBe(false);
|
|
124
|
+
expect((await b.request('/api/config/settings', { hubProjectLayout: merged })).status).toBe(409);
|
|
125
|
+
await b.stop();
|
|
126
|
+
expect((await a.request(`/api/hosts/one/projects/${first.body.project.id}`, undefined, 0, 'DELETE')).status).toBe(204);
|
|
127
|
+
await vi.waitFor(() => expect(lastFrames).toContain('yuri:project-order-changed'));
|
|
128
|
+
const firstDeleteTips = (lastFrames.match(/yuri:project-order-changed/g) || []).length;
|
|
129
|
+
expect((await a.request('/api/config/settings/bootstrap', undefined, 1)).body.hasRemoteProjects).toBe(true);
|
|
130
|
+
expect((await a.request(`/api/hosts/two/projects/${second.body.project.id}`, undefined, 0, 'DELETE')).status).toBe(204);
|
|
131
|
+
await vi.waitFor(() => expect((lastFrames.match(/yuri:project-order-changed/g) || []).length).toBeGreaterThan(firstDeleteTips));
|
|
132
|
+
expect((await a.request('/api/config/settings/bootstrap', undefined, 1)).body.hasRemoteProjects).toBe(false);
|
|
133
|
+
expect((await a.request('/api/config/settings')).body.projects).toEqual(original.projects);
|
|
134
|
+
lastController.abort(); await lastConsuming;
|
|
135
|
+
const afterLast = remoteRequests.length;
|
|
136
|
+
await new Promise(resolve => setTimeout(resolve, 150));
|
|
137
|
+
expect(remoteRequests.length).toBe(afterLast);
|
|
138
|
+
await a.stop();
|
|
139
|
+
} finally {
|
|
140
|
+
for (const child of children) { child.kill('SIGTERM'); await once(child, 'exit'); }
|
|
141
|
+
for (const stream of streams) stream.destroy();
|
|
142
|
+
upstream.closeAllConnections(); await new Promise(resolve => upstream.close(resolve));
|
|
143
|
+
await fs.rm(root, { recursive: true, force: true }); await fs.rm(otherRoot, { recursive: true, force: true });
|
|
144
|
+
}
|
|
145
|
+
}, 90000);
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
|
|
4
|
+
const require = createRequire(import.meta.url);
|
|
5
|
+
const metadataKeys = ['label', 'icon', 'iconImage', 'iconBackground', 'color'];
|
|
6
|
+
export const projectMetadata = (value) => Object.fromEntries(metadataKeys
|
|
7
|
+
.filter((key) => Object.hasOwn(value || {}, key)).map((key) => [key, value[key]]));
|
|
8
|
+
|
|
9
|
+
// This database has deliberately no message/part/body columns. Only the remote
|
|
10
|
+
// authority's presentation metadata and connection receipts can cross this seam.
|
|
11
|
+
export function createRemoteHostStore(dbPath) {
|
|
12
|
+
const Database = require('better-sqlite3');
|
|
13
|
+
const db = new Database(dbPath);
|
|
14
|
+
db.pragma('journal_mode = WAL');
|
|
15
|
+
db.exec(`CREATE TABLE IF NOT EXISTS remote_project (
|
|
16
|
+
id TEXT PRIMARY KEY, host_id TEXT NOT NULL, path TEXT NOT NULL,
|
|
17
|
+
remote_project_id TEXT NOT NULL, metadata TEXT NOT NULL, state TEXT NOT NULL,
|
|
18
|
+
added_at INTEGER NOT NULL, UNIQUE(host_id, path));
|
|
19
|
+
CREATE TABLE IF NOT EXISTS remote_host_receipt (
|
|
20
|
+
host_id TEXT PRIMARY KEY, connected_at INTEGER, synced_at INTEGER,
|
|
21
|
+
error_code TEXT, error_message TEXT);
|
|
22
|
+
CREATE TABLE IF NOT EXISTS remote_hub_identity (id TEXT PRIMARY KEY);`);
|
|
23
|
+
db.exec(`CREATE TABLE IF NOT EXISTS remote_organization (
|
|
24
|
+
host_id TEXT NOT NULL, kind TEXT NOT NULL, snapshot TEXT NOT NULL, PRIMARY KEY(host_id, kind));`);
|
|
25
|
+
db.exec('CREATE TABLE IF NOT EXISTS remote_host_display (id TEXT PRIMARY KEY, name TEXT NOT NULL, source TEXT NOT NULL)');
|
|
26
|
+
db.prepare('INSERT INTO remote_hub_identity(id) SELECT ? WHERE NOT EXISTS (SELECT 1 FROM remote_hub_identity)')
|
|
27
|
+
.run(crypto.randomUUID());
|
|
28
|
+
const hubId = db.prepare('SELECT id FROM remote_hub_identity').get().id;
|
|
29
|
+
const decode = (row) => row && ({ id: row.id, hostId: row.host_id, path: row.path,
|
|
30
|
+
remoteProjectId: row.remote_project_id, remoteState: row.state,
|
|
31
|
+
...JSON.parse(row.metadata), addedAt: row.added_at, lastOpenedAt: row.added_at });
|
|
32
|
+
const projects = (hostId) => (hostId
|
|
33
|
+
? db.prepare('SELECT * FROM remote_project WHERE host_id = ? ORDER BY added_at, id').all(hostId)
|
|
34
|
+
: db.prepare('SELECT * FROM remote_project ORDER BY added_at, id').all()).map(decode);
|
|
35
|
+
return {
|
|
36
|
+
hubId, projects,
|
|
37
|
+
hasProjects() { return Boolean(db.prepare('SELECT 1 FROM remote_project LIMIT 1').get()); },
|
|
38
|
+
saveHost(host) {
|
|
39
|
+
db.prepare(`INSERT INTO remote_host_display VALUES (?, ?, ?) ON CONFLICT(id) DO UPDATE SET name=excluded.name,
|
|
40
|
+
source=excluded.source WHERE name != excluded.name OR source != excluded.source`)
|
|
41
|
+
.run(host.id, host.name || host.label || host.id, host.source);
|
|
42
|
+
},
|
|
43
|
+
savedHosts() { return db.prepare('SELECT id, name, source FROM remote_host_display').all(); },
|
|
44
|
+
organization(hostId) {
|
|
45
|
+
return Object.fromEntries(db.prepare('SELECT kind, snapshot FROM remote_organization WHERE host_id = ?').all(hostId)
|
|
46
|
+
.map((row) => [row.kind, JSON.parse(row.snapshot)]));
|
|
47
|
+
},
|
|
48
|
+
saveOrganization(hostId, kind, input) {
|
|
49
|
+
const text = (value) => typeof value === 'string' ? value.slice(0, 4096) : '';
|
|
50
|
+
let snapshot;
|
|
51
|
+
if (kind === 'unread') snapshot = { revision: Number(input.revision) || 0,
|
|
52
|
+
sessions: Object.fromEntries(Object.entries(input.sessions || {}).map(([id, row]) => [text(id), {
|
|
53
|
+
directory: text(row.directory), unreadCount: Number(row.unreadCount) || 0, hasError: row.hasError === true,
|
|
54
|
+
manual: row.manual === true, revision: Number(row.revision) || 0,
|
|
55
|
+
}])) };
|
|
56
|
+
if (kind === 'folders') snapshot = { version: 1, updatedAt: Number(input.updatedAt) || 0,
|
|
57
|
+
foldersMap: Object.fromEntries(Object.entries(input.foldersMap || {}).filter(([, rows]) => Array.isArray(rows))
|
|
58
|
+
.map(([scope, rows]) => [text(scope), rows.map((row) => ({ id: text(row.id), name: text(row.name),
|
|
59
|
+
sessionIds: (row.sessionIds || []).filter((id) => typeof id === 'string').map(text),
|
|
60
|
+
createdAt: Number(row.createdAt) || 0, parentId: row.parentId ? text(row.parentId) : null }))])),
|
|
61
|
+
collapsedFolderIds: (input.collapsedFolderIds || []).filter((id) => typeof id === 'string').map(text) };
|
|
62
|
+
if (kind === 'order') snapshot = { revision: Number(input.revision) || 0,
|
|
63
|
+
sessionOrderByScope: Object.fromEntries(Object.entries(input.sessionOrderByScope || {}).filter(([, rows]) => Array.isArray(rows))
|
|
64
|
+
.map(([scope, rows]) => [text(scope), rows.filter((id) => typeof id === 'string').map(text)])),
|
|
65
|
+
sessionOrderActivityByScope: Object.fromEntries(Object.entries(input.sessionOrderActivityByScope || {})
|
|
66
|
+
.map(([scope, values]) => [text(scope), Object.fromEntries(Object.entries(values || {})
|
|
67
|
+
.filter(([, value]) => typeof value === 'number' && Number.isFinite(value)))])) };
|
|
68
|
+
if (kind === 'worktrees') snapshot = {
|
|
69
|
+
projectDirectories: Object.fromEntries(Object.entries(input.projectDirectories || {}).filter(([, rows]) => Array.isArray(rows))
|
|
70
|
+
.map(([root, rows]) => [text(root), [...new Set(rows.filter((value) => typeof value === 'string' && value).map(text))]])),
|
|
71
|
+
staleProjectDirectories: (input.staleProjectDirectories || []).filter((value) => typeof value === 'string').map(text),
|
|
72
|
+
};
|
|
73
|
+
if (!snapshot) throw new Error('Invalid organization kind');
|
|
74
|
+
db.prepare('INSERT OR REPLACE INTO remote_organization VALUES (?, ?, ?)').run(hostId, kind, JSON.stringify(snapshot));
|
|
75
|
+
},
|
|
76
|
+
saveProject(hostId, remote) {
|
|
77
|
+
const prior = projects(hostId).find((p) => p.path === remote.path);
|
|
78
|
+
const id = prior?.id || `remote-${crypto.createHash('sha256').update(JSON.stringify([hubId, hostId, remote.path])).digest('hex').slice(0, 24)}`;
|
|
79
|
+
db.prepare(`INSERT INTO remote_project VALUES (?, ?, ?, ?, ?, 'ok', ?)
|
|
80
|
+
ON CONFLICT(host_id, path) DO UPDATE SET remote_project_id=excluded.remote_project_id,
|
|
81
|
+
metadata=excluded.metadata, state='ok'`).run(id, hostId, remote.path, remote.id,
|
|
82
|
+
JSON.stringify(projectMetadata(remote)), prior?.addedAt || Date.now());
|
|
83
|
+
return projects(hostId).find((p) => p.id === id);
|
|
84
|
+
},
|
|
85
|
+
refreshProject(reference, remote) {
|
|
86
|
+
if (remote?.path !== reference.path || !remote?.id || remote.hostId) return null;
|
|
87
|
+
const updated = db.prepare(`UPDATE remote_project SET remote_project_id = ?, metadata = ?, state = 'ok'
|
|
88
|
+
WHERE id = ? AND host_id = ? AND path = ? AND added_at = ? AND remote_project_id = ?`).run(remote.id,
|
|
89
|
+
JSON.stringify(projectMetadata(remote)), reference.id, reference.hostId, reference.path, reference.addedAt, reference.remoteProjectId);
|
|
90
|
+
return updated.changes ? projects(reference.hostId).find((p) => p.id === reference.id) : null;
|
|
91
|
+
},
|
|
92
|
+
markProject(id, state) { db.prepare('UPDATE remote_project SET state = ? WHERE id = ?').run(state, id); },
|
|
93
|
+
removeProject(hostId, id) { return db.prepare('DELETE FROM remote_project WHERE host_id = ? AND id = ?').run(hostId, id).changes > 0; },
|
|
94
|
+
receipt(hostId) {
|
|
95
|
+
const row = db.prepare('SELECT * FROM remote_host_receipt WHERE host_id = ?').get(hostId);
|
|
96
|
+
return row ? { lastConnectedAt: row.connected_at || undefined, lastSyncedAt: row.synced_at || undefined,
|
|
97
|
+
...(row.error_code ? { lastError: { code: row.error_code, message: row.error_message } } : {}) } : {};
|
|
98
|
+
},
|
|
99
|
+
saveReceipt(hostId, input) {
|
|
100
|
+
const previous = this.receipt(hostId);
|
|
101
|
+
const value = { ...previous, ...input };
|
|
102
|
+
db.prepare(`INSERT INTO remote_host_receipt VALUES (?, ?, ?, ?, ?)
|
|
103
|
+
ON CONFLICT(host_id) DO UPDATE SET connected_at=excluded.connected_at,
|
|
104
|
+
synced_at=excluded.synced_at, error_code=excluded.error_code, error_message=excluded.error_message`)
|
|
105
|
+
.run(hostId, value.lastConnectedAt || null, value.lastSyncedAt || null,
|
|
106
|
+
value.lastError?.code || null, value.lastError?.message || null);
|
|
107
|
+
},
|
|
108
|
+
close() { db.close(); },
|
|
109
|
+
};
|
|
110
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { it, expect, vi } from 'vitest';
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import { createRemoteHostStore } from './store.js';
|
|
6
|
+
|
|
7
|
+
it('projects the SQLite hint and never revives a removed or replaced reference during metadata refresh', async () => {
|
|
8
|
+
const root = await fs.mkdtemp(path.join(os.tmpdir(), 'remote-store-refresh-'));
|
|
9
|
+
const dbPath = path.join(root, 'remote.sqlite');
|
|
10
|
+
let store = createRemoteHostStore(dbPath);
|
|
11
|
+
const now = vi.spyOn(Date, 'now').mockReturnValue(100);
|
|
12
|
+
try {
|
|
13
|
+
expect(store.hasProjects()).toBe(false);
|
|
14
|
+
const remote = { id: 'project', path: '/remote-only', label: 'original' };
|
|
15
|
+
const reference = store.saveProject('host', remote);
|
|
16
|
+
const hubId = store.hubId;
|
|
17
|
+
expect(store.hasProjects()).toBe(true);
|
|
18
|
+
expect(store.refreshProject(reference, { ...remote, label: 'updated' }).label).toBe('updated');
|
|
19
|
+
expect(store.refreshProject({ ...reference, remoteProjectId: 'stale-remote-id' }, remote)).toBeNull();
|
|
20
|
+
store.removeProject('host', reference.id);
|
|
21
|
+
expect(store.refreshProject(reference, { ...remote, label: 'late' })).toBeNull();
|
|
22
|
+
expect(store.hasProjects()).toBe(false);
|
|
23
|
+
now.mockReturnValue(200);
|
|
24
|
+
const replacement = store.saveProject('host', { ...remote, label: 'new association' });
|
|
25
|
+
expect(replacement.id).toBe(reference.id);
|
|
26
|
+
expect(store.refreshProject(reference, { ...remote, label: 'stale' })).toBeNull();
|
|
27
|
+
expect(store.projects()[0].label).toBe('new association');
|
|
28
|
+
expect(store.refreshProject(replacement, { ...remote, path: '/wrong-path' })).toBeNull();
|
|
29
|
+
store.close(); store = createRemoteHostStore(dbPath);
|
|
30
|
+
expect(store.hubId).toBe(hubId); expect(store.hasProjects()).toBe(true);
|
|
31
|
+
store.removeProject('host', replacement.id); expect(store.hasProjects()).toBe(false);
|
|
32
|
+
} finally { now.mockRestore(); store.close(); await fs.rm(root, { recursive: true, force: true }); }
|
|
33
|
+
});
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { WebSocket } from 'ws';
|
|
2
|
+
import { remoteDeadlineSignal } from './deadline.js';
|
|
3
|
+
|
|
4
|
+
const failure = (code, status = 503) => Object.assign(new Error(code), { code, status });
|
|
5
|
+
const directUrl = (value) => {
|
|
6
|
+
try {
|
|
7
|
+
const url = new URL(value);
|
|
8
|
+
return ['http:', 'https:'].includes(url.protocol) && !url.username && !url.password ? url : null;
|
|
9
|
+
} catch { return null; }
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export async function createRemoteTransport(host, { fetchImpl = fetch, signal } = {}) {
|
|
13
|
+
const boundedSignal = (ms) => remoteDeadlineSignal(ms, signal ? [signal] : []);
|
|
14
|
+
const token = host.clientToken;
|
|
15
|
+
if (!token) throw failure('remote_authorization_required', 401);
|
|
16
|
+
const headers = { ...host.requestHeaders, Authorization: `Bearer ${token}` };
|
|
17
|
+
let base = directUrl(host.apiUrl || host.url);
|
|
18
|
+
let capabilities;
|
|
19
|
+
const readAdmission = async (response) => {
|
|
20
|
+
if (response.status === 401 || response.status === 403) throw failure('remote_authorization_required', response.status);
|
|
21
|
+
const capability = response.ok ? await response.json().catch(() => null) : null;
|
|
22
|
+
if (!capability?.remoteProjects || capability.protocol !== 1 || !capability.instanceId) throw failure('remote_incompatible', 409);
|
|
23
|
+
return capability;
|
|
24
|
+
};
|
|
25
|
+
// A learned direct address must prove identity before it receives a secret.
|
|
26
|
+
if (base && host.relay) {
|
|
27
|
+
try {
|
|
28
|
+
const health = await fetchImpl(new URL('/health', base), { redirect: 'error', signal: boundedSignal(2000) });
|
|
29
|
+
if (!health.ok || (await health.json()).serverId !== host.relay.serverId) base = null;
|
|
30
|
+
} catch { base = null; }
|
|
31
|
+
}
|
|
32
|
+
if (base) {
|
|
33
|
+
try {
|
|
34
|
+
const response = await fetchImpl(new URL('/api/hosts/capabilities', base), {
|
|
35
|
+
headers, redirect: 'error', signal: boundedSignal(3000),
|
|
36
|
+
});
|
|
37
|
+
capabilities = await readAdmission(response);
|
|
38
|
+
} catch (error) {
|
|
39
|
+
if (error.code === 'remote_incompatible') throw error;
|
|
40
|
+
if (!host.relay) throw error;
|
|
41
|
+
base = null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (base) {
|
|
45
|
+
const sockets = new Set();
|
|
46
|
+
let closed = false;
|
|
47
|
+
const close = () => {
|
|
48
|
+
if (closed) return;
|
|
49
|
+
closed = true; signal?.removeEventListener('abort', close);
|
|
50
|
+
for (const socket of sockets) socket.terminate();
|
|
51
|
+
sockets.clear();
|
|
52
|
+
};
|
|
53
|
+
signal?.addEventListener('abort', close, { once: true });
|
|
54
|
+
if (signal?.aborted) close();
|
|
55
|
+
return {
|
|
56
|
+
capabilities,
|
|
57
|
+
fetch: (route, init = {}) => {
|
|
58
|
+
if (closed) throw failure('stale_host', 409);
|
|
59
|
+
return fetchImpl(new URL(route, base), { ...init,
|
|
60
|
+
signal: AbortSignal.any([...(signal ? [signal] : []), ...(init.signal ? [init.signal] : [])]),
|
|
61
|
+
redirect: 'manual', headers: { ...init.headers, ...headers } });
|
|
62
|
+
},
|
|
63
|
+
openWebSocket(route, protocols = [], { onMessage } = {}) {
|
|
64
|
+
if (closed) throw failure('stale_host', 409);
|
|
65
|
+
const url = new URL(route, base);
|
|
66
|
+
url.protocol = url.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
67
|
+
const socket = new WebSocket(url, protocols, { headers });
|
|
68
|
+
socket.onmessage = onMessage || null;
|
|
69
|
+
sockets.add(socket);
|
|
70
|
+
socket.once('close', () => sockets.delete(socket));
|
|
71
|
+
socket.on('error', () => {});
|
|
72
|
+
socket.binaryType = 'arraybuffer';
|
|
73
|
+
return socket;
|
|
74
|
+
},
|
|
75
|
+
close,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
if (!host.relay || (host.source === 'ssh' && host.pairingSource !== 'connect-link')) {
|
|
79
|
+
throw failure('remote_transport_unavailable');
|
|
80
|
+
}
|
|
81
|
+
const { createRelayTunnelClient } = await import('./relay-client.bundle.js');
|
|
82
|
+
const tunnel = createRelayTunnelClient({ ...host.relay, batchWindowMs: 0,
|
|
83
|
+
createWireSocket(url) {
|
|
84
|
+
const socket = new WebSocket(url);
|
|
85
|
+
socket.binaryType = 'arraybuffer';
|
|
86
|
+
return socket;
|
|
87
|
+
} });
|
|
88
|
+
const close = () => { signal?.removeEventListener('abort', close); tunnel.close(); };
|
|
89
|
+
signal?.addEventListener('abort', close, { once: true });
|
|
90
|
+
if (signal?.aborted) close();
|
|
91
|
+
const relayFetch = (route, init = {}) => tunnel.fetch(`http://remote.invalid${route}`, {
|
|
92
|
+
...init, signal: AbortSignal.any([...(signal ? [signal] : []), ...(init.signal ? [init.signal] : [])]),
|
|
93
|
+
headers: { ...init.headers, ...headers },
|
|
94
|
+
});
|
|
95
|
+
try {
|
|
96
|
+
capabilities = await readAdmission(await relayFetch('/api/hosts/capabilities', { signal: boundedSignal(10000) }));
|
|
97
|
+
} catch (error) {
|
|
98
|
+
close();
|
|
99
|
+
if (['remote_authorization_required', 'remote_incompatible'].includes(error?.code)) throw error;
|
|
100
|
+
throw failure('remote_relay_unavailable');
|
|
101
|
+
}
|
|
102
|
+
return { capabilities, fetch: relayFetch, async openWebSocket(route, protocols = [], { onMessage } = {}) {
|
|
103
|
+
const response = await relayFetch('/auth/url-token', { method: 'POST', signal: boundedSignal(5000) });
|
|
104
|
+
const authorization = response.ok ? await response.json() : null;
|
|
105
|
+
if (!authorization?.token) throw failure('remote_authorization_required', 401);
|
|
106
|
+
const target = new URL(route, 'http://remote.invalid');
|
|
107
|
+
target.searchParams.set('yuri_url_token', authorization.token);
|
|
108
|
+
const socket = tunnel.openWebSocket(`${target.pathname}${target.search}`, protocols, headers);
|
|
109
|
+
socket.onmessage = onMessage || null;
|
|
110
|
+
return socket;
|
|
111
|
+
},
|
|
112
|
+
close };
|
|
113
|
+
}
|
|
@@ -54,6 +54,7 @@ export const registerSessionFoldersRoutes = (app, dependencies) => {
|
|
|
54
54
|
await fsPromises.writeFile(tmp, serialized, 'utf8');
|
|
55
55
|
await fsPromises.rename(tmp, filePath);
|
|
56
56
|
saved = true;
|
|
57
|
+
dependencies.broadcastYuriEvent?.({ type: 'yuri:session-folders-changed', properties: { occurredAt: Date.now() } });
|
|
57
58
|
return res.json({ success: true });
|
|
58
59
|
} catch (error) {
|
|
59
60
|
if (tmp && !saved) {
|
|
@@ -8,6 +8,10 @@ means the next hydrate refetches.
|
|
|
8
8
|
The cache is **opt-in**. `resolveTranscriptCacheDbPath` returns `null` unless
|
|
9
9
|
`transcriptCacheDbPath` or `YURI_TRANSCRIPT_CACHE_DB_PATH` is set.
|
|
10
10
|
Ordinary remote Web servers therefore do not persist conversation bodies.
|
|
11
|
+
The Hub cache also rejects Remote Project scopes (explicit Host fields, serialized
|
|
12
|
+
remote Location/session keys and stable Hub+Host transport partitions) before
|
|
13
|
+
writing message or search rows. Remote content acceleration belongs only to the
|
|
14
|
+
client IndexedDB; the Host-prefixed cache API is not a forwarding capability.
|
|
11
15
|
Explicit and env values are normalized to an absolute path. Only `.sqlite`
|
|
12
16
|
files are accepted; the managed `session-index.sqlite` and
|
|
13
17
|
`message-queue.sqlite` basenames are rejected. Invalid values return `null`.
|
|
@@ -23,6 +23,9 @@ const forbiddenPreviewProxy = (res) => res.status(403).json({ error: 'Forbidden'
|
|
|
23
23
|
|
|
24
24
|
const rejectPreviewProxyCredential = (handler) => (req, res) => {
|
|
25
25
|
if (hasPreviewProxyCredential(req)) return forbiddenPreviewProxy(res);
|
|
26
|
+
if (req.query?.hostId || req.body?.hostId || req.body?.scope?.hostId || req.get?.('x-yuri-remote-host')) {
|
|
27
|
+
return res.status(403).json({ code: 'remote_content_not_persistable', error: 'Remote content cannot be cached on the Hub' });
|
|
28
|
+
}
|
|
26
29
|
return handler(req, res);
|
|
27
30
|
};
|
|
28
31
|
|
|
@@ -43,6 +43,18 @@ const requiredInteger = (value, label) => {
|
|
|
43
43
|
fail(`Invalid transcript cache ${label}`);
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
+
const rejectRemoteScope = (value) => {
|
|
47
|
+
let partition;
|
|
48
|
+
try { partition = JSON.parse(value?.transport || 'null'); } catch { /* Ordinary runtime identities are not JSON. */ }
|
|
49
|
+
const remotePartition = Array.isArray(partition) && partition.length === 2 && partition.every((part) => typeof part === 'string');
|
|
50
|
+
if (remotePartition || value?.hostId || value?.remoteHostId
|
|
51
|
+
|| /(?:\/api\/hosts\/|remote-host:|^remote:|^host:|^remote@)/.test(value?.transport || '')
|
|
52
|
+
|| (typeof value?.directory === 'string' && value.directory.startsWith('yuri-remote-location:'))
|
|
53
|
+
|| (typeof value?.sessionID === 'string' && value.sessionID.startsWith('yuri-remote-session:'))) {
|
|
54
|
+
fail('Remote transcripts must remain on the remote Host or in client IndexedDB');
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
46
58
|
/**
|
|
47
59
|
* Scope is the full runtime identity. Transport/generation/directory/sessionID
|
|
48
60
|
* are all required — directory+session alone would leak rows across runtimes.
|
|
@@ -50,6 +62,7 @@ const requiredInteger = (value, label) => {
|
|
|
50
62
|
/** Directory-wide content search. Session id is a hit, not a filter. */
|
|
51
63
|
export const parseContentSearchScope = (value) => {
|
|
52
64
|
if (!isPlainObject(value)) fail('Invalid transcript cache scope');
|
|
65
|
+
rejectRemoteScope(value);
|
|
53
66
|
const limit = value.limit === undefined || value.limit === ''
|
|
54
67
|
? undefined
|
|
55
68
|
: requiredInteger(value.limit, 'limit');
|
|
@@ -66,6 +79,7 @@ export const parseContentSearchScope = (value) => {
|
|
|
66
79
|
|
|
67
80
|
export const parseTranscriptCacheScope = (value) => {
|
|
68
81
|
if (!isPlainObject(value)) fail('Invalid transcript cache scope');
|
|
82
|
+
rejectRemoteScope(value);
|
|
69
83
|
return {
|
|
70
84
|
transport: requiredString(value.transport, 'scope'),
|
|
71
85
|
generation: requiredInteger(value.generation, 'scope'),
|
|
@@ -76,6 +90,7 @@ export const parseTranscriptCacheScope = (value) => {
|
|
|
76
90
|
|
|
77
91
|
export const parseTranscriptCacheGeneration = (value) => {
|
|
78
92
|
if (!isPlainObject(value)) fail('Invalid transcript cache generation');
|
|
93
|
+
rejectRemoteScope(value);
|
|
79
94
|
return {
|
|
80
95
|
transport: requiredString(value.transport, 'generation'),
|
|
81
96
|
generation: requiredInteger(value.generation, 'generation'),
|
|
@@ -96,6 +96,19 @@ afterEach(() => {
|
|
|
96
96
|
});
|
|
97
97
|
|
|
98
98
|
describe('createTranscriptCacheService', () => {
|
|
99
|
+
it('rejects serialized remote identities before persisting message bodies', () => {
|
|
100
|
+
const { service, dbPath } = createService();
|
|
101
|
+
for (const patch of [
|
|
102
|
+
{ transport: JSON.stringify(['hub-1', 'host-1']) },
|
|
103
|
+
{ directory: 'yuri-remote-location:["hub-1","host-1","/repo"]' },
|
|
104
|
+
{ sessionID: 'yuri-remote-session:["hub-1","host-1","s"]' },
|
|
105
|
+
{ hostId: 'host-1' },
|
|
106
|
+
]) {
|
|
107
|
+
expect(() => writeUser(service, 'remote-message', 1, 'remote body', otherScope(patch))).toThrow();
|
|
108
|
+
}
|
|
109
|
+
expect(inspectTables(dbPath)).toMatchObject({ indexCount: 0, contentCount: 0 });
|
|
110
|
+
});
|
|
111
|
+
|
|
99
112
|
it('returns null when dbPath is empty so remote servers stay body-free', () => {
|
|
100
113
|
expect(createTranscriptCacheService({})).toBeNull();
|
|
101
114
|
expect(createTranscriptCacheService({ dbPath: '' })).toBeNull();
|
|
@@ -35,7 +35,25 @@ independently requires its short-lived target token and strips Yuri credentials
|
|
|
35
35
|
before forwarding. Target registration and arbitrary Yuri write routes still
|
|
36
36
|
reject URL tokens; filesystem URL access remains GET-only.
|
|
37
37
|
|
|
38
|
+
File-preview resources have a narrowly parsed pathname envelope beneath the
|
|
39
|
+
preview proxy: `/_file/<target-token>/<short-url-token>/<relative-resource>`.
|
|
40
|
+
Only GET/HEAD may use its short URL token; file previews never authenticate a
|
|
41
|
+
WebSocket this way. The same expiry store is used, and client-bound file tokens
|
|
42
|
+
reload the current client record on every request, failing closed on revocation,
|
|
43
|
+
expiry or an unavailable client catalog. Explicit bearer authentication takes
|
|
44
|
+
precedence. A `-` path placeholder is not an authentication grant. The Remote Host
|
|
45
|
+
Gateway validates the browser's Hub token, replaces it with that placeholder,
|
|
46
|
+
and uses its own remote bearer for the upstream request; Hub URL credentials are
|
|
47
|
+
not forwarded to the remote machine. Regular network-preview form/WS behavior
|
|
48
|
+
is unchanged.
|
|
49
|
+
|
|
38
50
|
- `isUrlAuthWebSocketPath(pathname)`: true when a WebSocket upgrade may authenticate with `yuri_url_token` (exact terminal/dictation/event/realtime-proxy paths, plus prefix `/api/preview/proxy/` for Preview HMR). Keep in sync with tunnel-host `isTunnelWsPathAllowed`.
|
|
51
|
+
- Host-prefixed terminal/Preview sockets and raw/serve/icon/Preview assets use
|
|
52
|
+
the corresponding narrow URL-token allowlist. Host-prefixed Preview forms keep
|
|
53
|
+
the existing target-token gate. `issueClientUrlToken(req)` is a process-local
|
|
54
|
+
helper for the authenticated Gateway response pipe; it never sends a Hub token
|
|
55
|
+
upstream. Gateway authorization independently reloads the URL token's issuing
|
|
56
|
+
client, including current pairing scope, expiry and revocation.
|
|
39
57
|
- `createUiAuth({ password, cookieName, sessionTtlMs, readSettingsFromDiskMigrated })`: creates UI auth controller with methods:
|
|
40
58
|
- `authorizeRelayRequest(req)`
|
|
41
59
|
- `enabled`
|
|
@@ -4,6 +4,7 @@ import fs from 'fs';
|
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import os from 'os';
|
|
6
6
|
import { createUiPasskeys } from './ui-passkeys.js';
|
|
7
|
+
import { parseFilePreviewPath, readFilePreviewUrlAuthToken } from '../preview/file-preview-path.js';
|
|
7
8
|
|
|
8
9
|
const SESSION_COOKIE_NAME = 'yuri_ui_session';
|
|
9
10
|
const SESSION_TTL_MS = 12 * 60 * 60 * 1000;
|
|
@@ -266,7 +267,8 @@ const getUrlAuthTokenFromRequest = (req) => {
|
|
|
266
267
|
token = undefined;
|
|
267
268
|
}
|
|
268
269
|
}
|
|
269
|
-
|
|
270
|
+
if (typeof token === 'string' && token.trim()) return token.trim();
|
|
271
|
+
return readFilePreviewUrlAuthToken(getRequestPathname(req)) || null;
|
|
270
272
|
};
|
|
271
273
|
|
|
272
274
|
const getRequestPathname = (req) => {
|
|
@@ -292,6 +294,8 @@ const isWebSocketUpgrade = (req) => {
|
|
|
292
294
|
};
|
|
293
295
|
|
|
294
296
|
const isUrlAuthReadableHttpPath = (pathname) => {
|
|
297
|
+
const remote = /^\/api\/hosts\/[^/]+(\/api\/(?:fs\/(?:raw|serve)(?:\/.*)?|preview\/proxy\/.*|terminal\/[^/]+\/stream|projects\/[^/]+\/icon))$/.exec(pathname);
|
|
298
|
+
if (remote) return isUrlAuthReadableHttpPath(remote[1]);
|
|
295
299
|
return pathname === '/api/event'
|
|
296
300
|
|| pathname === '/api/global/event'
|
|
297
301
|
|| pathname === '/api/yuri/events'
|
|
@@ -315,6 +319,9 @@ const isUrlAuthReadableHttpPath = (pathname) => {
|
|
|
315
319
|
*/
|
|
316
320
|
export const isUrlAuthWebSocketPath = (pathname) => {
|
|
317
321
|
if (typeof pathname !== 'string' || !pathname) return false;
|
|
322
|
+
if (parseFilePreviewPath(pathname)) return false;
|
|
323
|
+
const remote = /^\/api\/hosts\/[^/]+(\/api\/(?:terminal\/ws|preview\/proxy\/.*))$/.exec(pathname);
|
|
324
|
+
if (remote) return isUrlAuthWebSocketPath(remote[1]);
|
|
318
325
|
return pathname === '/api/event/ws'
|
|
319
326
|
|| pathname === '/api/global/event/ws'
|
|
320
327
|
|| pathname === '/api/yuri/realtime-proxy/ws'
|
|
@@ -328,9 +335,13 @@ export const isUrlAuthWebSocketPath = (pathname) => {
|
|
|
328
335
|
const canUseUrlAuthTokenForRequest = (req) => {
|
|
329
336
|
const method = typeof req?.method === 'string' ? req.method.toUpperCase() : 'GET';
|
|
330
337
|
const pathname = getRequestPathname(req);
|
|
338
|
+
if (parseFilePreviewPath(pathname)) return !isWebSocketUpgrade(req) && ['GET', 'HEAD'].includes(method);
|
|
331
339
|
if (isWebSocketUpgrade(req)) {
|
|
332
340
|
return isUrlAuthWebSocketPath(pathname);
|
|
333
341
|
}
|
|
342
|
+
if (/^\/api\/hosts\/[^/]+\/api\/preview\/proxy\/[a-f0-9]{16,64}(?:\/|$)/i.test(pathname)) {
|
|
343
|
+
return ['GET', 'HEAD', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'].includes(method);
|
|
344
|
+
}
|
|
334
345
|
// Browser-owned preview forms/fetch cannot attach Yuri headers. The proxy also
|
|
335
346
|
// requires its separate target token and strips both tokens before forwarding.
|
|
336
347
|
if (/^\/api\/preview\/proxy\/[a-f0-9]{16,64}(?:\/|$)/i.test(pathname)) {
|
|
@@ -463,9 +474,19 @@ export const createUiAuth = ({
|
|
|
463
474
|
|
|
464
475
|
const clientPresence = createClientPresence();
|
|
465
476
|
const authenticateClientRequest = async (req, { allowUrlToken = true } = {}) => {
|
|
466
|
-
|
|
477
|
+
const filePreview = parseFilePreviewPath(getRequestPathname(req));
|
|
478
|
+
if (allowUrlToken && !(filePreview && getBearerTokenFromRequest(req))) {
|
|
467
479
|
const urlAuth = authenticateUrlAuthToken(req);
|
|
468
480
|
if (urlAuth) {
|
|
481
|
+
if (filePreview && urlAuth.sessionToken?.startsWith('client:')) {
|
|
482
|
+
try {
|
|
483
|
+
const clientId = urlAuth.sessionToken.slice('client:'.length);
|
|
484
|
+
const client = (await clientAuthController?.listClients?.())?.find((entry) => entry.id === clientId);
|
|
485
|
+
if (!client || client.revokedAt || (client.expiresAt && Date.parse(client.expiresAt) <= Date.now())) return null;
|
|
486
|
+
urlAuth.client = client;
|
|
487
|
+
urlAuth.clientId = clientId;
|
|
488
|
+
} catch { return null; }
|
|
489
|
+
}
|
|
469
490
|
clientPresence.track(req, urlAuth);
|
|
470
491
|
return urlAuth;
|
|
471
492
|
}
|
|
@@ -505,6 +526,11 @@ export const createUiAuth = ({
|
|
|
505
526
|
client: clientAuth?.client || null,
|
|
506
527
|
});
|
|
507
528
|
|
|
529
|
+
const issueClientUrlToken = async (req) => {
|
|
530
|
+
const authenticated = await authenticateClientRequest(req);
|
|
531
|
+
return authenticated ? issueUrlAuthTokenForSession(clientSessionToken(authenticated)) : null;
|
|
532
|
+
};
|
|
533
|
+
|
|
508
534
|
const authorizeRelayRequest = async (req) => {
|
|
509
535
|
const pathname = new URL(req.url, 'http://127.0.0.1').pathname;
|
|
510
536
|
// Pairing redeems its one-time secret before a client credential exists.
|
|
@@ -596,6 +622,7 @@ export const createUiAuth = ({
|
|
|
596
622
|
|
|
597
623
|
return {
|
|
598
624
|
enabled: false,
|
|
625
|
+
issueClientUrlToken,
|
|
599
626
|
authorizeRelayRequest,
|
|
600
627
|
requireAuth,
|
|
601
628
|
requireSessionAuth,
|
|
@@ -1007,6 +1034,7 @@ export const createUiAuth = ({
|
|
|
1007
1034
|
|
|
1008
1035
|
return {
|
|
1009
1036
|
enabled: true,
|
|
1037
|
+
issueClientUrlToken,
|
|
1010
1038
|
authorizeRelayRequest,
|
|
1011
1039
|
requireAuth,
|
|
1012
1040
|
requireSessionAuth,
|