-
Notifications
You must be signed in to change notification settings - Fork 148
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
[Google Drive] Fix permission fetching bug for domain-wide delegation sync #2024
[Google Drive] Fix permission fetching bug for domain-wide delegation sync #2024
Conversation
…with-read-only-access
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably not a problem or impossible setup, but wanted to confirm with you:
How does it work, if we have users A and B who both have only read-only access to the file. Will it mark this file as not accessible by anyone, or is this situation impossible?
That's a valid question. This scenario is only possible if someone from outside of the organization has shared a read-only file with people inside the organization. This implementation will skip indexing such a file since no-one inside the org has write access to it. Another possible approach would be to keep the list_files query unchanged ( The downside of this approach is that we would end up with different content index with DLS enabled/disabled - because the query would be different. I'm not sure if we need to index files that onone in the org has write access to. Note, I'm talking here about content sync with domain-wide delegation enabled where we iterate over all org users and "impersonate" them to access their files. So in short:
|
I feel like it makes sense, as all we need is documents that people can read - if you can read a doc A, that you're not allowed to write to, the doc might still be of a lot of value for you. That's, though, my opinion, I don't know if I can be a good source of answers to how it should work - might it be worth to discuss it with the team? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meanwhile approving it as it seems like an improvement to existing behaviour
I thought more about it. Also I raised this with the team, but it was pretty complicated setup to explain in a call. I think the best solution would be to:
I think this should maximise utility for users of this connector. What do you think? I will change the PR. |
…nly-access' of github.com:elastic/connectors-python into google-drive-retrieve-permissions-for-users-with-read-only-access
Trying to review with limited knowledge of Google Drive.
I'd say we need to index files the user has access, unless we specifically document it like in the RCF
This concerns me. I don't think enabling/disabling DLS should affect the number of docs indexed. What if you query with |
Correct, but with DLS enabled we are unable to fetch permissions for read-only files shared with me. So those files are unusable anyway from document level security perspective. Even though we can index a file, we can't fetch its access control list.
I don't think we can execute dynamic queries for g drive such as
The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detailed explanation of the problem, @jedrazb !
…with-read-only-access
…with-read-only-access
…with-read-only-access
…egation sync (#2024) (#2034) Co-authored-by: Jedr Blaszyk <[email protected]>
…egation sync (#2024) (#2035) Co-authored-by: Jedr Blaszyk <[email protected]>
Closes #1979
This fixes a bug when doing domain-wide delegation sync with DLS enabled.
Reproduction
This organisation has 2 files:
File 1: Owned by User A, and User C has read access.
File 2: Owned by User B
Fetch user -> [User C, User A, User B] (this list is generally unordered)
User C:
User B: All good.
User A
Expected behavior
The ideal state of Documents in Elasticsearch should have been:
File 1
allow_access_control: [User A, User C]
File 2
_allow_access_control: [User B]
Actual Behavior
File 1
_allow_access_control: []
File 2
_allow_access_control: [User B]
The fix was suggested as a part of SDH ticket by the customer. I verified that it:
Pre-Review Checklist
v7.13.2
,v7.14.0
,v8.0.0
)