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

fix(query): Skip checking the privilege about the user stage @~ #13823

Merged
merged 11 commits into from
Nov 30, 2023

Conversation

flaneur2020
Copy link
Member

@flaneur2020 flaneur2020 commented Nov 27, 2023

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

Currently the privilege check on PRESIGN will forbid any data insertion from a public role, as it's not able to PRESIGN @~/, like:

cloudapp@tnf34b0rm--yazhou.gw.aliyun-cn-beijing.default.databend.cn:443/book_db> PRESIGN UPLOAD @~/test1.txt;
error: APIError: ResponseError with 1063: Permission denied, privilege [Write] is required on STAGE cloudapp for user 'cloudapp'@'%' with roles [public]

@/~ is considered as a private stage owned by the user, every user have his/her own stage, and it's a necessary data path on the client drivers.

this pr may have conflict with #13821, we can have a wait after it.

changes in this PR:

  • added validate_access_stage to encapsulate the prechecks on stage
  • avoid checking privilege on @~ to avoid it breaks the data ingestions path
  • move the rbac tests back to stateless to make it easier to run in the local dev environment, while left stage related tests in the stateful

This change is Reviewable

@github-actions github-actions bot added the pr-bugfix this PR patches a bug in codebase label Nov 27, 2023
@flaneur2020 flaneur2020 marked this pull request as ready for review November 30, 2023 07:21
@flaneur2020 flaneur2020 requested a review from TCeason November 30, 2023 07:27
@BohuTANG BohuTANG merged commit d0be4d8 into databendlabs:main Nov 30, 2023
68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix this PR patches a bug in codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants