-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Security Solution] Add searchDeepLinks to security solution #89772
[Security Solution] Add searchDeepLinks to security solution #89772
Conversation
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
it('returns a subset of links for basic license, full set for platinum', () => { | ||
const basicLicense = 'basic'; | ||
const platinumLicense = 'platinum'; | ||
for (const pageName of Object.values(SecurityPageName)) { |
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.
This might been a good fit for describe.each
or it.each
. See https://jestjs.io/docs/en/api#describeeachtablename-fn-timeout
For now, perhaps add expect.assertions
as described here: https://jestjs.io/docs/en/expect#expectassertionsnumber
}, | ||
], | ||
// The tabs in the detections subPlugin are not their own route as they are in other subplugins. If they were, add metadata here to enable search. | ||
// premium: [ |
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.
Consider removing this dead code.
import { SecuritySubPluginNames, SecurityDeepLinks } from '../types'; | ||
import { AppMeta } from '../../../../../../src/core/public'; | ||
|
||
const securityDeepLinks: SecurityDeepLinks = { |
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.
If the paths used for the pages are changed, and these configurations aren't changed, that would introduce a bug. Perhaps you could write a functional test to prove that this works. The test could search for the pages in the global search bar and click the results (and verify that the expected page shows up.)
If nothing else, it would be good to add a similar test to a manual test plan.
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.
Yes, I agree. Will add a functional test later.
@@ -73,6 +75,9 @@ export class Plugin implements IPlugin<PluginSetup, PluginStart, SetupPlugins, S | |||
constructor(initializerContext: PluginInitializerContext) { | |||
this.kibanaVersion = initializerContext.env.packageInfo.version; | |||
} | |||
private detectionsUpdater$ = new BehaviorSubject<AppUpdater>(() => ({})); |
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.
Would you explain this (in a comment perhaps?) Why do these BehaviorSubject's take such functions?
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.
it's an initial value, not needed in this case, so changing to just Subject
@@ -356,7 +365,21 @@ export class Plugin implements IPlugin<PluginSetup, PluginStart, SetupPlugins, S | |||
}); | |||
} | |||
licenseService.start(plugins.licensing.license$); | |||
|
|||
const licensing = licenseService.getLicenseInformation$(); |
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.
Would you add a short comment here describing what this code does?
💚 Build SucceededMetrics [docs]Module Count
Page load bundle
History
To update your PR or re-run it, just comment with: |
…#89772) * WIP add search for siem entities * Remove frontend search provider, use searchDeepLinks from core * Comment and use both functions used to generate subPlugin meta information * Use correct url for timeline templates * Remove case management attibute from saved object type * Remove unused globalSearch plugin from kibana.json * Add comments, use Subject instead of BehaviorSubject for appUpdaters * Unsubscribe from license on plugin stop
…#91788) * WIP add search for siem entities * Remove frontend search provider, use searchDeepLinks from core * Comment and use both functions used to generate subPlugin meta information * Use correct url for timeline templates * Remove case management attibute from saved object type * Remove unused globalSearch plugin from kibana.json * Add comments, use Subject instead of BehaviorSubject for appUpdaters * Unsubscribe from license on plugin stop
Summary
This pr adds searchDeepLinks for each of the subPlugins in the SIEM app, and updates them as appropriate when license levels change. All parts of the SIEM app that have their own route are included, however detection tabs are not, as the activeTab is managed in application state instead of url state. Closes #86167.
Checklist
Delete any items that are not applicable to this PR.
For maintainers