@remit/web-client 0.0.340 → 0.0.341

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,5 +1,5 @@
1
1
  import { addressOperationsSearchAddressesOptions } from "@remit/api-http-client/@tanstack/react-query.gen.ts";
2
- import { DisplayNameCorrespondence } from "@remit/domain-enums";
2
+ import { DisplayNameCorrespondence, SenderTrust } from "@remit/domain-enums";
3
3
  import { isThreadCategory } from "@remit/ui";
4
4
  import { useQuery } from "@tanstack/react-query";
5
5
  import { useMemo } from "react";
@@ -114,11 +114,12 @@ function joinDomains(domains) {
114
114
  * tier's entire summary: there is no separate "verified" sentence in front
115
115
  * of them for the signing fact to hide behind.
116
116
  */
117
- function describeSenderMismatch(auth, claimedBrand) {
117
+ function describeSenderMismatch(auth, claimedBrand, senderTrust) {
118
+ const trusted = senderTrust === SenderTrust.Vip || senderTrust === SenderTrust.Wellknown;
118
119
  const clauses = [];
119
120
  const correspondence = auth.displayNameCorrespondence;
120
121
  if (claimedBrand) {
121
- if (correspondence === DisplayNameCorrespondence.Unrelated) {
122
+ if (correspondence === DisplayNameCorrespondence.Unrelated && !trusted) {
122
123
  clauses.push(`The name it shows, "${claimedBrand}", has nothing to do with ${auth.fromDomain}.`);
123
124
  }
124
125
  else if (correspondence === DisplayNameCorrespondence.Lookalike) {
@@ -129,7 +130,7 @@ function describeSenderMismatch(auth, claimedBrand) {
129
130
  }
130
131
  }
131
132
  const linkDomains = readDomainList(auth.offDomainLinkDomains);
132
- if (linkDomains.length > 0) {
133
+ if (linkDomains.length > 0 && !trusted) {
133
134
  clauses.push(`Its links go to ${joinDomains(linkDomains.slice(0, 3))}.`);
134
135
  }
135
136
  return clauses;
@@ -164,7 +165,7 @@ export function buildAuthenticityIntel(thread) {
164
165
  }
165
166
  if (!auth.dkimMismatch) {
166
167
  const claimed = claimedBrandOf(thread);
167
- const unlike = describeSenderMismatch(auth, claimed);
168
+ const unlike = describeSenderMismatch(auth, claimed, thread.senderTrust);
168
169
  if (unlike.length > 0) {
169
170
  return {
170
171
  verdict: "caution",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/web-client",
3
- "version": "0.0.340",
3
+ "version": "0.0.341",
4
4
  "type": "module",
5
5
  "description": "Remit web client, published as composable primitives — the app shell, auth shells, and runtime config. A distributor imports what it composes and bundles it.",
6
6
  "exports": {