@procedures/lib 0.58.1 → 0.59.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # @procedures/lib
2
2
 
3
+ ## 0.59.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 8f8e5b2: **Breaking change:** each listener examines the `Host` header. By default, only `localhost`, `127.0.0.1`, `[::1]` and IP addresses pass. Give each other name with `--allowed-host` or `allowedHosts`.
8
+
9
+ The browser checks examine the `Host` header on each listener. Before, they examined it only on a loopback address. A server on a LAN address (`0.0.0.0`) accepted each host name.
10
+
11
+ A request must name one of these hosts in its `Host` header:
12
+
13
+ - A loopback name: `localhost`, `127.0.0.1` or `[::1]`.
14
+ - An IP address, for example `192.168.1.20` or `[fe80::1]`.
15
+ - A name of `browser.allowedHosts` of the host policy, with any letter case.
16
+
17
+ A request with another name gets `FORBIDDEN` (403) with the reason `host-header-not-allowed`. A request without a `Host` header gets it too. The message of the refusal names `allowedHosts` and `--allowed-host`. `browser.allowedHosts: "*"` turns the check off.
18
+
19
+ The server command and `mark --server` get the option `--allowed-host <names>`. Repeat the option, or separate the names with commas. `@procedures/server` exports `parseAllowedHosts`.
20
+
21
+ Migration steps:
22
+
23
+ - A server that a LAN, a proxy or a container network reaches by a name: give the name in `browser.allowedHosts` of `hostPolicy()`. Or start the server with `--allowed-host <name>`.
24
+ - An MCP face on HTTP that clients reach by a name: give the name in `http.allowedHosts` of the face, or in `browser.allowedHosts` of the policy.
25
+ - A server that clients reach by `localhost` or by an IP address: no change.
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [8f8e5b2]
30
+ - @procedures/client@0.59.0
31
+ - @procedures/dag@0.59.0
32
+ - @procedures/fs@0.59.0
33
+ - @procedures/git@0.59.0
34
+ - @procedures/pnpm@0.59.0
35
+ - @procedures/shell@0.59.0
36
+
37
+ ## 0.58.2
38
+
39
+ ### Patch Changes
40
+
41
+ - Updated dependencies [217871c]
42
+ - @procedures/client@0.58.2
43
+ - @procedures/dag@0.58.2
44
+ - @procedures/fs@0.58.2
45
+ - @procedures/git@0.58.2
46
+ - @procedures/pnpm@0.58.2
47
+ - @procedures/shell@0.58.2
48
+
3
49
  ## 0.58.1
4
50
 
5
51
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"cli-flags.d.ts","sourceRoot":"","sources":["../src/cli-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,aAAa;IAC5B,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oCAAoC;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,uCAAuC;IACvC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,qFAAqF;IACrF,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,oDAAoD;IACpD,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,iGAAiG;IACjG,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,oBAAoB;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,gBAAgB,EAAE,SAAS,aAAa,EA0CpD,CAAC;AAEF,0DAA0D;AAC1D,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAEtF"}
1
+ {"version":3,"file":"cli-flags.d.ts","sourceRoot":"","sources":["../src/cli-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,aAAa;IAC5B,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oCAAoC;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,uCAAuC;IACvC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,qFAAqF;IACrF,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,oDAAoD;IACpD,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,iGAAiG;IACjG,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,oBAAoB;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,gBAAgB,EAAE,SAAS,aAAa,EAiDpD,CAAC;AAEF,0DAA0D;AAC1D,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAEtF"}
package/dist/cli-flags.js CHANGED
@@ -24,6 +24,13 @@ export const CLI_GLOBAL_FLAGS = [
24
24
  { long: "server", takesValue: false, mode: true, description: "Start the CLI server" },
25
25
  { long: "port", takesValue: true, serverOption: true, description: "The port of the CLI server (with --server)" },
26
26
  { long: "host", takesValue: true, serverOption: true, description: "The host of the CLI server (with --server)" },
27
+ {
28
+ long: "allowed-host",
29
+ takesValue: true,
30
+ serverOption: true,
31
+ repeatable: true,
32
+ description: "A name that a request can give in its Host header, besides localhost and the IP addresses (with --server)",
33
+ },
27
34
  {
28
35
  long: "probe-port",
29
36
  takesValue: true,
@@ -1 +1 @@
1
- {"version":3,"file":"cli-flags.js","sourceRoot":"","sources":["../src/cli-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAmBH,MAAM,CAAC,MAAM,gBAAgB,GAA6B;IACxD,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE;IAC7E,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE;IACnF,EAAE,IAAI,EAAE,SAAS,EA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ClB,WAAW,EAAE,qFAAqF;KACnG;CACF,CAAC;AAEF,0DAA0D;AAC1D,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,KAAc;IACzD,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC;AAC7F,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@procedures/lib",
4
- "version": "0.58.1",
4
+ "version": "0.59.0",
5
5
  "description": "Workspace procedures for pnpm monorepos: scan the packages, graph their dependencies, scaffold a new package, audit packages against a template, and rename across the workspace.",
6
6
  "keywords": [
7
7
  "monorepo",
@@ -74,12 +74,12 @@
74
74
  "vitest": "^5.0.3"
75
75
  },
76
76
  "dependencies": {
77
- "@procedures/client": "0.58.1",
78
- "@procedures/dag": "0.58.1",
79
- "@procedures/fs": "0.58.1",
80
- "@procedures/git": "0.58.1",
81
- "@procedures/pnpm": "0.58.1",
82
- "@procedures/shell": "0.58.1",
77
+ "@procedures/client": "0.59.0",
78
+ "@procedures/dag": "0.59.0",
79
+ "@procedures/fs": "0.59.0",
80
+ "@procedures/git": "0.59.0",
81
+ "@procedures/pnpm": "0.59.0",
82
+ "@procedures/shell": "0.59.0",
83
83
  "ts-morph": "^24.0.0",
84
84
  "zod": "^4.6.5"
85
85
  },
package/src/cli-flags.ts CHANGED
@@ -42,6 +42,13 @@ export const CLI_GLOBAL_FLAGS: readonly CliGlobalFlag[] = [
42
42
  { long: "server", takesValue: false, mode: true, description: "Start the CLI server" },
43
43
  { long: "port", takesValue: true, serverOption: true, description: "The port of the CLI server (with --server)" },
44
44
  { long: "host", takesValue: true, serverOption: true, description: "The host of the CLI server (with --server)" },
45
+ {
46
+ long: "allowed-host",
47
+ takesValue: true,
48
+ serverOption: true,
49
+ repeatable: true,
50
+ description: "A name that a request can give in its Host header, besides localhost and the IP addresses (with --server)",
51
+ },
45
52
  {
46
53
  long: "probe-port",
47
54
  takesValue: true,