Skip to content

Conversation

@ldematte
Copy link
Contributor

@ldematte ldematte commented Dec 5, 2024

Follow-up to #117239
Instead of scanning policies for modules names, build a scope -> entitlements map during construction.

@ldematte ldematte added >non-issue :Core/Infra/Core Core issues without another label auto-backport Automatically create backport pull requests when merged v9.0.0 v8.18.0 labels Dec 5, 2024
@ldematte ldematte requested review from a team and jdconrad December 5, 2024 14:03
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Dec 5, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Contributor

@jdconrad jdconrad left a comment

Choose a reason for hiding this comment

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

LGTM!

A couple of thoughts:

  1. Does this affect our ability to add class/method level scoping should that ever become a requirement?
  2. Do we still need Policy and Scope or should we just directly parse into the maps as they're being built here?

@ldematte
Copy link
Contributor Author

Does this affect our ability to add class/method level scoping should that ever become a requirement?

I don't think so, we will need to update the map key so instead of being "just" a module name is module name/package/class. Or we can have a 2 level map (map of maps). Anyway, it will stay an internal detail.

Do we still need Policy and Scope or should we just directly parse into the maps as they're being built here?

I kind of like the current structure; Policy and Scope are parser-level concepts, how we organize them efficiently should stay internal to PolicyManager (so we are free to change them, see point above).

@ldematte ldematte merged commit 95315cc into elastic:main Dec 12, 2024
16 checks passed
@ldematte ldematte deleted the entitlements/policy-manager-init branch December 12, 2024 08:29
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x

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

Labels

auto-backport Automatically create backport pull requests when merged :Core/Infra/Core Core issues without another label >non-issue Team:Core/Infra Meta label for core/infra team v8.18.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants