@dbx-tools/tunnel 0.9.154 → 0.9.157

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/src/gate.ts CHANGED
@@ -24,9 +24,9 @@
24
24
  */
25
25
 
26
26
  import type { IncomingMessage, ServerResponse } from "node:http";
27
- import { injectRequestTags } from "@dbx-tools/appkit/request-tags";
28
- import { AUTH_BASE_PATH, auth as sharedAuth } from "@dbx-tools/shared-auth";
29
- import { log, token } from "@dbx-tools/shared-core";
27
+ import { injectRequestTags } from "@dbx-tools/appkit";
28
+ import { AUTH_BASE_PATH, isAuthPath } from "@dbx-tools/shared-auth";
29
+ import { log, USER_ID_HEADER, USER_EMAIL_HEADER } from "@dbx-tools/shared-core";
30
30
  import { getRequest, setResponse } from "better-call/node";
31
31
  import type { RequestHandler } from "express";
32
32
  import { toHeaderPolicy, type HeaderPolicy } from "./headers.ts";
@@ -36,9 +36,6 @@ import { requestTunnelTraceTags } from "./request-context.ts";
36
36
 
37
37
  const logger = log.logger("tunnel:gate");
38
38
 
39
- /** Segment-aware auth-route predicate owned by `@dbx-tools/shared-auth`. */
40
- export const isAuthPath = sharedAuth.isAuthPath;
41
-
42
39
  /** Options for {@link mountGate}. */
43
40
  export interface GateOptions {
44
41
  /** The in-process gate API (session/request/verify/status). */
@@ -127,8 +124,8 @@ function stripSessionCookie(req: IncomingMessage): void {
127
124
  * app service principal instead of throwing.
128
125
  */
129
126
  function injectIdentity(req: IncomingMessage, email: string): void {
130
- req.headers[token.USER_ID_HEADER] = email;
131
- req.headers[token.USER_EMAIL_HEADER] = email;
127
+ req.headers[USER_ID_HEADER] = email;
128
+ req.headers[USER_EMAIL_HEADER] = email;
132
129
  }
133
130
 
134
131
  /** Convert Node request headers to web-platform headers with caller IP context. */