Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endpoints to get the md5 hash of the original model file #5287

Open
8 of 12 tasks
carmenfan opened this issue Dec 9, 2024 · 0 comments
Open
8 of 12 tasks

Endpoints to get the md5 hash of the original model file #5287

carmenfan opened this issue Dec 9, 2024 · 0 comments

Comments

@carmenfan
Copy link
Member

carmenfan commented Dec 9, 2024

Description

Product issue: https://github.com/3drepo/3D-Repo-Product-Team/issues/547

To add endpoints for federation/containers to provide the md5 hash of the original files

Additional endpoints

route: HTTP GET /teamspaces/{teamspace}/projects/{project}/containers/{container}/revisions/{revision}/files/original/info
description: get the details of the original file uploaded to that revision of the container
permissions: viewer+
response: md5 hash of the original file

{
    container: "<container ID>",
    code: "<revision code>",
    uploadedAt: 223984739284723, // timestamp of when it was uploaded
    hash: "<md5 hash of the original file uploaded to this revision>",
    filename: "abc.rvt",
    size: 329487234 // size in Bytes
}

route: HTTP GET /teamspaces/{teamspace}/projects/{project}/federations/{federation}/revisions/{revision}/files/original/info
description: get the details of the original file uploaded to all the containers within the federation
permissions: viewer+
response: md5 hash of the original file

[{
    container: "<container ID>",
    code: "<revision code>",
    uploadedAt: 223984739284723, // timestamp of when it was uploaded
    hash: "<md5 hash of the original file uploaded to this revision>",
    filename: "abc.rvt",
    size: 329487234 // size in Bytes
},
{
    container: "<container ID>",
    code: "<revision code>",
    uploadedAt: 223984739284723, // timestamp of when it was uploaded
    hash: "<md5 hash of the original file uploaded to this revision>",
    filename: "def.dwg",
    size: 329487234 // size in Bytes
}]

NOTE:

  • for each of the container, we need to make sure the user has at least viewer permissions to the container. if not, we should omit the information about that container.

Goals

  • As a user, I want to be able to get detailed information about the original file of a model, so I can verify if the same file is being used in applications outside of 3D Repo.
  • As a admin, I want to make sure information about the files are not leaked to users who do not have at least viewer permission to the container.

Tasks

  • create route for containers
    • validate that user can access it - throw 403 if not allowed
    • retrieve the original files
    • MD5 hash them
    • create response
  • create route for federations
    • validate that user can access - throw 403 if not allowed
    • return list of items and the original files
    • MD5 hash the files
    • create response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants