Support LimitedRole in idp role resolution#140536
Merged
tvernum merged 8 commits intoelastic:mainfrom Jan 16, 2026
Merged
Conversation
The identity provider relies on `GetUserPrivilegesAction` to inform the decision about which roles should be assigned to a user in an outgoing SAML authentication `Response` message. However `GetUserPrivilegesAction` could not handle the `LimitedRole` class which is used to represent the privileges of an API Key that has directly assigned roles in additional to its implied user roles. In order to support such API Keys in the IdP plugin, `GetUserPrivilegesRequest` has been modified to optionally unwrap a `LimitedRole` into either its directly assigned role or implied limiting role. The IdP plugin uses the limiting role which represents the original privileges of the owning user. The information extracted from this role is then fed into the `HasPrivilegesAction` to accurately determine which appication privilegs the API Key actually holds, and which SSO roles should be assigned in the outgoing SAML message. Relates: elastic#104026
Collaborator
|
Pinging @elastic/es-security (Team:Security) |
Collaborator
|
Hi @tvernum, I've created a changelog YAML for you. |
ebarlas
approved these changes
Jan 13, 2026
Contributor
ebarlas
left a comment
There was a problem hiding this comment.
LGTM with minor suggestion
...ck/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/RBACEngineTests.java
Show resolved
Hide resolved
tvernum
added a commit
to tvernum/elasticsearch
that referenced
this pull request
Jan 16, 2026
The identity provider relies on `GetUserPrivilegesAction` to inform the decision about which roles should be assigned to a user in an outgoing SAML authentication `Response` message. However `GetUserPrivilegesAction` could not handle the `LimitedRole` class which is used to represent the privileges of an API Key that has directly assigned roles in additional to its implied user roles. In order to support such API Keys in the IdP plugin, `GetUserPrivilegesRequest` has been modified to optionally unwrap a `LimitedRole` into either its directly assigned role or implied limiting role. The IdP plugin uses the limiting role which represents the original privileges of the owning user. The information extracted from this role is then fed into the `HasPrivilegesAction` to accurately determine which appication privilegs the API Key actually holds, and which SSO roles should be assigned in the outgoing SAML message. Relates: elastic#104026
Collaborator
💔 Backport failed
|
tvernum
added a commit
to tvernum/elasticsearch
that referenced
this pull request
Jan 19, 2026
The identity provider relies on `GetUserPrivilegesAction` to inform the decision about which roles should be assigned to a user in an outgoing SAML authentication `Response` message. However `GetUserPrivilegesAction` could not handle the `LimitedRole` class which is used to represent the privileges of an API Key that has directly assigned roles in additional to its implied user roles. In order to support such API Keys in the IdP plugin, `GetUserPrivilegesRequest` has been modified to optionally unwrap a `LimitedRole` into either its directly assigned role or implied limiting role. The IdP plugin uses the limiting role which represents the original privileges of the owning user. The information extracted from this role is then fed into the `HasPrivilegesAction` to accurately determine which appication privilegs the API Key actually holds, and which SSO roles should be assigned in the outgoing SAML message. Backport of: elastic#140536, elastic#140816
elasticsearchmachine
pushed a commit
that referenced
this pull request
Jan 19, 2026
The identity provider relies on `GetUserPrivilegesAction` to inform the decision about which roles should be assigned to a user in an outgoing SAML authentication `Response` message. However `GetUserPrivilegesAction` could not handle the `LimitedRole` class which is used to represent the privileges of an API Key that has directly assigned roles in additional to its implied user roles. In order to support such API Keys in the IdP plugin, `GetUserPrivilegesRequest` has been modified to optionally unwrap a `LimitedRole` into either its directly assigned role or implied limiting role. The IdP plugin uses the limiting role which represents the original privileges of the owning user. The information extracted from this role is then fed into the `HasPrivilegesAction` to accurately determine which appication privilegs the API Key actually holds, and which SSO roles should be assigned in the outgoing SAML message. Relates: #104026
tvernum
added a commit
to tvernum/elasticsearch
that referenced
this pull request
Jan 19, 2026
The identity provider relies on `GetUserPrivilegesAction` to inform the decision about which roles should be assigned to a user in an outgoing SAML authentication `Response` message. However `GetUserPrivilegesAction` could not handle the `LimitedRole` class which is used to represent the privileges of an API Key that has directly assigned roles in additional to its implied user roles. In order to support such API Keys in the IdP plugin, `GetUserPrivilegesRequest` has been modified to optionally unwrap a `LimitedRole` into either its directly assigned role or implied limiting role. The IdP plugin uses the limiting role which represents the original privileges of the owning user. The information extracted from this role is then fed into the `HasPrivilegesAction` to accurately determine which appication privilegs the API Key actually holds, and which SSO roles should be assigned in the outgoing SAML message. Backport of: elastic#140536, elastic#140816, elastic#140871
elasticsearchmachine
pushed a commit
that referenced
this pull request
Jan 21, 2026
The identity provider relies on `GetUserPrivilegesAction` to inform the decision about which roles should be assigned to a user in an outgoing SAML authentication `Response` message. However `GetUserPrivilegesAction` could not handle the `LimitedRole` class which is used to represent the privileges of an API Key that has directly assigned roles in additional to its implied user roles. In order to support such API Keys in the IdP plugin, `GetUserPrivilegesRequest` has been modified to optionally unwrap a `LimitedRole` into either its directly assigned role or implied limiting role. The IdP plugin uses the limiting role which represents the original privileges of the owning user. The information extracted from this role is then fed into the `HasPrivilegesAction` to accurately determine which appication privilegs the API Key actually holds, and which SSO roles should be assigned in the outgoing SAML message. Backport of: #140536, #140816, #140871
elasticsearchmachine
pushed a commit
that referenced
this pull request
Jan 21, 2026
The identity provider relies on `GetUserPrivilegesAction` to inform the decision about which roles should be assigned to a user in an outgoing SAML authentication `Response` message. However `GetUserPrivilegesAction` could not handle the `LimitedRole` class which is used to represent the privileges of an API Key that has directly assigned roles in additional to its implied user roles. In order to support such API Keys in the IdP plugin, `GetUserPrivilegesRequest` has been modified to optionally unwrap a `LimitedRole` into either its directly assigned role or implied limiting role. The IdP plugin uses the limiting role which represents the original privileges of the owning user. The information extracted from this role is then fed into the `HasPrivilegesAction` to accurately determine which appication privilegs the API Key actually holds, and which SSO roles should be assigned in the outgoing SAML message. Backport of: #140536, #140816
spinscale
pushed a commit
to spinscale/elasticsearch
that referenced
this pull request
Jan 21, 2026
The identity provider relies on `GetUserPrivilegesAction` to inform the decision about which roles should be assigned to a user in an outgoing SAML authentication `Response` message. However `GetUserPrivilegesAction` could not handle the `LimitedRole` class which is used to represent the privileges of an API Key that has directly assigned roles in additional to its implied user roles. In order to support such API Keys in the IdP plugin, `GetUserPrivilegesRequest` has been modified to optionally unwrap a `LimitedRole` into either its directly assigned role or implied limiting role. The IdP plugin uses the limiting role which represents the original privileges of the owning user. The information extracted from this role is then fed into the `HasPrivilegesAction` to accurately determine which appication privilegs the API Key actually holds, and which SSO roles should be assigned in the outgoing SAML message. Relates: elastic#104026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The identity provider relies on
GetUserPrivilegesActionto inform the decision about which roles should be assigned to a user in an outgoing SAML authenticationResponsemessage.However
GetUserPrivilegesActioncould not handle theLimitedRoleclass which is used to represent the privileges of an API Key that has directly assigned roles in additional to its implied user roles.In order to support such API Keys in the IdP plugin,
GetUserPrivilegesRequesthas been modified to optionally unwrap aLimitedRoleinto either its directly assigned role or implied limiting role.The IdP plugin uses the limiting role which represents the original privileges of the owning user. The information extracted from this role is then fed into the
HasPrivilegesActionto accurately determine which appication privilegs the API Key actually holds, and which SSO roles should be assigned in the outgoing SAML message.Relates: #104026