Skip to content
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

Clean up role resolution with CrossClusterApiKeyRoleReference #108707

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

n1v0lg
Copy link
Contributor

@n1v0lg n1v0lg commented May 16, 2024

This PR handles role resolution for cross-cluster API key role references. Previously, these were handled as generic API key role references but the flows are now different enough to use a new, standalone class instead.

Relates: #108600

@n1v0lg n1v0lg added >refactoring :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC labels May 16, 2024
@n1v0lg n1v0lg self-assigned this May 16, 2024
@n1v0lg n1v0lg marked this pull request as ready for review May 22, 2024 12:34
@n1v0lg n1v0lg requested a review from jakelandis May 22, 2024 12:34
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-security (Team:Security)

@elasticsearchmachine elasticsearchmachine added the Team:Security Meta label for security team label May 22, 2024
@n1v0lg
Copy link
Contributor Author

n1v0lg commented Jun 3, 2024

@elasticmachine update branch

Copy link
Contributor

@jakelandis jakelandis left a comment

Choose a reason for hiding this comment

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

LGTM

sorry took so long to review

@@ -127,9 +120,46 @@ public BytesReference getRoleDescriptorsBytes() {
public ApiKeyRoleType getRoleType() {
return roleType;
}
}

final class CrossClusterApiKeyRoleReference implements RoleReference {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can add some javadoc to this , especially to disambiguate this from CrossClusterAccessRoleReference

nit*2: just a style thing...but I generally have a preference towards more top level classes and fewer nested classes. IMO it results in simpler readability and combined with Javadoc leads to less assumptions about what it does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>refactoring :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC Team:Security Meta label for security team v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants