-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Extract authorization logic and it's peripherals into packages #190028
Extract authorization logic and it's peripherals into packages #190028
Conversation
64cc29d
to
45d35dd
Compare
1d9ea5c
to
8ed5c15
Compare
Note for reviewers; The |
/ci |
Pinging @elastic/kibana-security (Team:Security) |
@elasticmachine merge upstream |
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.
Overall LGTM! Just one question below
|
||
import type { SpacesPluginSetup } from '@kbn/spaces-plugin/server'; | ||
|
||
export type SpacesService = SpacesPluginSetup['spacesService']; |
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.
Question: Is this being used anywhere?
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.
Nit: If this is intended for a future change, we recommend not introducing a dependency where a package depends on a plugins exported types. Ideally, such a dependency would be moved to a common package from where it'd be imported in all places where it's used.
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.
Hey @kc13greiner thanks for pointing this out, the type was actually not in use. I've removed it, and @SiddharthMantri thanks for the guidance there's a chance I'd actually need the type in the follow PR to this one.
…with package identifier
47218a6
to
42d4579
Compare
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.
LGTM!
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Unknown metric groupsAPI count
References to deprecated APIs
History
To update your PR or re-run it, just comment with: cc @eokoneyo |
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.
Thanks for the updates - LGTM!
Summary
This PR is a precursor to #189871, as part of the spaces improvement initiative there's a need to be able to share the user privilege assignment component between the roles experience and the new spaces experience to prevent duplication of business logic and cohesiveness in the privilege assignment experience.
The aforementioned PR extracts the required component into it's own package so it might be consumed as needed, this PR is particularly concerned with extracting business logic said UI component depends on that exists still within the security plugin. For context; the security plugin already depends on the spaces plugin, so having the spaces plugin in turn statically depend on the security plugin creates a cyclic dependency. That being said to complement the eventual state of said component so it might be imported elsewhere outside of the security plugin there's a need to extract further logic into standalone packages, so that the spaces plugin can consume this plugin without the afore mentioned cyclic dependency problem.
Visually;
Problem;
Proposal
1
Footnotes
items marked in blue are the packages created in this PR, whilst the entire diagram is the proposed future state ↩