@redsift/products 12.5.16-alpha.1 → 12.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { a7 as signalCardsLogger, a8 as useSignalCardTranslation, a9 as useCollapseController, aa as adaptAmpExtractor, ab as ExtractedCategoryContent, ac as Checklist, ad as SignalCardNormal, ae as EXTRACTION_CAPTION_KEYS, af as adaptDkimExtractor, ag as useMultiNamespaceTranslation, ah as adaptDomainAnalyzerDkimExtractor, ai as COLOR, aj as parseGlossaryMarkdown, ak as TooltipInPortalWrapper, al as FONT, am as adaptDmarcExtractor, an as DmarcPromoBanner, ao as adaptDnssecExtractor, ap as adaptFcrdnsExtractor, aq as adaptMtaStsExtractor, ar as adaptSpfExtractor, E as Ehlo, R as ReturnPath, as as adaptDomainAnalyzerSpfExtractor, at as adaptSubdoExtractor, au as adaptThreatIntelligenceExtractor, av as adaptTlsExtractor, aw as adaptUrlsExtractor, ax as SignalCardDmarcDomain$1, ay as SignalCardSpfDomain$1, az as SignalCardBimi$1, a as useResolvedTheme, S as SignalCardThemeProvider, aA as withSignalCardTheme } from './SignalCardSpfDomain.js';
2
2
  export { A as ARecord, Q as ATAG, I as BimiRecord, M as CMC, i as Canonicalization, H as CipherSuite, C as CnameRecord, D as Dkim, m as DkimAlgorithm, w as DkimAlignment, h as DkimSelector, k as DkimSignature, s as DkimSigningDomain, U as Dmarc, J as DmarcCompliant, n as DmarcPolicy, E as Ehlo, F as From, a6 as GLOSSARY_ICON_MAP, G as GlossaryTerm, N as ITAG, K as KeyLength, a0 as MaxAge, _ as Mode, a1 as MtaStsCertificate, a3 as MtaStsCertificateCnameName, a5 as MtaStsCertificateCnameType, a4 as MtaStsCertificateCnameValue, a2 as MtaStsCertificateExpiry, Y as MtaStsPolicyFile, X as MtaStsRecord, $ as Mx, O as OrganizationalDomain, o as Pct, P as PtrRecord, R as ReturnPath, q as Rua, r as Ruf, L as SVG, b as SenderIp, S as SignalCardThemeProvider, j as SignedHeaders, f as SignerDomain, p as Sp, y as Spf, x as SpfAlignment, t as SpfDomain, d as SpfRecord, B as Ssl, v as SubdomainPolicy, z as Tls, W as TlsRptRecord, l as Ttl, T as TxtRecord, e as TxtRecords, V as VMC, Z as Version, c as createGlossaryLink, g as glossaryLabelIds, a as useResolvedTheme, u as useSignalCardTheme } from './SignalCardSpfDomain.js';
3
- import { DKIM_KEY, extractGoogleYahooComplianceData, statusToTranslationKey, buildSPFCheckerLink, getSpfPassResult, SUBDO_CARD_STATUS, SIGNAL_TYPES, BIMI_CHECKER_SIGNAL_TYPES, DOMAIN_ANALYZER_SIGNAL_TYPES, SIGNAL_CARD_POSITIONS, STATUS_ICON_STYLES, getCanonicalSignalType, DEFAULT_PRIORITY_SIGNAL_TYPES, getSignalStatus } from '@redsift/signal-logic';
3
+ import { DKIM_KEY, getDmarcAlignmentStatus, extractGoogleYahooComplianceData, statusToTranslationKey, buildSPFCheckerLink, getSpfPassResult, SUBDO_CARD_STATUS, SIGNAL_TYPES, BIMI_CHECKER_SIGNAL_TYPES, DOMAIN_ANALYZER_SIGNAL_TYPES, SIGNAL_CARD_POSITIONS, STATUS_ICON_STYLES, getCanonicalSignalType, DEFAULT_PRIORITY_SIGNAL_TYPES, getSignalStatus } from '@redsift/signal-logic';
4
4
  export { BIMI_CHECKER_SIGNAL_TYPES, CARD_STATUS, DOMAIN_ANALYZER_SIGNAL_TYPES, PUBLIC_INVESTIGATE_SIGNAL_TYPES, SIGNAL_TYPES, getSignalStatus } from '@redsift/signal-logic';
5
5
  import { _ as _objectWithoutProperties, a as _extends, b as _objectSpread2 } from './_rollupPluginBabelHelpers.js';
6
6
  import React__default, { Component, forwardRef, useMemo, useState, useCallback, useEffect, memo } from 'react';
@@ -1494,13 +1494,37 @@ SignalCardDkimDomainAnalyzer$1.className = CLASSNAME$c;
1494
1494
 
1495
1495
  const _excluded$c = ["message"];
1496
1496
  const SAND = '#f5f2eb';
1497
+ /**
1498
+ * Which aligned mechanisms carried the pass. DMARC needs only one of them, so `'pass'` (whose copy
1499
+ * says the email "passed both DKIM and SPF") is reserved for when both did (DS-118).
1500
+ * Returns null when neither did.
1501
+ *
1502
+ * The DKIM leg is read through signal-logic, never from the raw `dmarc.alignDkim` scalar. The API
1503
+ * derives that scalar from one collapsed signing domain, so it reports `false` for a message where
1504
+ * another signature verified and aligned (see `multi-dkim-alignment-data.ts`). signal-logic settles
1505
+ * the leg from the signatures, and that is the verdict the card beside this box shows.
1506
+ */
1507
+ function getPassState(dmarc, dkim) {
1508
+ const {
1509
+ dkimAligned,
1510
+ spfAligned
1511
+ } = getDmarcAlignmentStatus(dmarc, dkim, null);
1512
+ if (dkimAligned && spfAligned) return 'pass';
1513
+ if (dkimAligned) return 'pass-dkim-only';
1514
+ if (spfAligned) return 'pass-spf-only';
1515
+ return null;
1516
+ }
1517
+
1497
1518
  /**
1498
1519
  * Determines the email compliance state from DMARC data.
1499
1520
  * Returns null when compliance cannot be determined (permerror, temperror, none).
1500
1521
  */
1501
- function getEmailComplianceState(dmarc) {
1522
+ function getEmailComplianceState(dmarc, dkim) {
1523
+ var _getPassState;
1502
1524
  if (!dmarc) return null;
1503
- if (dmarc.result === 'pass') return 'pass';
1525
+ // With no alignment data at all there is no mechanism to name, so a pass keeps the both-passed
1526
+ // copy it always had.
1527
+ if (dmarc.result === 'pass') return (_getPassState = getPassState(dmarc, dkim)) !== null && _getPassState !== void 0 ? _getPassState : 'pass';
1504
1528
  if (dmarc.result === 'fail') {
1505
1529
  if (!dmarc.alignDkim && !dmarc.alignSpf) return 'fail-both';
1506
1530
  if (!dmarc.alignDkim) return 'fail-dkim';
@@ -1511,7 +1535,8 @@ function getEmailComplianceState(dmarc) {
1511
1535
  // evaluate compliance based on it instead of returning 'none'.
1512
1536
  if (dmarc.result === 'none') {
1513
1537
  if (dmarc.policy) {
1514
- if (dmarc.alignDkim || dmarc.alignSpf) return 'pass';
1538
+ const passState = getPassState(dmarc, dkim);
1539
+ if (passState) return passState;
1515
1540
  if (dmarc.alignDkim === false && dmarc.alignSpf === false) return 'fail-both';
1516
1541
  if (dmarc.alignDkim === false) return 'fail-dkim';
1517
1542
  if (dmarc.alignSpf === false) return 'fail-spf';
@@ -1524,7 +1549,8 @@ function getEmailComplianceState(dmarc) {
1524
1549
  // Compliance CAN be determined — evaluate alignment normally.
1525
1550
  const hasRua = Boolean((_dmarc$policy = dmarc.policy) === null || _dmarc$policy === void 0 ? void 0 : (_dmarc$policy$rua = _dmarc$policy.rua) === null || _dmarc$policy$rua === void 0 ? void 0 : _dmarc$policy$rua.length) || /(?:^|;\s*)rua\s*=\s*mailto:/i.test((_dmarc$raw = dmarc.raw) !== null && _dmarc$raw !== void 0 ? _dmarc$raw : '');
1526
1551
  if (hasRua) {
1527
- if (dmarc.alignDkim || dmarc.alignSpf) return 'pass';
1552
+ const passState = getPassState(dmarc, dkim);
1553
+ if (passState) return passState;
1528
1554
  if (dmarc.alignDkim === false && dmarc.alignSpf === false) return 'fail-both';
1529
1555
  if (dmarc.alignDkim === false) return 'fail-dkim';
1530
1556
  if (dmarc.alignSpf === false) return 'fail-spf';
@@ -1568,6 +1594,8 @@ function getDomainPolicyState(dmarc) {
1568
1594
  }
1569
1595
  const EMAIL_STATUS = {
1570
1596
  pass: 'good',
1597
+ 'pass-dkim-only': 'good',
1598
+ 'pass-spf-only': 'good',
1571
1599
  'fail-both': 'danger',
1572
1600
  'fail-dkim': 'danger',
1573
1601
  'fail-spf': 'danger',
@@ -1719,11 +1747,12 @@ function DmarcSummaryBoxes(_ref2) {
1719
1747
  var _dmarc$policy$pct, _dmarc$policy2, _dmarc$policy3, _dmarc$policy3$rua, _dmarc$raw2, _dmarc$policyDomain$r, _dmarc$policyDomain;
1720
1748
  let {
1721
1749
  dmarc,
1750
+ dkim,
1722
1751
  isDomainAnalyzer = false,
1723
1752
  t
1724
1753
  } = _ref2;
1725
1754
  const domainState = getDomainPolicyState(dmarc);
1726
- const emailState = isDomainAnalyzer ? null : getEmailComplianceState(dmarc);
1755
+ const emailState = isDomainAnalyzer ? null : getEmailComplianceState(dmarc, dkim);
1727
1756
  const pct = (_dmarc$policy$pct = dmarc === null || dmarc === void 0 ? void 0 : (_dmarc$policy2 = dmarc.policy) === null || _dmarc$policy2 === void 0 ? void 0 : _dmarc$policy2.pct) !== null && _dmarc$policy$pct !== void 0 ? _dmarc$policy$pct : 100;
1728
1757
  const reportWarnings = hasReportWarnings(dmarc);
1729
1758
  const hasRua = Boolean(dmarc === null || dmarc === void 0 ? void 0 : (_dmarc$policy3 = dmarc.policy) === null || _dmarc$policy3 === void 0 ? void 0 : (_dmarc$policy3$rua = _dmarc$policy3.rua) === null || _dmarc$policy3$rua === void 0 ? void 0 : _dmarc$policy3$rua.length) || /(?:^|;\s*)rua\s*=\s*mailto:/i.test((_dmarc$raw2 = dmarc === null || dmarc === void 0 ? void 0 : dmarc.raw) !== null && _dmarc$raw2 !== void 0 ? _dmarc$raw2 : '');
@@ -1804,6 +1833,10 @@ function DmarcSummaryBoxes(_ref2) {
1804
1833
  switch (state) {
1805
1834
  case 'pass':
1806
1835
  return t('card.dmarc.summary-email-pass');
1836
+ case 'pass-dkim-only':
1837
+ return t('card.dmarc.summary-email-pass-dkim-only');
1838
+ case 'pass-spf-only':
1839
+ return t('card.dmarc.summary-email-pass-spf-only');
1807
1840
  case 'fail-both':
1808
1841
  return t('card.dmarc.summary-email-fail-both');
1809
1842
  case 'fail-dkim':
@@ -1899,11 +1932,12 @@ const SignalCardDmarc$1 = /*#__PURE__*/forwardRef((props, ref) => {
1899
1932
  })();
1900
1933
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(DmarcSummaryBoxes, {
1901
1934
  dmarc: dmarc,
1935
+ dkim: dkim,
1902
1936
  isDomainAnalyzer: isDomainAnalyzer,
1903
1937
  cardType: cardType,
1904
1938
  t: t
1905
1939
  }), bannerContent);
1906
- }, [dmarc, isDomainAnalyzer, cardType, t, renderHeader, useInvestigateColors, promoHref, onPromoClick, promoText, promoButtonLabel]);
1940
+ }, [dmarc, dkim, isDomainAnalyzer, cardType, t, renderHeader, useInvestigateColors, promoHref, onPromoClick, promoText, promoButtonLabel]);
1907
1941
  const sections = [...((extractedItemsCategories === null || extractedItemsCategories === void 0 ? void 0 : extractedItemsCategories.filter(cat => cat.items && cat.items.length > 0).map((cat, i) => {
1908
1942
  var _cat$extractionBox;
1909
1943
  return {