-
Notifications
You must be signed in to change notification settings - Fork 157
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
Add DLS in Salesforce #2022
Add DLS in Salesforce #2022
Conversation
@moxarth-elastic can you provide instructions on how to manually test DLS? |
connectors/sources/salesforce.py
Outdated
"""Get access control documents for active Atlassian users. | ||
|
||
This method fetches access control documents for active Atlassian users when document level security (DLS) | ||
is enabled. It starts by checking if DLS is enabled, and if not, it logs a warning message and skips further processing. | ||
If DLS is enabled, the method fetches all users from the Salesforce API, filters out active Atlassian users, | ||
and fetches additional information for each active user using the _fetch_user method. After gathering the user information, | ||
it generates an access control document for each user using the user_access_control_doc method and yields the results. | ||
|
||
Yields: | ||
dict: An access control document for each active Atlassian user. | ||
""" |
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.
What do Atlassian users have to do with Salesforce DLS?
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.
Ah, my bad! Updated now ✅
connectors/sources/salesforce.py
Outdated
return | ||
|
||
self._logger.debug( | ||
f"Fetching users who has Read access for Salesforce object: {sobject}" |
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.
f"Fetching users who has Read access for Salesforce object: {sobject}" | |
f"Fetching users who have read access for Salesforce object: {sobject}" |
connectors/sources/salesforce.py
Outdated
yield doc | ||
|
||
async def _fetch_users_with_read_access(self, sobject): | ||
if not self._dls_enabled(): | ||
self._logger.warning("DLS is not enabled. Skipping") |
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.
Should this be a warning? I feel that it could get quite noisy. This isn't called during ACL syncs as far as I can see, so debug might be more appropriate.
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.
There is no issue in it, i've made it a debug logger
connectors/sources/salesforce.py
Outdated
self._logger.warning("DLS is not enabled. Skipping") | ||
return | ||
|
||
self._logger.info("Fetching Salesforce users") |
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.
self._logger.info("Fetching Salesforce users") | |
self._logger.debug("Fetching Salesforce users") |
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.
LGTM!
💔 Failed to create backport PR(s)The backport operation could not be completed due to the following error: The backport PRs will be merged automatically after passing CI. To backport manually run: |
Part of #1859
This PR adds the support of Document Level Security for the Salesforce connector.
Refer the discovery document for more details: drive link
Checklists
Pre-Review Checklist
v7.13.2
,v7.14.0
,v8.0.0
)