@pikku/core 0.12.114 → 0.12.115

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,3 +1,15 @@
1
+ ## 0.12.115
2
+
3
+ ### Patch Changes
4
+
5
+ - 238902c: A channel's `auth` flag now reaches its meta. The inspector already read it to mark the connect and disconnect functions sessionless, then dropped it, so nothing downstream could tell a public channel from a private one without reading the generated source.
6
+
7
+ That matters in front of the channel rather than inside it. A `wireCLI({ auth: false })` program is reachable by anyone holding its address; a router or deploy that cannot see the flag either guesses or demands a token in front of a surface it was never protecting, locking out the clients the program was opened for.
8
+
9
+ The flag is only recorded when the channel actually said. A channel that never mentioned `auth` leaves it absent rather than claiming a default it did not declare, which the runtime continues to read as requiring a session.
10
+
11
+ - 2fd2b22: Telemetry middleware now records `errorStack` alongside `errorMessage`, so an observability backend has the stack of a failed invocation and not only its message.
12
+
1
13
  ## 0.12.114
2
14
 
3
15
  ### Patch Changes
@@ -8,12 +8,14 @@ export const telemetryOuter = pikkuMiddlewareFactory(({ environmentId, orgId } =
8
8
  const start = performance.now();
9
9
  let outcome = 'ok';
10
10
  let errorMessage;
11
+ let errorStack;
11
12
  try {
12
13
  await next();
13
14
  }
14
15
  catch (e) {
15
16
  outcome = 'error';
16
17
  errorMessage = e instanceof Error ? e.message : String(e);
18
+ errorStack = e instanceof Error ? e.stack : undefined;
17
19
  throw e;
18
20
  }
19
21
  finally {
@@ -26,6 +28,7 @@ export const telemetryOuter = pikkuMiddlewareFactory(({ environmentId, orgId } =
26
28
  totalDuration: Math.round(performance.now() - start),
27
29
  outcome,
28
30
  ...(errorMessage ? { errorMessage } : {}),
31
+ ...(errorStack ? { errorStack } : {}),
29
32
  ...(wire.http
30
33
  ? {
31
34
  httpStatus: wire.http.response?.statusCode,
@@ -49,12 +52,14 @@ export const telemetryInner = pikkuMiddlewareFactory(({ environmentId, orgId } =
49
52
  const start = performance.now();
50
53
  let outcome = 'ok';
51
54
  let errorMessage;
55
+ let errorStack;
52
56
  try {
53
57
  await next();
54
58
  }
55
59
  catch (e) {
56
60
  outcome = 'error';
57
61
  errorMessage = e instanceof Error ? e.message : String(e);
62
+ errorStack = e instanceof Error ? e.stack : undefined;
58
63
  throw e;
59
64
  }
60
65
  finally {
@@ -68,6 +73,7 @@ export const telemetryInner = pikkuMiddlewareFactory(({ environmentId, orgId } =
68
73
  outcome,
69
74
  pikkuUserId: wire.pikkuUserId,
70
75
  ...(errorMessage ? { errorMessage } : {}),
76
+ ...(errorStack ? { errorStack } : {}),
71
77
  ...(environmentId ? { environmentId } : {}),
72
78
  ...(orgId ? { orgId } : {}),
73
79
  });
@@ -37,6 +37,17 @@ export interface ChannelMeta {
37
37
  message: ChannelMessageMeta | null;
38
38
  messageWirings: Record<string, Record<string, ChannelMessageMeta>>;
39
39
  binary?: boolean | null;
40
+ /**
41
+ * Whether a connection must carry a session. Absent means the channel did not
42
+ * say, which the runtime treats as requiring one.
43
+ *
44
+ * Recorded so that something deploying or routing in front of this channel can
45
+ * tell a public surface from a private one without reading the generated
46
+ * source: a `wireCLI({ auth: false })` program is reachable by anyone holding
47
+ * the address, and a proxy that does not know that will either guess or gate
48
+ * traffic it was never protecting.
49
+ */
50
+ auth?: boolean;
40
51
  /** Set when the channel was wired by a gateway rather than declared directly. */
41
52
  gateway?: boolean;
42
53
  summary?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/core",
3
- "version": "0.12.114",
3
+ "version": "0.12.115",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/pikkujs/pikku.git",