@cosmicdrift/kumiko-bundled-features 0.348.0 → 0.348.1

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,4 +1,6 @@
1
+ import { PII_ERASED_SENTINEL } from "@cosmicdrift/kumiko-framework/crypto";
1
2
  import { DELIVERY_UNSUBSCRIBE_ONE_CLICK_HEADER_VALUE, DELIVERY_UNSUBSCRIBE_PATH, } from "../delivery/index.js";
3
+ import { decryptStoredPii } from "../shared/index.js";
2
4
  import { guardEmailMessage } from "./pii-guard.js";
3
5
  // Envelope (From / Reply-To / threading headers) rides on the channel data —
4
6
  // the notification's email template echoes it out of the notify() call, since
@@ -87,8 +89,13 @@ export function createEmailChannel(options) {
87
89
  return {
88
90
  name: "email",
89
91
  mode: "queued",
92
+ // resolveEmail typically returns the raw stored user.email, which is ciphertext under an active KMS.
90
93
  async resolve(userId, ctx) {
91
- return resolveEmail(userId, ctx);
94
+ const stored = await resolveEmail(userId, ctx);
95
+ if (stored === null)
96
+ return null;
97
+ const address = await decryptStoredPii(stored, "email", "channel-email:resolve");
98
+ return address === PII_ERASED_SENTINEL ? null : address;
92
99
  },
93
100
  render(message, _ctx) {
94
101
  return renderMessage(message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-bundled-features",
3
- "version": "0.348.0",
3
+ "version": "0.348.1",
4
4
  "description": "Built-in features — tenant, user, auth, delivery. The stuff you'd rewrite anyway, already typed.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -503,12 +503,12 @@
503
503
  }
504
504
  },
505
505
  "dependencies": {
506
- "@cosmicdrift/kumiko-dispatcher-live": "0.348.0",
507
- "@cosmicdrift/kumiko-framework": "0.348.0",
508
- "@cosmicdrift/kumiko-headless": "0.348.0",
509
- "@cosmicdrift/kumiko-renderer": "0.348.0",
510
- "@cosmicdrift/kumiko-renderer-web": "0.348.0",
511
- "@cosmicdrift/kumiko-types": "0.348.0",
506
+ "@cosmicdrift/kumiko-dispatcher-live": "0.348.1",
507
+ "@cosmicdrift/kumiko-framework": "0.348.1",
508
+ "@cosmicdrift/kumiko-headless": "0.348.1",
509
+ "@cosmicdrift/kumiko-renderer": "0.348.1",
510
+ "@cosmicdrift/kumiko-renderer-web": "0.348.1",
511
+ "@cosmicdrift/kumiko-types": "0.348.1",
512
512
  "@mollie/api-client": "^4.5.0",
513
513
  "@node-rs/argon2": "^2.0.2",
514
514
  "@types/mailparser": "^3.4.6",
@@ -1025,8 +1025,8 @@
1025
1025
  ],
1026
1026
  "devDependencies": {
1027
1027
  "@testing-library/user-event": "^14.6.1",
1028
- "@cosmicdrift/kumiko-locale-de": "0.348.0",
1029
- "@cosmicdrift/kumiko-locale-es": "0.348.0",
1028
+ "@cosmicdrift/kumiko-locale-de": "0.348.1",
1029
+ "@cosmicdrift/kumiko-locale-es": "0.348.1",
1030
1030
  "jsqr": "^1.4.0"
1031
1031
  }
1032
1032
  }
@@ -1,4 +1,11 @@
1
1
  [
2
+ {
3
+ "version": "0.348.1",
4
+ "type": "fix",
5
+ "title": "Email channel decrypts the resolved recipient address so notify to users and tenants works with an active KMS",
6
+ "detail": "Email notifications to resolved users reach the plaintext address under an active KMS\nWith an active PII KMS, an app's `resolveEmail` that reads the stored `user.email` returns ciphertext, and the PII guard rightly refused to send it (`recipient address is a PII ciphertext`). That broke every `notify` target that resolves an address from a user id: a single user, a list of users and `{ tenant }`. The email channel now decrypts the resolved address (`decryptStoredPii`, a no-op without KMS or for plaintext) before it is used for delivery, opt-out checks and the attempt log. The guard is unchanged.",
7
+ "migration": "No action needed. Apps whose resolveEmail returns the raw stored user.email now send to the plaintext address instead of failing with \"recipient address is a PII ciphertext\"."
8
+ },
2
9
  {
3
10
  "version": "0.342.0",
4
11
  "type": "improvement",