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

Stor: Upload into non-existing parents possible #193

Open
killua-eu opened this issue Feb 10, 2021 · 1 comment
Open

Stor: Upload into non-existing parents possible #193

killua-eu opened this issue Feb 10, 2021 · 1 comment
Assignees

Comments

@killua-eu
Copy link
Contributor

killua-eu commented Feb 10, 2021

Setup

HOST="https://10.146.149.150"
EMAIL="[email protected]"
PASS="[email protected]"
TOKEN=`curl -s -XPOST ${HOST}/api/core/v1/auth/signin -d "email=${EMAIL}&password=${PASS}" -k | jq -r .token`

Test

curl -k -H "Authorization: Bearer ${TOKEN}" -F 'actual_dir=APATHTHATDOESNTEXIST/5' -F 'upload_type=general' -F 'file[]=@./file1.txt' -F 'file[]=@./file2.txt' ... ${HOST}/api/stor/v1/upload

returns 500, should return 400

curl -k -H "Authorization: Bearer ${TOKEN}" -F 'actual_dir=worklog/-15' -F 'upload_type=general' -F 'file[]=@./file1.txt' -F 'file[]=@./file2.txt' ... ${HOST}/api/stor/v1/upload

allows invalid values such as -15 after the slash. only existing parents should go. again returning 400 seems nice + checking needs to be written. as of current, its completely missing.

omitting -F 'actual_dir=something/somethingelse' should respond with 400, responds with 500.

@killua-eu
Copy link
Contributor Author

killua-eu commented Feb 10, 2021

On the other hand

curl -k -H "Authorization: Bearer ${TOKEN}" -F 'actual_dir=worklog/' -F 'upload_type=general' -F 'file[]=@./file1.txt' -F 'file[]=@./file2.txt' ... ${HOST}/api/stor/v1/upload

meaning

  • c_inherit_object = null
  • c_inherit_table = worklog

should be generally possible. maybe we can restrict nullable objects to only some tables or require the rbac domain in such cases.

Content of this comment was fixed, null on object now allowed/supported.

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

No branches or pull requests

2 participants