-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(ingest/tableau): support ingestion of access roles #11157
feat(ingest/tableau): support ingestion of access roles #11157
Conversation
…ure/tableau-ingestion-access-permissions
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@@ -264,8 +273,9 @@ def make_tableau_client(self, site: str) -> Server: | |||
}, | |||
) | |||
|
|||
# From https://stackoverflow.com/a/50159273/5004662. | |||
server._session.trust_env = False | |||
if not self.session_trust_env: |
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.
This was something we discovered along the way. It seems to disable / bypass proxy settings which is not what we want in our case. That's why we made it configurable. Let me know what you think.
If anyone has an idea regarding the failing tests, please let me know. They mostly don't seem related to my changes. I see linting issues in unity source and failing tests for other sources. Am I missing something? |
…ure/tableau-ingestion-access-permissions
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.
Please update tableau connector documentation also for groups are getting ingested as role in DataHub with example of group name in Tableau and corresponding role in DataHub.
metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py
Outdated
Show resolved
Hide resolved
metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py
Outdated
Show resolved
Hide resolved
metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py
Outdated
Show resolved
Hide resolved
description="Use this property if you only need a substring of the group in Tableau to create the role used in the request_url.", | ||
) | ||
|
||
role_description: str = Field( |
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.
Do we need a map here as there might be multiple roles ?
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.
For us it's currently enough to just have one generic description for all the roles. This could be extended to enable mapping between maybe a regex pattern for a role name and a role description in the future. But maybe we wait with this until we see the need for it, WDYT?
@sid-acryl do you mean adding a new section in https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/docs/sources/tableau/tableau_pre.md that explains the new feature of ingesting access roles with some examples? |
Yup and please also update the |
I'm currently fixing the tests and adding a new one - just fyi. |
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.
Lets verify if we need any update in Quickstart guide of tableau (https://github.com/datahub-project/datahub/tree/master/docs/quick-ingestion-guides/tableau)
config: | ||
server: "http://localhost:8080" | ||
``` | ||
Assuming you have groups in Tableau with names like `AB_XY00-Tableau-Access_A_123_PROJECT_XY_Consumer` or `AB_XY00-Tableau-Access_A_123_PROJECT_XY_Analyst` and corresponding IAM roles like `AR-Tableau-PROJECT_XY_Consumer` or `AR-Tableau-PROJECT_XY_Analyst`. |
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.
Please move this assumption to above the recipe and mention how to map this information in recipe to achieve correct transformation.
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.
@sid-acryl I moved it above the recipe and improved the wording. Let me know what you think.
I'd say we don't need to update this part. |
Are you referring to AWS IAM roles when you mention IAM? |
Could be any Identity & Access Management tool. We're using Sailpoint but it doesn't really matter. It doesn't even need to be an IAM tool. Those fields are just there to transform the Tableau groups to what is used in the request link as |
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.
Let's remove the term IAM.
Is it possible for you to test it with other Identity or Cloud Provider (google, azure) ?
metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py
Outdated
Show resolved
Hide resolved
metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py
Outdated
Show resolved
Hide resolved
@@ -298,6 +308,56 @@ def make_tableau_client(self, site: str) -> Server: | |||
) from e | |||
|
|||
|
|||
class AccessRolesIngestionConfig(ConfigModel): | |||
enable_workbooks: bool = Field( |
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.
enable
would be sufficient here.
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.
The idea behind enable_workbooks
is that we can add more entities in the future like views or dashboards. We could then just add a new config property enable_dashboards
or enable_views
. WDYT?
metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py
Outdated
Show resolved
Hide resolved
|
||
request_url: str = Field( | ||
default="", | ||
description="Request URL that is added to the role for requesting 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.
As per code it looks like $ROLE_NAME is required to substitute the role name in request_url.
Request URL that is added to access role metadata. The request URL must include $ROLE_NAME, For example 'https://example-host.com/order/$ROLE_NAME'
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.
No, $ROLE_NAME
shouldn't be required. If it's not present it just won't be replaced. Or where do you see an issue?
Changed various parts according to your feedback. Please have a look at the remaining comments. To your question - no, unfortunately, I don't have the option to test with other IAM providers. But as already said, it doesn't matter what IAM tool is used. The way access requests work in Datahub currently is that there is a link in the Access Management tab of an asset that redirects the user some external page. My changes are only related to this link that is created for each Tableau group. In theory, any link can be created if the role name can be derived from the Tableau group. |
Hey folks, I should've jumped in a bit earlier on this PR. I'm good with
The piece I am worried about is this - this convention feels a bit too specific to your setup.
If we can conclusively say that this is a standard convention for linking AWS / other IAM setups with Tableau, and that other DataHub users will also benefit from this specific setup, then I'm good with it. But I haven't really heard of this setup from other folks thus far. At the same time, I do want to figure out how we can make this work for you. I'd personally be in favor of putting the user/group info in the container's custom properties. That way, you could still build a transformer that can convert custom properties into access aspects. |
…p as custom property
Hi @hsheth2, as discussed offline, I refactored the code and removed the access aspect and role creation again. The ingestion now only sets the Tableau groups as custom properties. Access and role creation will be done in a transformer. Please review the changes again and let me know what you think. Thanks. |
metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py
Outdated
Show resolved
Hide resolved
metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py
Outdated
Show resolved
Hide resolved
metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py
Outdated
Show resolved
Hide resolved
metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py
Outdated
Show resolved
Hide resolved
@haeniya feels like we're pretty close here :) |
@haeniya looks like the tests are failing
|
…//github.com/haeniya/datahub into feature/tableau-ingestion-access-permissions
…ect#11157) Co-authored-by: Yanik Häni <[email protected]> Co-authored-by: Harshal Sheth <[email protected]>
Description
This PR enables the optional ingestion of access roles for the Tableau ingestion. To do this, we fetch the group permissions from the Tableau API, optionally transform it to the users needs and add them as roles to the Tableau asset. Currently, it is only implemented for Workbooks but could be extended to other assets as well.
The configuration in the recipe could look something like this:
The
access
aspect was only available for datasets before. That's why I added it to containers now. The "Access Management" tab should only be visible in the UI if there's an access aspect associated with the container.Let me know what you think and I will add some tests for this.
Thanks.
Checklist