Skip to content

Passing user roles from query originator to other nodes#42537

Closed
Enmk wants to merge 16 commits intoClickHouse:masterfrom
Enmk:ldap_remote_roles
Closed

Passing user roles from query originator to other nodes#42537
Enmk wants to merge 16 commits intoClickHouse:masterfrom
Enmk:ldap_remote_roles

Conversation

@Enmk
Copy link
Contributor

@Enmk Enmk commented Oct 20, 2022

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Push user roles from query originator to other nodes in cluster. Helpful when only originator has access to the external authenticator (like LDAP).
...

closes: #34130

@robot-ch-test-poll robot-ch-test-poll added the pr-feature Pull request with new product feature label Oct 20, 2022
@vitlibar vitlibar self-assigned this Oct 20, 2022
@alexey-milovidov alexey-milovidov marked this pull request as draft October 22, 2022 02:24
@alexey-milovidov
Copy link
Member

Missing tests.

@vitlibar
Copy link
Member

Is this PR still in work?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we combine those additional_roles with current_roles and use one parameter instead of two ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there is also use_default_roles, that controls which roles are applied to the ContextAccess.

I'm not entirely sure why use_default_roles should be false or true, hence wasn't sure if the same logic should be applied to external_roles.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are those additional_roles used for?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it enough logging for authentication already?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are leftovers from debugging session and should be removed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was wrong with just toString?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftovers from debugging, will be removed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftovers from debugging, will be removed.

Copy link
Member

@vitlibar vitlibar Dec 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understood correctly, additional roles == extra_roles == extra_granted_roles? Is it correct? So many names...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, renaming all that to just external_roles

Comment on lines 257 to 273
Copy link
Member

@vitlibar vitlibar Dec 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part looks strange. What is it for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roles UUIDs might be different on cluster nodes, while names 100% match, so it makes sense to send roles as list of names rather than list of UUIDs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably it's better to check this setting before sending those external roles (and don't send them if it's false).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enmk added 2 commits February 13, 2023 11:16
This is to address case when originator have access to remote
auth provider (like LDAP server), but other nodes in cluster don't.
Sending roles only if `allow_extenral_roles_in_interserver_queries` setting is ON
renamed various naming variants of 'additional', 'extra', 'externally granted' to 'external_roles'
removed various debugging leftovers
minor cleanup
@alexey-milovidov
Copy link
Member

Missing tests.

@Enmk Enmk marked this pull request as ready for review February 13, 2023 14:45
@Enmk
Copy link
Contributor Author

Enmk commented Feb 14, 2023

Missing tests.

Could you please mark this as "ready for tests", so we can execute produced binaries against LDAP suite from here: https://github.com/Altinity/clickhouse-regression/tree/main/ldap ?

@alexey-milovidov
Copy link
Member

The tests should run in CI.

@vitlibar vitlibar added the can be tested Allows running workflows for external contributors label Feb 14, 2023
@robot-clickhouse
Copy link
Member

robot-clickhouse commented May 27, 2023

This is an automated comment for commit 558c806 with description of existing statuses. It's updated for the latest CI running
The full report is available here
The overall status of the commit is 🔴 failure

Check nameDescriptionStatus
CI runningA meta-check that indicates the running CI. Normally, it's in success or pending state. The failed status indicates some problems with the PR🟡 pending
Docs CheckBuilds and tests the documentation🟡 pending
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here🔴 failure
Mergeable CheckChecks if all other necessary checks are successful🔴 failure
Push to DockerhubThe check for building and pushing the CI related docker images to docker hub🟢 success
Style CheckRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report🟢 success

zvonand added a commit to zvonand/ClickHouse that referenced this pull request Oct 9, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Oct 20, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Oct 20, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Oct 20, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Oct 23, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Oct 23, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Oct 23, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Oct 26, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Oct 28, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Oct 28, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Oct 28, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Oct 28, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Oct 28, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Oct 28, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Oct 28, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Oct 28, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Oct 29, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Nov 1, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Nov 1, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Nov 1, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Nov 4, 2024
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Nov 5, 2024
Co-authored-by: Enmk <[email protected]>

fix memory access
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Nov 5, 2024
Co-authored-by: Enmk <[email protected]>

fix memory access
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Nov 9, 2024
Co-authored-by: Enmk <[email protected]>

fix memory access
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Nov 10, 2024
Co-authored-by: Enmk <[email protected]>

fix memory access
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Nov 11, 2024
Co-authored-by: Enmk <[email protected]>

fix memory access
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Nov 11, 2024
Co-authored-by: Enmk <[email protected]>

fix memory access
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Nov 18, 2024
Co-authored-by: Enmk <[email protected]>

fix memory access
zvonand added a commit to zvonand/ClickHouse that referenced this pull request Nov 19, 2024
Co-authored-by: Enmk <[email protected]>

fix memory access
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors manual approve Manual approve required to run CI pr-feature Pull request with new product feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LDAP: authentication with configured role mapping fails on a cluster with a secret

6 participants