Skip to content

Conversation

@carmenfan
Copy link
Member

@carmenfan carmenfan commented Dec 3, 2025

This fixes #5730

Description

  • Upgraded to ES2023
    • This is to allow syntax to create private functions inside class declarations
  • deprecated GridFS support
  • Default storage type is now always fs
  • moved handler/fs to v5, added driver tests
    • v4's externalServices is now wired to reference the v5 fs handler implementation.
  • Added a new configuration externalFS
    • This is a path to the folder which is accessible to the web service on a read only basis
      • This should be where the external Asite FS should be configured to
  • added initialisation tests to ensure that externalFS exists if an internal api service is configured
  • container middleware for new revisions is modified:
    • If it is an internal service, it will expect a json instead of multipart form, with:
      • file entry being a path to a file in externalFS
      • owner property provided as an email address
        • This user doesn't have to exist in 3DR (if it doesn't an entry is created)
  • models permissions middleware now understand the bypassAuth flag
  • The following endpoints are accepted through the internal service:
    • Create container
    • Get container list
    • Create new revision (Container)

Acceptance Criteria

  • External service should run as normal
  • Internal service:
    • Should no longer start up unless you've configured an externalFS
    • You can upload a new revision by specifying the path to the file in externalFS
      • It will error if you try to use the multipart form schema
    • You must provide a owner email
      • This owner can either be an existing user, or new user
        • if it's a new user, a new user entry will be created in the db.
          • If the user is invited into the teamspace (which triggers the activation email form frontegg), the data should link up

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for model uploads through an internal service, enabling file uploads via file path references instead of multipart form data. Key changes include:

  • Upgraded to ES2023 syntax to support private class methods
  • Migrated file storage handler from v4 to v5 with improved functionality
  • Deprecated GridFS support, setting default storage to filesystem only
  • Added new externalFS configuration for read-only file access by internal services

Reviewed changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
backend/.eslintrc.json Updated ECMAScript version to 2023
backend/src/v4/config.js Set default storage type to use FileStorageTypes constant
backend/src/v4/handler/externalServices.js Refactored to use v5 FS handler, removed GridFS/S3/Alluxio support
backend/src/v4/handler/fs.js Removed v4 implementation (migrated to v5)
backend/src/v4/models/scene.js Removed GridFS stream method
backend/src/v4/services/api.js Added system check for filesystem configuration on startup
backend/src/v5/handler/fs.js New v5 filesystem handler with class-based architecture and private methods
backend/src/v5/middleware/dataConverter/inputs/teamspaces/projects/models/containers.js Added internal service support with file path validation and user creation
backend/src/v5/middleware/dataConverter/inputs/teamspaces/projects/models/drawings/index.js Added owner extraction from session
backend/src/v5/middleware/permissions/components/models.js Added bypass auth support and model existence validation
backend/src/v5/middleware/permissions/components/projects.js Added bypass auth support for project admin checks
backend/src/v5/processors/teamspaces/projects/models/commons/modelList.js Added bypass permissions parameter support
backend/src/v5/processors/teamspaces/projects/models/containers.js Added read-only file flag to prevent deletion of external files
backend/src/v5/routes/routesManager.js Reorganized routes to support internal service endpoints
backend/src/v5/routes/teamspaces/projects/models/common/general.js Added internal service parameter and bypass auth support
backend/src/v5/routes/teamspaces/projects/models/common/revisions.js Moved OpenAPI documentation and added internal service parameter
backend/src/v5/services/filesManager.js Updated to use new FS handler interface and FileStorageTypes constants
backend/src/v5/services/initialiser.js Added filesystem validation checks
backend/src/v5/utils/config.constants.js Added FileStorageTypes constants
backend/src/v5/utils/helper/mimeTypes.js Added BINARY mime type constant
backend/src/v5/utils/helper/typeCheck.js Added isBool type checker
config/testV5/config.js Added externalFS configuration and refactored directory creation
backend/tests/v5/helper/services.js Added helper functions for temporary directories and email generation
Multiple test files Updated tests to support new internal service functionality and removed GridFS references

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants