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

optimize a database without params returns permission denied #41

Open
scardena opened this issue Mar 2, 2021 · 0 comments
Open

optimize a database without params returns permission denied #41

scardena opened this issue Mar 2, 2021 · 0 comments

Comments

@scardena
Copy link
Collaborator

scardena commented Mar 2, 2021

The only permission required to optimize a database should be execute on admin:dbname:

(⎈ |ops:stardog)Simons-MBP:bin simon$ ./stardog-admin --server https://k8s-ops.stardoglabs.com:5820 user add simon_admin -N newpass
Successfully created user simon_admin.
(⎈ |ops:stardog)Simons-MBP:bin simon$ ./stardog-admin --server https://k8s-ops.stardoglabs.com:5820 db create --name simon_db
Successfully created database 'simon_db'.
(⎈ |ops:stardog)Simons-MBP:bin simon$ ./stardog-admin --server https://k8s-ops.stardoglabs.com:5820 user grant simon_admin -a execute -o admin:simon_db <<--- afaik this is the only permission required to optimize a db
Successfully granted the permission.
(⎈ |ops:stardog)Simons-MBP:bin simon$ ./stardog-admin --server https://k8s-ops.stardoglabs.com:5820 db optimize simon_db -u simon_admin -p newpass
simon_db was successfully optimized.

but in pystardog, the put requests fails when doing:
db.optimize()

reproducing using curl:

curl -X PUT https://k8s-ops.stardoglabs.com:5820/admin/databases/simon_db/optimize -u simon_admin:newpass
{"message":"Permission [[read], [metadata], [simon_db]] denied for simon_admin","code":"SEAOE2"}

this can be solved passing an empty body -d {}. apparently an empty body doesn't attempt to read the default optimization options,

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

1 participant