@authhero/proxy 0.10.15 → 0.11.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.
@@ -13,8 +13,15 @@ export interface ResolvedHost {
13
13
  * its management API. `resolveHost` is the cross-tenant lookup the proxy data
14
14
  * plane needs on every incoming request — it maps a request `Host` header to
15
15
  * the owning tenant, custom domain, and route set.
16
+ *
17
+ * `options.signal` aborts when the caller's deadline fires. Implementations
18
+ * backed by cancellable I/O (fetch) should pass it through so the work stops;
19
+ * others may ignore it, and the caller's timeout still races them.
16
20
  */
17
21
  export interface ProxyDataAdapter {
18
22
  proxyRoutes: ProxyRoutesAdapter;
19
- resolveHost(host: string): Promise<ResolvedHost | null>;
23
+ resolveHost(host: string, options?: ResolveHostOptions): Promise<ResolvedHost | null>;
24
+ }
25
+ export interface ResolveHostOptions {
26
+ signal?: AbortSignal;
20
27
  }
@@ -1,6 +1,6 @@
1
- import { ProxyDataAdapter, ResolvedHost } from "../adapter";
1
+ import { ProxyDataAdapter, ResolvedHost, ResolveHostOptions } from "../adapter";
2
2
  export interface HostResolverCache {
3
- resolveHost(host: string): Promise<ResolvedHost | null>;
3
+ resolveHost(host: string, options?: ResolveHostOptions): Promise<ResolvedHost | null>;
4
4
  }
5
5
  export interface HostCacheOptions {
6
6
  freshTtlMs: number;
@@ -4,4 +4,6 @@ export declare class TimeoutError extends Error {
4
4
  }
5
5
  export declare function isTimeoutLike(err: unknown): boolean;
6
6
  export declare function withAbortTimeout<T>(ms: number, op: (signal: AbortSignal) => Promise<T>): Promise<T>;
7
+ export declare function anySignal(signals: Array<AbortSignal | undefined>): AbortSignal | undefined;
8
+ export declare function withDeadline<T>(ms: number, label: string, parent: AbortSignal | undefined, op: (signal: AbortSignal) => Promise<T>): Promise<T>;
7
9
  export declare function withRaceTimeout<T>(p: Promise<T>, ms: number, label?: string): Promise<T>;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/markusahlstrand/authhero"
13
13
  },
14
- "version": "0.10.15",
14
+ "version": "0.11.0",
15
15
  "files": [
16
16
  "dist"
17
17
  ],