Summary
Migrate the existing client-side allowed_vfolder_hosts merge ("which storage hosts can the current user mount") from the legacy request-waterfall pattern onto the myStorageHostPermissions GraphQL field (Strawberry V2, added in 26.4.2).
Background
The legacy pattern resolves the keypair's resource-policy name first, then issues a second query for domain / group / keypair_resource_policy allowed_vfolder_hosts, then merges three JSON blobs client-side and filters by mount-in-session. This is a request waterfall plus duplicated merge logic.
myStorageHostPermissions returns the union of domain + the user's projects + keypair permissions in a single server-side query, already intersected with registered volumes. FR-1436 introduced the useMountableVFolderHosts hook on top of it for the deployment model-folder selector; this issue generalizes that adoption.
Candidate consumers (Pattern A — "current user's mountable hosts")
react/src/components/VFolderTable.tsx (session mount picker; inline VFolderTableProjectQuery + _.merge + mount-in-session)
react/src/hooks/useMergedAllowedStorageHostPermission.ts and its consumers:
FileBrowserButton.tsx, FileBrowserButtonV2.tsx
FolderExplorerModal.tsx, FolderExplorerModalV2.tsx
SFTPServerButton.tsx, SFTPServerButtonV2.tsx
Explicitly OUT of scope (Pattern B — admin entity config)
Code that reads/writes a specific entity's allowed_vfolder_hosts (admin settings) must NOT be migrated — it is not "the current user's union": BAIProjectSettingModal, BAIProjectTable, KeypairResourcePolicy*, DomainStoragePermissionTable, ProjectStoragePermissionTable, helper/storageHostPermission.ts, BAIAllowedVfolderHostsWithPermission.
Key open decision — version floor
myStorageHostPermissions requires manager >= 26.4.2. Unlike the deployment modal (already gated >= 26.4.3), the Pattern A flows above (session mount, file browser, SFTP) currently support older managers and are NOT version-gated. Migrating them requires either:
- (a) keeping a fallback to the legacy merge for managers < 26.4.2 (keeps both code paths), or
- (b) declaring 26.4.2 the minimum supported manager and deleting the legacy path.
Decide the support matrix before implementing.
Acceptance criteria
- Pattern A consumers compute mountable hosts via
myStorageHostPermissions (directly or by reimplementing useMergedAllowedStorageHostPermission internals while preserving its return shape).
- No behavioral regression for the chosen support floor.
scripts/verify.sh passes.
Notes
JIRA Issue: FR-3229
Summary
Migrate the existing client-side
allowed_vfolder_hostsmerge ("which storage hosts can the current user mount") from the legacy request-waterfall pattern onto themyStorageHostPermissionsGraphQL field (Strawberry V2, added in 26.4.2).Background
The legacy pattern resolves the keypair's resource-policy name first, then issues a second query for
domain/group/keypair_resource_policyallowed_vfolder_hosts, then merges three JSON blobs client-side and filters bymount-in-session. This is a request waterfall plus duplicated merge logic.myStorageHostPermissionsreturns the union of domain + the user's projects + keypair permissions in a single server-side query, already intersected with registered volumes. FR-1436 introduced theuseMountableVFolderHostshook on top of it for the deployment model-folder selector; this issue generalizes that adoption.Candidate consumers (Pattern A — "current user's mountable hosts")
react/src/components/VFolderTable.tsx(session mount picker; inlineVFolderTableProjectQuery+_.merge+mount-in-session)react/src/hooks/useMergedAllowedStorageHostPermission.tsand its consumers:FileBrowserButton.tsx,FileBrowserButtonV2.tsxFolderExplorerModal.tsx,FolderExplorerModalV2.tsxSFTPServerButton.tsx,SFTPServerButtonV2.tsxExplicitly OUT of scope (Pattern B — admin entity config)
Code that reads/writes a specific entity's
allowed_vfolder_hosts(admin settings) must NOT be migrated — it is not "the current user's union":BAIProjectSettingModal,BAIProjectTable,KeypairResourcePolicy*,DomainStoragePermissionTable,ProjectStoragePermissionTable,helper/storageHostPermission.ts,BAIAllowedVfolderHostsWithPermission.Key open decision — version floor
myStorageHostPermissionsrequires manager >= 26.4.2. Unlike the deployment modal (already gated >= 26.4.3), the Pattern A flows above (session mount, file browser, SFTP) currently support older managers and are NOT version-gated. Migrating them requires either:Decide the support matrix before implementing.
Acceptance criteria
myStorageHostPermissions(directly or by reimplementinguseMergedAllowedStorageHostPermissioninternals while preserving its return shape).scripts/verify.shpasses.Notes
hostis server-side filterable onvfolder_nodes; selectors can compose host clauses into their GraphQLfilterstring (see FR-1436).JIRA Issue: FR-3229