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

Directory assets #12226

Open
etj opened this issue May 13, 2024 · 1 comment · May be fixed by #12279
Open

Directory assets #12226

etj opened this issue May 13, 2024 · 1 comment · May be fixed by #12279
Assignees

Comments

@etj
Copy link
Contributor

etj commented May 13, 2024

Allow Assets to handle full directory hierarchies.

Administration

  • Add an Assets administration page
  • Allow file Assets to be handled (create/update/delete) in the admin page
  • Allow creation of Assets on directories

Logic

  • Handle cloning of directory Assets

Access / download

  • Allow access to every file inside the directory handled by an Asset, honouring the authorization on the Asset

URL handling

Let's say we have a LocalAsset (pk=10) with location /mnt/statics/assets/20240514etcetc/myindex.
We have in /mnt/statics/assets/20240514etcetc the files

  • myindex
  • file1
  • otherdir/file2

The request http://server/api/v2/assets/10/link will return the content of the file myindex.
myindex will have info about the content in the directory, relative to itself, so it will contain as references "file1", "otherdir/file2".
The client will be able to perform calls to:

  • http://server/api/v2/assets/10/link/file1
  • http://server/api/v2/assets/10/link/otherdir/file2

and in general

  • http://server/api/v2/assets/<PK>/link/<PATH>

Note that http://server/api/v2/assets/10/link/myindex will return the same content as http://server/api/v2/assets/10/link

@etj etj self-assigned this May 13, 2024
etj added a commit that referenced this issue May 14, 2024
@etj etj linked a pull request May 14, 2024 that will close this issue
12 tasks
etj added a commit that referenced this issue May 15, 2024
etj added a commit that referenced this issue May 16, 2024
@etj
Copy link
Contributor Author

etj commented May 16, 2024

Blockers encountered:

  • StorageManager renames the handled files, so the names referenced in an index files will no longer match
    • solved: a clone/copy procedure has been implemented within the LocalAssetHandler

Inconsistencies encountered:

  • StorageManager uses os.path directly, without relying on the concrete manager to deal with the undelying filesystem

mattiagiupponi added a commit that referenced this issue May 21, 2024
etj added a commit that referenced this issue May 28, 2024
etj pushed a commit that referenced this issue May 28, 2024
@etj etj linked a pull request May 28, 2024 that will close this issue
12 tasks
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 a pull request may close this issue.

1 participant