@ampless/backend 1.0.0-alpha.34 → 1.0.0-alpha.35

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.
@@ -9,6 +9,7 @@ import {
9
9
  } from "@aws-sdk/lib-dynamodb";
10
10
  import {
11
11
  formatPublicAssetUrl,
12
+ isValidPluginKey,
12
13
  validatePublicAssetKey
13
14
  } from "ampless";
14
15
 
@@ -57,7 +58,16 @@ function safeParse(s) {
57
58
  function createProcessorTrustedHandler(opts) {
58
59
  const trustedPlugins = (opts.plugins ?? []).filter(
59
60
  (p) => typeof p === "object" && p.trust_level === "trusted"
60
- );
61
+ ).filter((p) => {
62
+ const ns = p.instanceId ?? p.name;
63
+ if (!isValidPluginKey(ns)) {
64
+ console.warn(
65
+ `[trusted-processor] plugin "${p.name}" (instanceId="${p.instanceId ?? "(none)"}") has invalid namespace "${ns}". Must match /^[a-zA-Z0-9_-]+$/. Plugin skipped \u2014 no hooks will run for it.`
66
+ );
67
+ return false;
68
+ }
69
+ return true;
70
+ });
61
71
  const seenNamespaces = /* @__PURE__ */ new Set();
62
72
  for (const plugin of trustedPlugins) {
63
73
  const ns = plugin.instanceId ?? plugin.name;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampless/backend",
3
- "version": "1.0.0-alpha.34",
3
+ "version": "1.0.0-alpha.35",
4
4
  "description": "Amplify Gen 2 backend factories for ampless: auth, data, storage, event processors, API key renewer",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -65,8 +65,8 @@
65
65
  "@smithy/protocol-http": "^5.4.4",
66
66
  "@smithy/signature-v4": "^5.4.4",
67
67
  "fflate": "^0.8.3",
68
- "ampless": "1.0.0-alpha.19",
69
- "@ampless/mcp-server": "1.0.0-alpha.23"
68
+ "ampless": "1.0.0-alpha.20",
69
+ "@ampless/mcp-server": "1.0.0-alpha.24"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "@aws-amplify/backend": "^1",