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

Closed
etj opened this issue May 13, 2024 · 1 comment · Fixed by #12338
Closed

Directory assets #12226

etj opened this issue May 13, 2024 · 1 comment · Fixed by #12338
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
mattiagiupponi added a commit that referenced this issue Jun 18, 2024
[Fixes #12226] Directory assets
mattiagiupponi added a commit that referenced this issue Jun 18, 2024
[Fixes #12226] Directory assets
---------
Co-authored-by: etj <[email protected]>
@mattiagiupponi mattiagiupponi linked a pull request Jun 20, 2024 that will close this issue
12 tasks
giohappy pushed a commit that referenced this issue Jul 3, 2024
[Fixes #12226] Directory assets
---------
Co-authored-by: etj <[email protected]>
giohappy pushed a commit that referenced this issue Sep 24, 2024
…2411)

* [Fixes #12124] GNIP 100: Assets (#12335)

* [Fixes #12124] GNIP 100: Assets
---------

Co-authored-by: etj <[email protected]>

* [Fixes #12226] Directory assets (#12337)

[Fixes #12226] Directory assets
---------
Co-authored-by: etj <[email protected]>

* [Fixes #12341] Asset download handler and link generator (#12343)

* [Fixes #12341] Download handler fix
* [Fixes #12341] Assets: link generation (#12342)
---------

Co-authored-by: Emanuele Tajariol <[email protected]>

* [Fixes #12326] Assets: implement migration for old uploaded files

* [Fixes #12326] Assets: implement migration for old uploaded files

* [Fixes #12326] Assets: implement migration for old uploaded files

* [Fixes #12326] rollback requirements

---------

Co-authored-by: etj <[email protected]>
Co-authored-by: Emanuele Tajariol <[email protected]>
giohappy pushed a commit that referenced this issue Sep 24, 2024
…2411)

* [Fixes #12124] GNIP 100: Assets (#12335)

* [Fixes #12124] GNIP 100: Assets
---------

Co-authored-by: etj <[email protected]>

* [Fixes #12226] Directory assets (#12337)

[Fixes #12226] Directory assets
---------
Co-authored-by: etj <[email protected]>

* [Fixes #12341] Asset download handler and link generator (#12343)

* [Fixes #12341] Download handler fix
* [Fixes #12341] Assets: link generation (#12342)
---------

Co-authored-by: Emanuele Tajariol <[email protected]>

* [Fixes #12326] Assets: implement migration for old uploaded files

* [Fixes #12326] Assets: implement migration for old uploaded files

* [Fixes #12326] Assets: implement migration for old uploaded files

* [Fixes #12326] rollback requirements

---------

Co-authored-by: etj <[email protected]>
Co-authored-by: Emanuele Tajariol <[email protected]>
giohappy added a commit that referenced this issue Sep 24, 2024
…2411) (#12611)

* [Fixes #12124] GNIP 100: Assets (#12335)

* [Fixes #12124] GNIP 100: Assets
---------



* [Fixes #12226] Directory assets (#12337)

[Fixes #12226] Directory assets
---------


* [Fixes #12341] Asset download handler and link generator (#12343)

* [Fixes #12341] Download handler fix
* [Fixes #12341] Assets: link generation (#12342)
---------



* [Fixes #12326] Assets: implement migration for old uploaded files

* [Fixes #12326] Assets: implement migration for old uploaded files

* [Fixes #12326] Assets: implement migration for old uploaded files

* [Fixes #12326] rollback requirements

---------

Co-authored-by: mattiagiupponi <[email protected]>
Co-authored-by: etj <[email protected]>
Co-authored-by: Emanuele Tajariol <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant