Re: [Django] #35607: Improve Storage base backend API flexibility to allow filename validation to be overridden safely

9 views
Skip to first unread message

Django

unread,
Jul 26, 2024, 6:35:23 AM7/26/24
to django-...@googlegroups.com
#35607: Improve Storage base backend API flexibility to allow filename validation
to be overridden safely
-------------------------------------+-------------------------------------
Reporter: Natalia Bidart | Owner: Mohammad
Type: | Salehi
Cleanup/optimization | Status: assigned
Component: File | Version:
uploads/storage |
Severity: Normal | Resolution:
Keywords: storages | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mohammad Salehi):

* owner: (none) => Mohammad Salehi
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/35607#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 30, 2024, 5:56:30 AM7/30/24
to django-...@googlegroups.com
#35607: Improve Storage base backend API flexibility to allow filename validation
to be overridden safely
-------------------------------------+-------------------------------------
Reporter: Natalia Bidart | Owner: Mohammad
Type: | Salehi
Cleanup/optimization | Status: assigned
Component: File | Version:
uploads/storage |
Severity: Normal | Resolution:
Keywords: storages | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mohammad Salehi):

I want to write these tests for the functions get_available_name,
generate_filename, get_valid_name, and validate_file_name:

1- Where there is double dots in filename-> "../file.ext"
2_ If there is an unusual character in the filename, include one of the
following characters: ^ @ # $ % & * ( ) + = { } | \ / : ; ' " < > ? for
exapmle ->
"fi...@name.ext"
3_ Where there is long filename ->
"a_very_very_very_long_filename_that_exceeds_the_usual_limits_of_a_filesystem.ext"
4_ Where there is filename without extension -> "filename"
5_ Where there is filename with hidden extension -> "filename."

Is this ok? @nessita
--
Ticket URL: <https://code.djangoproject.com/ticket/35607#comment:4>

Django

unread,
Jul 30, 2024, 6:08:00 AM7/30/24
to django-...@googlegroups.com
#35607: Improve Storage base backend API flexibility to allow filename validation
to be overridden safely
-------------------------------------+-------------------------------------
Reporter: Natalia Bidart | Owner: Mohammad
Type: | Salehi
Cleanup/optimization | Status: assigned
Component: File | Version:
uploads/storage |
Severity: Normal | Resolution:
Keywords: storages | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mohammad Salehi):

Replying to [comment:1 Natalia Bidart]:

I want to write these tests for the functions get_available_name,
generate_filename, get_valid_name, and validate_file_name:

1- Where there is double dots in filename-> "../file.ext"
2_ If there is an unusual character in the filename, include one of the
following characters: ^ @ # $ % & * ( ) + = { } | \ / : ; ' " < > ? for
exapmle ->
"fi...@name.ext"
3_ Where there is long filename ->
"a_very_very_very_long_filename_that_exceeds_the_usual_limits_of_a_filesystem.ext"
4_ Where there is filename without extension -> "filename"
5_ Where there is filename with hidden extension -> "filename."

Is this ok? Natalia Bidart[]
--
Ticket URL: <https://code.djangoproject.com/ticket/35607#comment:5>

Django

unread,
Jul 30, 2024, 8:17:34 AM7/30/24
to django-...@googlegroups.com
#35607: Improve Storage base backend API flexibility to allow filename validation
to be overridden safely
-------------------------------------+-------------------------------------
Reporter: Natalia Bidart | Owner: Natalia
Type: | Bidart
Cleanup/optimization | Status: assigned
Component: File | Version:
uploads/storage |
Severity: Normal | Resolution:
Keywords: storages | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* owner: Mohammad Salehi => Natalia Bidart

Comment:

Hello Mohammad Salehi! Thank you for your interest in helping with this
ticket!

I have been working with and thinking about the `Storages` API for a
while, and I have a few branches already with half way of a refactor. My
advice would be to pause a bit on this work until I can clean up my work
and push it. I will assign this ticket to myself to better signal the fact
that I have started this work some time ago. Thanks again!
--
Ticket URL: <https://code.djangoproject.com/ticket/35607#comment:6>
Reply all
Reply to author
Forward
0 new messages