-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 Solutions] Add PLI authorisation for Threat Intelligence #162562
Changes from 1 commit
13d9cf2
1dd8ef6
9de2a6f
dba6942
f38b681
a14bb09
5c5d6bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not aware of how we're going to handle things for ESS and Serverless, but I'm wondering why do we duplicate this component here? We already have a paywal component in the Threat Intelligence plugin. Shouldn't we make that one smarter and handle both ESS and Serverless? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The approaches to authorization for ESS and Serverless are fundamentally different. ESS has several "if platinum" checks throughout the app, whereas Serverless has a centralized, privilege-based system. We can utilize the security_solutions_serverless plugin to register Upselling pages or components and retrieve them with hooks when the page is unauthorized. While it's possible to repurpose the paywal component (if it's accessible on the serverless plugin) and make it more intelligent, the UX team is still working on the final design for serverless Upselling. It's conceivable that there will be a generic Upselling component for all features, so I don't believe it's necessary to refactor the paywal component at this time. But we need to revisit this decision after the designs are ready. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand, thanks for explaining! I think ultimately we should aim at having a similar way to manage these paywall between ESS and Servesless, but I guess this is a discussion for another time :D There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am currently implementing your suggestion at the following PR: #163406. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { EuiEmptyPrompt, EuiIcon } from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import type { AppFeatureKey } from '@kbn/security-solution-plugin/common'; | ||
import { useProductTypeByPLI } from '../hooks/use_product_type_by_pli'; | ||
|
||
const ThreatIntelligencePaywall: React.FC<{ requiredPLI: AppFeatureKey }> = React.memo( | ||
function PaywallComponent({ requiredPLI }) { | ||
const productTypeRequired = useProductTypeByPLI(requiredPLI); | ||
|
||
return ( | ||
machadoum marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<EuiEmptyPrompt | ||
icon={<EuiIcon type="logoSecurity" size="xl" />} | ||
color="subdued" | ||
title={ | ||
<h2> | ||
<FormattedMessage | ||
id="xpack.securitySolutionServerless.threatIntelligence.paywall.title" | ||
defaultMessage="Do more with Security!" | ||
/> | ||
</h2> | ||
} | ||
body={ | ||
<p> | ||
<FormattedMessage | ||
id="xpack.securitySolutionServerless.threatIntelligence.paywall.body" | ||
defaultMessage="Upgrade your license to {productTypeRequired} to use threat intelligence." | ||
values={{ productTypeRequired }} | ||
/> | ||
</p> | ||
} | ||
/> | ||
); | ||
} | ||
); | ||
|
||
ThreatIntelligencePaywall.displayName = 'ThreatIntelligencePaywall'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export { ThreatIntelligencePaywall as default }; |
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.
SecurityRoutePageWrapper
is necessary for displaying the Upsell page.