import {RouteComponentProps} from 'react-router'; import ExternalLink from 'sentry/components/links/externalLink'; import Panel from 'sentry/components/panels/panel'; import PanelBody from 'sentry/components/panels/panelBody'; import PanelHeader from 'sentry/components/panels/panelHeader'; import PreviewFeature from 'sentry/components/previewFeature'; import {t, tct} from 'sentry/locale'; import {Organization, ProjectKey} from 'sentry/types'; import routeTitleGen from 'sentry/utils/routeTitle'; import withOrganization from 'sentry/utils/withOrganization'; import DeprecatedAsyncView from 'sentry/views/deprecatedAsyncView'; import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader'; import ReportUri, { getSecurityDsn, } from 'sentry/views/settings/projectSecurityHeaders/reportUri'; type Props = RouteComponentProps<{projectId: string}, {}> & { organization: Organization; }; type State = { keyList: null | ProjectKey[]; } & DeprecatedAsyncView['state']; class ProjectExpectCtReports extends DeprecatedAsyncView { getEndpoints(): ReturnType { const {organization} = this.props; const {projectId} = this.props.params; return [['keyList', `/projects/${organization.slug}/${projectId}/keys/`]]; } getTitle() { const {projectId} = this.props.params; return routeTitleGen(t('Certificate Transparency (Expect-CT)'), projectId, false); } getInstructions(keyList: ProjectKey[]) { return `Expect-CT: report-uri="${getSecurityDsn(keyList)}"`; } renderBody() { const {organization, params} = this.props; const {keyList} = this.state; if (!keyList) { return null; } return (
{t('About')}

{tct( `[link:Certificate Transparency] (CT) is a security standard which helps track and identify valid certificates, allowing identification of maliciously issued certificates`, { link: ( ), } )}

{tct( "To configure reports in Sentry, you'll need to configure the [header] a header from your server:", { header: Expect-CT, } )}

{this.getInstructions(keyList)}

{tct('For more information, see [link:the article on MDN].', { link: ( ), })}

); } } export default withOrganization(ProjectExpectCtReports);