fix: check for the identifier alias for the storage backend#41538
fix: check for the identifier alias for the storage backend#41538jvillafanez wants to merge 5 commits intomasterfrom
Conversation
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
DeepDiver1975
left a comment
There was a problem hiding this comment.
- can you add unit tests?
- please add changelog items
fa639a3 to
5080fc6
Compare
ec4554e to
88fcb18
Compare
DeepDiver1975
left a comment
There was a problem hiding this comment.
- I miss tests where local storage mounting is allowed.files_external_allow_create_new_local => true
- did you double check if the http status code change 422 -> 403 has any impact on the frontend. technically this is a breaking change to the api
I don't think it's possible to trigger the behavior from the web UI. If the backend isn't visible, it won't show up in the frontend and it won't be selectable. The change in the HTTP code should match the previous behavior: it returns a 403 if the user tries to create or update a backend that he isn't allowed to use. It also makes more sense to return a 403 error in those circumstances.
They should be covered. For the global / user storage controllers, the tests have the flag enabled by default, so all those tests run with that setting. The only exception are the "new" |
looking at the changeset - I see files_external_allow_create_new_local only being removed from the code - is this setting actually still be checked anywhere? |
I prefer 'are' over 'should' - assertion over assumption |
It's used in the settings page. The flag is in an awkward position... it doesn't allow the creation of the local storage from the frontend, but the admin can still create the local storage via API. Regular users won't be able to setup local storages anyway. I'll try to add an |
just to be sure: the backend has to verify everything - ignore frontend beahavior. |
Description
Prevent local storage to be used as external if it isn't explicitly allowed.
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist:
Notes:
This is likely the minimum change possible at the moment. There are no plans to add or modify the backend's aliases
or identifiers at the moment, but it could become unmanageable quickly.
We should consider to move and improve the check at some point.