@securitydept/token-set-context-client-angular 0.2.0 → 0.3.0-beta.10

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.
@@ -1,913 +1,132 @@
1
- import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent } from '@angular/common/http';
2
- import * as i0 from '@angular/core';
3
- import { WritableSignal, InjectionToken, Provider, EnvironmentProviders, OnInit } from '@angular/core';
1
+ import * as _angular_core from '@angular/core';
2
+ import { EnvironmentProviders, InjectionToken, Provider, Signal } from '@angular/core';
3
+ import * as _securitydept_client from '@securitydept/client';
4
+ import { RouteBehaviourContextExtra, RequirementsComposition, ResourceSnapshot } from '@securitydept/client';
5
+ import { BaseOidcModeClient, OidcModeCallbackHandlingResult, TokenSetAuthSnapshot } from '@securitydept/token-set-context-client/orchestration';
6
+ import { TokenSetClientRegistryRequirementBehaviourOptions, TokenSetClientRegistryAuthRequirement, TokenSetClientRegistry, ProvideTokenSetClientRegistryOptions, TokenSetCallbackClientQuery, TokenSetCallbackClientGuard, TokenSetBackendCallbackClient, TokenSetCallbackClientSelectionSnapshot, TokenSetFrontendCallbackClient } from '@securitydept/token-set-context-client/registry';
7
+ export { ProvideTokenSetClientRegistryOptions } from '@securitydept/token-set-context-client/registry';
8
+ import { CanActivateFn, CanActivateChildFn, Route } from '@angular/router';
9
+ import { CreateAngularGuardOptions, SecureRouteConfig } from '@securitydept/client-angular';
10
+ import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent, HttpInterceptorFn } from '@angular/common/http';
4
11
  import { Observable } from 'rxjs';
5
- import { EventStreamTrait } from '@securitydept/client';
6
- import { ClientReadinessState } from '@securitydept/token-set-context-client/frontend-oidc-mode';
7
- import { TokenSetResumeReconciliationOptions, AuthSnapshot, TokenSetAuthEvent, EnsureFreshAuthStateOptions, EnsureAuthForResourceOptions, EnsureAuthForResourceResult, EnsureAuthorizationHeaderOptions } from '@securitydept/token-set-context-client/orchestration';
8
- import { OidcModeClient, OidcCallbackClient, TokenSetClientEntry as TokenSetClientEntry$1, ClientInitializationPriority, TokenSetAuthRegistry as TokenSetAuthRegistry$1, ClientMeta, ClientKeySelector, ClientFilter, ClientQueryOptions, EnsureRegistryAuthForResourceOptions } from '@securitydept/token-set-context-client/registry';
9
- export { ClientFilter, ClientInitializationPriority, ClientKeySelector, ClientMeta, ClientQueryOptions, EnsureRegistryAuthForResourceOptions, OidcCallbackClient, OidcModeClient } from '@securitydept/token-set-context-client/registry';
10
- import { ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, CanActivateFn, Route } from '@angular/router';
11
- import { AuthRequirement, PlannerHost, RequirementsClientSetComposition } from '@securitydept/client/auth-coordination';
12
+ import { FrontendOidcModeCallbackResult } from '@securitydept/token-set-context-client/frontend-oidc-mode';
12
13
 
13
- type TokenSetAngularClient = OidcModeClient & OidcCallbackClient;
14
+ /** Options for {@link provideTokenSetRequirementPlannerHost}. */
15
+ type ProvideTokenSetRequirementPlannerHostOptions = TokenSetClientRegistryRequirementBehaviourOptions<BaseOidcModeClient, RouteBehaviourContextExtra>;
14
16
  /**
15
- * A registration entry for a single token-set auth client.
17
+ * Provide registry-backed requirement behaviour for Angular guards.
16
18
  *
17
- * Each client is identified by a unique string key (e.g. "main", "admin",
18
- * the provider ID, or the requirement kind), so that routes, interceptors,
19
- * and callbacks can discriminate between multiple concurrent auth sources.
20
- *
21
- * ## Sync vs Async client factory
22
- *
23
- * `clientFactory` supports both synchronous and asynchronous materialization:
24
- *
25
- * - **Sync** (`() => OidcModeClient`): The client config is available at
26
- * registration time. Classic inline config or pre-resolved projections.
27
- *
28
- * - **Async** (`() => Promise<OidcModeClient>`): The client config must be
29
- * resolved asynchronously (e.g. fetched from a backend config projection
30
- * endpoint). The registry tracks readiness state and provides `whenReady()`
31
- * for guards/interceptors that need to wait.
32
- *
33
- * When `clientFactory` returns a Promise, the registry enters
34
- * `ClientReadinessState.Initializing` for this key and transitions to
35
- * `Ready` or `Failed` when the promise settles.
36
- *
37
- * Two additional discrimination axes are supported:
38
- * - `requirementKind`: maps a RequirementKind (or custom string) → this client.
39
- * Guards and resolvers can look up the client for a pending requirement without
40
- * knowing the concrete key.
41
- * - `providerFamily`: maps a named provider family (e.g. "google", "internal-sso")
42
- * → this client. Useful when multiple clients share the same kind but differ
43
- * by provider / audience.
19
+ * This is intentionally a thin adapter over the framework-neutral registry
20
+ * auth-coordination layer. Route requirements must carry
21
+ * `attributes.query: TokenSetClientQueryOptions`.
44
22
  */
45
- interface TokenSetClientEntry extends Omit<TokenSetClientEntry$1<TokenSetAngularClient>, "clientFactory"> {
46
- /**
47
- * Factory that creates the OIDC mode client.
48
- *
49
- * May return the client synchronously (inline config) or a Promise
50
- * (async config projection resolution). When a Promise is returned,
51
- * the registry tracks initialization readiness automatically.
52
- */
53
- clientFactory: () => TokenSetAngularClient | Promise<TokenSetAngularClient>;
54
- /**
55
- * When true (default), adapter-managed browser clients install the token-set
56
- * page-resume reconciler during materialization.
57
- *
58
- * Disable only when the host intentionally owns browser lifecycle wiring for
59
- * this client and can prove an equivalent resume trigger path.
60
- *
61
- * @default true
62
- */
63
- resumeReconciliation?: boolean;
64
- /**
65
- * Browser lifecycle options forwarded to the default token-set resume
66
- * reconciler when `resumeReconciliation !== false`.
67
- */
68
- resumeReconciliationOptions?: TokenSetResumeReconciliationOptions;
69
- /**
70
- * Initialization priority. Defaults to `"primary"` (eager). Set to
71
- * `"lazy"` to defer clientFactory execution until the registry is asked
72
- * for this key via `whenReady(key)` / `preload(key)` / `idleWarmup()`.
73
- */
74
- priority?: ClientInitializationPriority;
75
- }
23
+ declare function provideTokenSetRequirementPlannerHost(options?: ProvideTokenSetRequirementPlannerHostOptions): EnvironmentProviders;
76
24
 
77
- /**
78
- * Per-client Angular service that bridges a single OIDC mode client to
79
- * Angular signals + RxJS.
80
- *
81
- * Iteration 110 change: lifecycle teardown is now explicit. Construct with
82
- * `new TokenSetAuthService(client, autoRestore)` and call `.dispose()` when
83
- * the service owner tears down. The shared registry core handles this
84
- * automatically — adopters that wire the service directly (rare) must call
85
- * `dispose()` themselves, typically bound to a `DestroyRef.onDestroy`.
86
- */
87
- declare class TokenSetAuthService {
88
- /** The underlying SDK client instance. */
89
- readonly client: TokenSetAngularClient;
90
- /** Current auth snapshot as an Angular signal. */
91
- readonly authState: WritableSignal<AuthSnapshot | null>;
92
- /** Current auth snapshot as an RxJS Observable. */
93
- readonly authState$: Observable<AuthSnapshot | null>;
94
- /** Promise that resolves when initial state restore completes (or null if skipped). */
95
- readonly restorePromise: Promise<AuthSnapshot | null> | null;
96
- readonly authEvents: EventStreamTrait<TokenSetAuthEvent>;
97
- private readonly cleanup;
98
- private disposed;
99
- constructor(
100
- /** The underlying SDK client instance. */
101
- client: TokenSetAngularClient, autoRestore: boolean);
102
- /** Whether the user is currently authenticated. */
103
- isAuthenticated(): boolean;
104
- /** Current access token, or null. */
105
- accessToken(): string | null;
106
- ensureFreshAuthState(options?: EnsureFreshAuthStateOptions): Promise<AuthSnapshot | null>;
107
- ensureAuthForResource(options?: EnsureAuthForResourceOptions): Promise<EnsureAuthForResourceResult>;
108
- ensureAccessToken(options?: EnsureFreshAuthStateOptions): Promise<string | null>;
109
- ensureAuthorizationHeader(options?: EnsureAuthorizationHeaderOptions): Promise<string | null>;
110
- /**
111
- * Release all resources owned by this service.
112
- *
113
- * - Unsubscribes the SDK state bridge
114
- * - Calls `client.dispose()`
115
- *
116
- * Idempotent: subsequent calls are no-ops. Called by the shared registry
117
- * at teardown; adopters invoking TokenSetAuthService directly must call
118
- * this themselves (typically bound to `DestroyRef.onDestroy`).
119
- */
120
- dispose(): void;
25
+ /** Serializable token-set security declaration for a child route. */
26
+ interface TokenSetSecureRouteSecurityOptions {
27
+ /** Requirements declared at this route segment. */
28
+ requirements?: readonly TokenSetClientRegistryAuthRequirement[];
29
+ /** Composition strategy against ancestor requirements (default `merge`). */
30
+ composition?: RequirementsComposition;
121
31
  }
122
-
123
- type AngularClient = TokenSetAngularClient;
124
- declare class TokenSetAuthRegistry {
125
- /**
126
- * Shared framework-neutral registry core. Angular consumers rarely need
127
- * direct access, but this is exposed so adapter-internal helpers
128
- * (`CallbackResumeService`, `bearer-interceptor`) can query the core
129
- * directly when they don't need Angular-specific behaviour.
130
- */
131
- readonly core: TokenSetAuthRegistry$1<AngularClient, TokenSetAuthService>;
132
- readonly authEvents: EventStreamTrait<TokenSetAuthEvent>;
133
- constructor();
134
- /**
135
- * Register a client entry. Supports sync / async / lazy priority.
136
- *
137
- * Iteration 110 change: the second `destroyRef` argument is no longer
138
- * required — the registry pulls its own `DestroyRef` via injection and
139
- * binds teardown once per Angular scope.
140
- */
141
- register(entry: TokenSetClientEntry & {
142
- priority?: "primary" | "lazy";
143
- clientFactory: () => AngularClient;
144
- }): TokenSetAuthService;
145
- register(entry: TokenSetClientEntry & {
146
- priority?: "primary" | "lazy";
147
- clientFactory: () => Promise<AngularClient>;
148
- }): Promise<TokenSetAuthService>;
149
- register(entry: TokenSetClientEntry): TokenSetAuthService | Promise<TokenSetAuthService> | undefined;
150
- /**
151
- * Manually dispose the registry. Normally bound to the ambient
152
- * `DestroyRef` at construction; call this explicitly when instantiating
153
- * the registry outside of an Angular injection context (e.g. in unit
154
- * tests).
155
- */
156
- dispose(): void;
157
- isReady(key: string): boolean;
158
- readinessState(key: string): ClientReadinessState;
159
- whenReady(key: string): Promise<TokenSetAuthService>;
160
- /**
161
- * Preload a lazy client without throwing on rejection. Callers are
162
- * expected to attach `.catch` handlers for fire-and-forget usage.
163
- */
164
- preload(key: string): Promise<TokenSetAuthService>;
165
- /**
166
- * Schedule preload for every lazy+not-initialized client using
167
- * `requestIdleCallback` / `setTimeout` fallback.
168
- */
169
- idleWarmup(): () => void;
170
- reset(key: string): void;
171
- metaFor(clientKey: string): ClientMeta | undefined;
172
- get(key: string): TokenSetAuthService | undefined;
173
- require(key: string): TokenSetAuthService;
174
- keys(): string[];
175
- entries(): Array<[string, TokenSetAuthService]>;
176
- clientKeyGenForUrl(url: string): Generator<string, void, unknown>;
177
- clientKeyGenForCallback(url: string): Generator<string, void, unknown>;
178
- clientKeyGenForRequirement(requirementKind: string): Generator<string, void, unknown>;
179
- clientKeyGenForProviderFamily(providerFamily: string): Generator<string, void, unknown>;
180
- clientKeyListForUrl(url: string): string[];
181
- clientKeyListForCallback(url: string): string[];
182
- clientKeyListForRequirement(requirementKind: string): string[];
183
- clientKeyListForProviderFamily(providerFamily: string): string[];
184
- clientKeyForUrl(url: string, selector?: ClientKeySelector): string | undefined;
185
- clientKeyForCallback(url: string, selector?: ClientKeySelector): string | undefined;
186
- clientKeyForRequirement(requirementKind: string, selector?: ClientKeySelector): string | undefined;
187
- clientKeyForProviderFamily(providerFamily: string, selector?: ClientKeySelector): string | undefined;
188
- requireForRequirement(requirementKind: string, selector?: ClientKeySelector): TokenSetAuthService;
189
- requireForProviderFamily(providerFamily: string, selector?: ClientKeySelector): TokenSetAuthService;
190
- clientKeyGenForFilter(filter: ClientFilter): Generator<string, void, unknown>;
191
- clientKeyGenForOptions(options: ClientQueryOptions): Generator<string, void, unknown>;
192
- clientKeysForOptions(options: ClientQueryOptions): string[];
193
- accessToken(key?: string): string | null;
194
- ensureAccessToken(key?: string): Promise<string | null>;
195
- ensureAuthorizationHeader(key?: string): Promise<string | null>;
196
- ensureAuthForResource(options?: EnsureRegistryAuthForResourceOptions): Promise<EnsureAuthForResourceResult | null>;
197
- static ɵfac: i0.ɵɵFactoryDeclaration<TokenSetAuthRegistry, never>;
198
- static ɵprov: i0.ɵɵInjectableDeclaration<TokenSetAuthRegistry>;
199
- }
200
-
201
- /**
202
- * Adopter-tunable behaviour for the token-set bearer interceptor.
203
- *
204
- * Iteration 150 (review 1) lifted `strictUrlMatch` out of the implicit
205
- * single-client convenience path into an explicit option, so multi-backend
206
- * adopters can guarantee that bearer tokens never leak outside the URL
207
- * patterns they registered with `provideTokenSetAuth({ clients: [...] })`.
208
- */
209
- interface BearerInterceptorOptions {
210
- /**
211
- * When `true`, the interceptor injects a bearer header ONLY for requests
212
- * whose URL matches a registered client's `urlPatterns`. Requests with no
213
- * matching client receive no `Authorization` header even when a token is
214
- * available elsewhere in the registry.
215
- *
216
- * When `false` (default, single-client convenience), the interceptor
217
- * falls back to `registry.accessToken()` for unmatched URLs — useful only
218
- * when the host issues all HTTP traffic to one already-known backend.
219
- *
220
- * Adopters with more than one backend, more than one OIDC audience, or
221
- * any third-party HTTP traffic from the same Angular host MUST set this
222
- * to `true` to prevent cross-origin token leakage.
223
- *
224
- * @default false
225
- */
226
- strictUrlMatch?: boolean;
227
- }
228
- /**
229
- * DI token for {@link BearerInterceptorOptions}. Adopters normally configure
230
- * options via `provideTokenSetBearerInterceptor({ ... })`; the token is
231
- * exported for advanced cases where the options need to be supplied or
232
- * overridden separately (for example, in tests).
233
- */
234
- declare const TOKEN_SET_BEARER_INTERCEPTOR_OPTIONS: InjectionToken<BearerInterceptorOptions>;
235
- /**
236
- * Angular class-based bearer-token interceptor (`HTTP_INTERCEPTORS` style).
237
- *
238
- * Selects the correct access token from the multi-client registry by URL
239
- * pattern. Behaviour for unmatched URLs is governed by
240
- * {@link BearerInterceptorOptions.strictUrlMatch}.
241
- *
242
- * Prefer the functional version via `createTokenSetBearerInterceptor()` +
243
- * `withInterceptors()` when using `provideHttpClient`. Use this class-based
244
- * version when you need classic `HTTP_INTERCEPTORS` multi-provider style
245
- * (e.g. NgModule apps).
246
- *
247
- * @example
248
- * ```ts
249
- * // NgModule providers:
250
- * provideTokenSetBearerInterceptor({ strictUrlMatch: true })
251
- * ```
252
- */
253
- declare class TokenSetBearerInterceptor implements HttpInterceptor {
254
- private readonly registry;
255
- private readonly options;
256
- intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
257
- static ɵfac: i0.ɵɵFactoryDeclaration<TokenSetBearerInterceptor, never>;
258
- static ɵprov: i0.ɵɵInjectableDeclaration<TokenSetBearerInterceptor>;
32
+ /** Root-level token-set security: metadata plus registry behaviour hooks. */
33
+ interface TokenSetSecureRouteRootSecurityOptions extends TokenSetSecureRouteSecurityOptions, ProvideTokenSetRequirementPlannerHostOptions {
259
34
  }
35
+ /** Guard factory options specialized to token-set registry requirements. */
36
+ type TokenSetAngularGuardOptions = CreateAngularGuardOptions<TokenSetClientRegistryAuthRequirement>;
260
37
  /**
261
- * Create an `HTTP_INTERCEPTORS` multi-provider entry for bearer token injection.
262
- *
263
- * Returns a single `Provider` object that registers {@link TokenSetBearerInterceptor}
264
- * as a class-based HTTP interceptor. Suitable for NgModule `providers` arrays.
265
- *
266
- * For functional-interceptor style (standalone apps using `provideHttpClient`),
267
- * use `createTokenSetBearerInterceptor()` with `withInterceptors()` instead.
268
- *
269
- * @example
270
- * ```ts
271
- * @NgModule({
272
- * providers: [
273
- * provideTokenSetAuth({ clients: [...] }),
274
- * provideTokenSetBearerInterceptor(), // <— replaces hand-written AuthInterceptor
275
- * provideHttpClient(withInterceptorsFromDi()),
276
- * ],
277
- * })
278
- * export class AppModule {}
279
- * ```
38
+ * Create a token-set `CanActivateFn`. The behaviour host is resolved from DI
39
+ * (provided by {@link provideTokenSetRequirementPlannerHost}).
280
40
  */
41
+ declare function createTokenSetCanActivate(options?: TokenSetAngularGuardOptions): CanActivateFn;
281
42
  /**
282
- * Create an `HTTP_INTERCEPTORS` multi-provider entry for bearer token injection.
283
- *
284
- * Returns Angular providers that register {@link TokenSetBearerInterceptor}
285
- * as a class-based HTTP interceptor and (optionally) the
286
- * {@link BearerInterceptorOptions} that govern its URL-match behaviour.
287
- * Suitable for NgModule `providers` arrays.
288
- *
289
- * For functional-interceptor style (standalone apps using `provideHttpClient`),
290
- * use `createTokenSetBearerInterceptor()` with `withInterceptors()` instead.
291
- *
292
- * @example
293
- * ```ts
294
- * @NgModule({
295
- * providers: [
296
- * provideTokenSetAuth({ clients: [...] }),
297
- * // Adopters with multiple backends or any third-party HTTP traffic
298
- * // MUST opt into strictUrlMatch to prevent token leakage.
299
- * provideTokenSetBearerInterceptor({ strictUrlMatch: true }),
300
- * provideHttpClient(withInterceptorsFromDi()),
301
- * ],
302
- * })
303
- * export class AppModule {}
304
- * ```
43
+ * Create a token-set `CanActivateChildFn`. The behaviour host is resolved from
44
+ * DI (provided by {@link provideTokenSetRequirementPlannerHost}).
305
45
  */
306
- declare function provideTokenSetBearerInterceptor(options?: BearerInterceptorOptions): Provider[];
46
+ declare function createTokenSetCanActivateChild(options?: TokenSetAngularGuardOptions): CanActivateChildFn;
307
47
  /**
308
- * Create an Angular `HttpInterceptorFn` that injects bearer authorization
309
- * headers, selecting the correct token from the multi-client registry
310
- * based on URL pattern matching.
311
- *
312
- * If no URL pattern matches, falls back to the first available token
313
- * (single-client convenience).
314
- *
315
- * ## Async client readiness
316
- *
317
- * The interceptor does **not** block or delay the HTTP request waiting for
318
- * an async client to materialize. If a client is still initializing when the
319
- * request fires, the request proceeds without an Authorization header.
320
- *
321
- * This is intentional: blocking HTTP for client initialization would deadlock
322
- * apps that make HTTP requests during initialization itself. Route guards
323
- * (which use `registry.whenReady()`) are the correct place to enforce
324
- * "client must be ready before user reaches this route".
325
- *
326
- * For NgModule-style apps using `HTTP_INTERCEPTORS`, use
327
- * `provideTokenSetBearerInterceptor()` instead.
328
- *
329
- * @example
330
- * ```ts
331
- * import { provideHttpClient, withInterceptors } from "@angular/common/http";
332
- * import { createTokenSetBearerInterceptor } from "@securitydept/token-set-context-client-angular";
333
- *
334
- * provideHttpClient(withInterceptors([
335
- * createTokenSetBearerInterceptor(registry),
336
- * ]));
337
- * ```
48
+ * Declare a secured child route. Writes token-set registry requirement
49
+ * metadata only; enforcement is owned by a guarded
50
+ * {@link secureTokenSetRouteRoot} ancestor.
338
51
  */
52
+ declare function secureTokenSetRoute(path: string, security?: TokenSetSecureRouteSecurityOptions, routeOptions?: SecureRouteConfig): Route;
339
53
  /**
340
- * Create an Angular `HttpInterceptorFn` that injects bearer authorization
341
- * headers, selecting the correct token from the multi-client registry
342
- * based on URL pattern matching.
343
- *
344
- * If no URL pattern matches, the unmatched-URL behaviour is governed by
345
- * {@link BearerInterceptorOptions.strictUrlMatch}: the default falls back
346
- * to `registry.accessToken()` (single-client convenience), while
347
- * `strictUrlMatch: true` returns no token, ensuring bearer headers are
348
- * never injected for URLs outside the registered patterns.
349
- *
350
- * ## Async client readiness
351
- *
352
- * The interceptor does **not** block or delay the HTTP request waiting for
353
- * an async client to materialize. If a client is still initializing when the
354
- * request fires, the request proceeds without an Authorization header.
355
- *
356
- * This is intentional: blocking HTTP for client initialization would deadlock
357
- * apps that make HTTP requests during initialization itself. Route guards
358
- * (which use `registry.whenReady()`) are the correct place to enforce
359
- * "client must be ready before user reaches this route".
360
- *
361
- * For NgModule-style apps using `HTTP_INTERCEPTORS`, use
362
- * `provideTokenSetBearerInterceptor()` instead.
363
- *
364
- * @example
365
- * ```ts
366
- * import { provideHttpClient, withInterceptors } from "@angular/common/http";
367
- * import { createTokenSetBearerInterceptor } from "@securitydept/token-set-context-client-angular";
368
- *
369
- * provideHttpClient(withInterceptors([
370
- * createTokenSetBearerInterceptor(registry, { strictUrlMatch: true }),
371
- * ]));
372
- * ```
54
+ * Declare a guarded token-set route root. Delegates guard assembly to the
55
+ * client-angular base helper and mounts registry-backed behaviour hooks.
373
56
  */
374
- declare function createTokenSetBearerInterceptor(registry: TokenSetAuthRegistry, options?: BearerInterceptorOptions): (req: {
57
+ declare function secureTokenSetRouteRoot(path: string, security?: TokenSetSecureRouteRootSecurityOptions, routeOptions?: SecureRouteConfig): Route;
58
+
59
+ declare const TOKEN_SET_CLIENT_REGISTRY: InjectionToken<TokenSetClientRegistry<BaseOidcModeClient>>;
60
+
61
+ declare function provideTokenSetClientRegistry(options?: ProvideTokenSetClientRegistryOptions): Provider[];
62
+
63
+ interface TokenSetClientRegistryAuthorizationRequest {
375
64
  url: string;
376
65
  clone(update: {
377
66
  setHeaders?: Record<string, string>;
378
67
  }): unknown;
379
- }, next: (req: unknown) => Observable<unknown>) => Observable<unknown>;
380
-
381
- /**
382
- * Angular-native service for handling OIDC redirect callbacks,
383
- * with multi-client discrimination support.
384
- *
385
- * The post-authentication redirect URI is propagated automatically through
386
- * the core client's pending state (set via `loginWithRedirect({ postAuthRedirectUri })`
387
- * and recovered in `handleCallback()`). No manual URL storage is required.
388
- *
389
- * @example
390
- * ```ts
391
- * @Component({ ... })
392
- * export class AuthCallbackComponent {
393
- * private readonly callbackService = inject(CallbackResumeService);
394
- * private readonly router = inject(Router);
395
- *
396
- * async ngOnInit() {
397
- * const result = await this.callbackService.handleCallback(
398
- * window.location.href,
399
- * );
400
- * this.router.navigateByUrl(result.resumeUrl, { replaceUrl: true });
401
- * }
402
- * }
403
- * ```
404
- */
405
- declare class CallbackResumeService {
406
- private readonly registry;
407
- /**
408
- * Check whether a URL is an OIDC authorization callback for any registered
409
- * client in this registry.
410
- *
411
- * This is a convenience wrapper over `clientKeyForCallback()`. Use it for
412
- * programmatic early-exit guards (e.g. in a service constructor) before
413
- * calling `handleCallback()`.
414
- *
415
- * @param url - The full URL to check (e.g. `window.location.href`).
416
- * @returns `true` when the URL matches a registered callback path and
417
- * contains an `code` or `error` query parameter.
418
- */
419
- isCallback(url: string): boolean;
420
- /**
421
- * Handle the OIDC callback, auto-detecting which client the callback
422
- * belongs to via registered callback paths.
423
- *
424
- * The `resumeUrl` in the result is taken directly from the core client's
425
- * pending state (`postAuthRedirectUri` set at `loginWithRedirect()` time),
426
- * falling back to `"/"` when no redirect URI was recorded.
427
- *
428
- * @param callbackUrl - The full current URL (e.g. `window.location.href`).
429
- * @param explicitClientKey - Optional: force-select a client key instead of
430
- * auto-detecting from registered callback paths.
431
- */
432
- handleCallback(callbackUrl: string, explicitClientKey?: string): Promise<{
433
- clientKey: string;
434
- snapshot: AuthSnapshot;
435
- /** The URL to navigate to after a successful callback. */
436
- resumeUrl: string;
437
- }>;
438
- static ɵfac: i0.ɵɵFactoryDeclaration<CallbackResumeService, never>;
439
- static ɵprov: i0.ɵɵInjectableDeclaration<CallbackResumeService>;
440
68
  }
441
-
442
- /**
443
- * A failing entry returned to `onUnauthenticated` when one or more clients
444
- * could not be verified as authenticated.
445
- */
446
- interface UnauthenticatedEntry {
447
- /** The unauthenticated `TokenSetAuthService`. */
448
- readonly service: TokenSetAuthService;
449
- /** The client key for this service. */
450
- readonly clientKey: string;
451
- /** Full client metadata (urlPatterns, callbackPath, requirementKind, providerFamily). */
452
- readonly meta: ClientMeta;
453
- }
454
-
455
- /**
456
- * Check whether the current URL is an OIDC authorization callback.
457
- */
458
- declare function isOidcCallback(options: {
459
- currentUrl: string;
460
- callbackPath: string;
461
- }): boolean;
462
-
463
- /**
464
- * Options for {@link provideTokenSetAuth}.
465
- */
466
- interface ProvideTokenSetAuthOptions {
467
- /**
468
- * Adapter/host registration entries.
469
- *
470
- * Each entry must have a unique `key`. The entry itself owns how one client
471
- * composes auth-context config and runtime capabilities; Angular DI here only
472
- * owns host registration, readiness wiring, and lifecycle.
473
- */
474
- clients: TokenSetClientEntry[];
69
+ type TokenSetClientRegistryAuthorizationForRequest = (registry: TokenSetClientRegistry<BaseOidcModeClient>, request: TokenSetClientRegistryAuthorizationRequest) => Promise<string | null | undefined> | string | null | undefined;
70
+ interface TokenSetClientRegistryAuthorizationInterceptorProviderOptions {
475
71
  /**
476
- * When true (default), schedule `registry.idleWarmup()` during Angular
477
- * environment initialization so `priority: "lazy"` clients get
478
- * preloaded in the browser's idle callback.
479
- *
480
- * Disable for tests that want deterministic, manual materialization
481
- * control.
72
+ * Resolves the Authorization header value for a request.
482
73
  *
483
- * @default true
74
+ * The default implementation selects a registered client by request URL,
75
+ * initializes that client, and reads its replayed authorization header.
484
76
  */
485
- idleWarmup?: boolean;
77
+ authorizationForRequest?: TokenSetClientRegistryAuthorizationForRequest;
486
78
  }
487
- /**
488
- * Create Angular providers for the multi-client token-set auth integration.
489
- *
490
- * Registers all services into Angular DI so adopters can directly inject
491
- * `TokenSetAuthRegistry`, `CallbackResumeService`, and look up individual
492
- * `TokenSetAuthService` instances by key.
493
- *
494
- * ## Async client initialization
495
- *
496
- * When a client's `clientFactory` returns a `Promise` (e.g. because it
497
- * needs to fetch a config projection from a backend endpoint), the
498
- * registry tracks its initialization state automatically. Guards and
499
- * interceptors should use `registry.whenReady(key)` to await
500
- * materialization before accessing the service.
501
- *
502
- * Adapter-managed browser clients also install token-set page-resume
503
- * reconciliation by default during materialization. Set
504
- * `resumeReconciliation: false` on an individual client entry only when the
505
- * host intentionally owns equivalent browser lifecycle wiring.
506
- *
507
- * @example
508
- * ```ts
509
- * import { provideTokenSetAuth } from "@securitydept/token-set-context-client-angular";
510
- * import { resolveConfigProjection, networkConfigSource, createFrontendOidcModeClient }
511
- * from "@securitydept/token-set-context-client/frontend-oidc-mode";
512
- *
513
- * export const appConfig = {
514
- * providers: [
515
- * provideTokenSetAuth({
516
- * clients: [
517
- * {
518
- * key: "main",
519
- * // Async clientFactory: fetches config projection from backend
520
- * clientFactory: async () => {
521
- * const resolved = await resolveConfigProjection([
522
- * networkConfigSource({
523
- * apiEndpoint: "https://api.example.com/api",
524
- * redirectUri: `${location.origin}/auth/callback`,
525
- * }),
526
- * ]);
527
- * return createFrontendOidcModeClient(resolved.config, runtime);
528
- * },
529
- * urlPatterns: ["/api/"],
530
- * callbackPath: "/auth/callback",
531
- * // Optional: opt out only if the host already wires equivalent
532
- * // resume reconciliation for this browser client.
533
- * // resumeReconciliation: false,
534
- * },
535
- * ],
536
- * }),
537
- * ],
538
- * };
539
- * ```
540
- */
541
- declare function provideTokenSetAuth(options: ProvideTokenSetAuthOptions): (Provider | EnvironmentProviders)[];
542
-
543
- /**
544
- * How to select a token-set client from the registry for a specific requirement.
545
- *
546
- * Choose exactly one:
547
- * - `clientKey` — direct key lookup (explicit, single client)
548
- * - `query` — composite filter query ({@link ClientQueryOptions})
549
- */
550
- type TokenSetClientSelector = {
551
- clientKey: string;
552
- query?: never;
553
- } | {
554
- clientKey?: never;
555
- query: ClientQueryOptions;
556
- };
557
- /**
558
- * Runtime context passed to unauthenticated route handlers.
559
- *
560
- * `attemptedUrl` is the Angular Router target URL for the navigation being
561
- * guarded. Use it as `postAuthRedirectUri`; do not read `Router.url` for this,
562
- * because Angular still exposes the currently active URL while a guard is
563
- * deciding whether the attempted navigation may proceed.
564
- */
565
- interface TokenSetRouteUnauthenticatedContext {
566
- readonly route: ActivatedRouteSnapshot;
567
- readonly state: RouterStateSnapshot;
568
- readonly attemptedUrl: string;
569
- }
570
- type TokenSetRouteUnauthenticatedHandler = (unauthenticated: ReadonlyArray<UnauthenticatedEntry>, requirement: AuthRequirement, context: TokenSetRouteUnauthenticatedContext) => boolean | string | UrlTree | Promise<boolean | string | UrlTree>;
571
- /**
572
- * Policy override for a specific requirement ID in
573
- * {@link CreateTokenSetRouteAggregationGuardOptions.requirementPolicies}.
574
- *
575
- * Allows fine-grained control per declared requirement:
576
- * - `selector` overrides the default kind→client registry lookup (use when
577
- * you need a specific client key or a query instead of all clients of that kind).
578
- * - `onUnauthenticated` overrides both `requirementHandlers[kind]` and
579
- * `defaultOnUnauthenticated` for this exact requirement.
580
- *
581
- * @example
582
- * ```ts
583
- * createTokenSetRouteAggregationGuard({
584
- * requirementPolicies: {
585
- * "confluence-oidc": {
586
- * selector: { clientKey: "confluence" },
587
- * onUnauthenticated: (_failing, _req, context) => {
588
- * inject(AuthService)
589
- * .redirectToLogin("confluence", context.attemptedUrl)
590
- * .subscribe();
591
- * return false;
592
- * },
593
- * },
594
- * "admin-oidc": {
595
- * selector: { query: { providerFamily: "internal-sso" } },
596
- * onUnauthenticated: () => "/admin/login",
597
- * },
598
- * },
599
- * })
600
- * ```
601
- */
602
- interface TokenSetRequirementPolicy {
603
- /**
604
- * Override the default kind→client registry lookup for this requirement.
605
- *
606
- * When omitted, the guard resolves clients via
607
- * `registry.clientKeyListForRequirement(requirement.kind)`.
608
- */
609
- selector?: TokenSetClientSelector;
610
- /**
611
- * Handler called when this requirement is selected as pending by the planner.
612
- *
613
- * Takes precedence over `requirementHandlers[kind]` and
614
- * `defaultOnUnauthenticated`.
615
- *
616
- * Return:
617
- * - `true` — allow navigation
618
- * - `false` — block navigation
619
- * - `string` — redirect URL path
620
- * - `UrlTree` — Angular router tree
621
- */
622
- onUnauthenticated: TokenSetRouteUnauthenticatedHandler;
79
+ interface TokenSetClientRegistryAuthorizationInterceptorOptions extends TokenSetClientRegistryAuthorizationInterceptorProviderOptions {
80
+ registry?: TokenSetClientRegistry<BaseOidcModeClient>;
623
81
  }
624
- /**
625
- * Options for {@link createTokenSetRouteAggregationGuard}.
626
- */
627
- interface CreateTokenSetRouteAggregationGuardOptions {
628
- /**
629
- * Per-requirement-id policies.
630
- *
631
- * Keys are `AuthRequirement.id` strings (not kind). Policies declared here
632
- * take precedence over {@link requirementHandlers} and
633
- * {@link defaultOnUnauthenticated}.
634
- *
635
- * Use this for fine-grained control:
636
- * - override client selection (specific key or composite query)
637
- * - per-requirement redirect behaviour
638
- * - multi-client / providerFamily selection per requirement
639
- *
640
- * @example
641
- * ```ts
642
- * createTokenSetRouteAggregationGuard({
643
- * requirementPolicies: {
644
- * "confluence-oidc": {
645
- * selector: { clientKey: "confluence" },
646
- * onUnauthenticated: () => "/auth/confluence",
647
- * },
648
- * "admin-oidc": {
649
- * selector: { query: { providerFamily: "internal-sso" } },
650
- * onUnauthenticated: () => "/auth/admin",
651
- * },
652
- * },
653
- * })
654
- * ```
655
- */
656
- requirementPolicies?: Record<string, TokenSetRequirementPolicy>;
657
- /**
658
- * Per-requirement-kind handlers.
659
- *
660
- * When the planner selects a pending requirement whose `kind` maps to an
661
- * entry here (and no `requirementPolicies[id]` is set), that handler is
662
- * called instead of `defaultOnUnauthenticated`.
663
- *
664
- * Keys are `AuthRequirement.kind` strings.
665
- *
666
- * @example
667
- * ```ts
668
- * createTokenSetRouteAggregationGuard({
669
- * requirementHandlers: {
670
- * frontend_oidc: (failing, _req, context) => {
671
- * inject(AuthService)
672
- * .redirectToLogin(failing[0].clientKey, context.attemptedUrl)
673
- * .subscribe();
674
- * return false;
675
- * },
676
- * },
677
- * })
678
- * ```
679
- */
680
- requirementHandlers?: Record<string, TokenSetRouteUnauthenticatedHandler>;
681
- /**
682
- * Fallback handler used when no `requirementPolicies[id]` or
683
- * `requirementHandlers[kind]` is found for the pending requirement.
684
- */
685
- defaultOnUnauthenticated?: TokenSetRouteUnauthenticatedHandler;
686
- /**
687
- * Custom route data key for reading requirements from route segments.
688
- * @default "authRequirements"
689
- */
690
- requirementsKey?: string;
691
- /**
692
- * Inline planner-host instance. If provided, used instead of injecting
693
- * `AUTH_PLANNER_HOST` from Angular DI.
694
- */
695
- plannerHost?: PlannerHost;
696
- /**
697
- * Resolve the planner-host for the current target route chain.
698
- *
699
- * Use this when planner-host selection depends on route metadata or other
700
- * route-tree state. Takes precedence over `plannerHost` and DI lookup.
701
- */
702
- plannerHostResolver?: (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => PlannerHost | undefined;
82
+ declare const TOKEN_SET_CLIENT_REGISTRY_AUTHORIZATION_FOR_REQUEST: InjectionToken<TokenSetClientRegistryAuthorizationForRequest>;
83
+ declare class TokenSetClientRegistryAuthorizationInterceptor implements HttpInterceptor {
84
+ private readonly registry;
85
+ private readonly authorizationForRequest;
86
+ intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
87
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TokenSetClientRegistryAuthorizationInterceptor, never>;
88
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<TokenSetClientRegistryAuthorizationInterceptor>;
703
89
  }
704
- /**
705
- * Create an Angular `CanActivateFn` that performs full-route requirement
706
- * aggregation and single-pass planner evaluation.
707
- *
708
- * **Canonical Angular Router auth pattern** (route-metadata driven):
709
- * 1. Requirements are declared in route `data` using `withRouteRequirements()`.
710
- * 2. When the guard runs, it walks `route.pathFromRoot` to collect ALL
711
- * requirements from every ancestor segment in a single pass.
712
- * 3. Each requirement's `kind` is mapped to one or more registry clients,
713
- * unless overridden by a `requirementPolicies[id].selector`.
714
- * 4. The complete candidate set is handed to the `PlannerHost` for a
715
- * single `evaluate()` call — the planner selects the first unresolved
716
- * requirement and calls the matching handler.
717
- *
718
- * **Handler resolution order** (most specific wins):
719
- * 1. `requirementPolicies[requirement.id].onUnauthenticated`
720
- * 2. `requirementHandlers[requirement.kind]`
721
- * 3. `defaultOnUnauthenticated`
722
- * 4. Block navigation (`false`) if none of the above is provided.
723
- *
724
- * **Client resolution order** for a requirement:
725
- * 1. `requirementPolicies[requirement.id].selector.clientKey` — single explicit key
726
- * 2. `requirementPolicies[requirement.id].selector.query` — composite query
727
- * 3. `registry.clientKeyListForRequirement(requirement.kind)` — default mapping
728
- *
729
- * This model enables:
730
- * - One-pass requirement collection (no per-segment DI scope accumulation)
731
- * - One-call planner evaluation (chooser sees the full set at once)
732
- * - One redirect decision (no per-segment guard coordination needed)
733
- * - Fine-grained per-requirement policy via `requirementPolicies`
734
- *
735
- * @example
736
- * ```ts
737
- * // routes.ts — declare requirements in route data
738
- * import { withRouteRequirements } from "@securitydept/client-angular";
739
- * import {
740
- * createFrontendOidcLoginRedirectHandler,
741
- * createTokenSetRouteAggregationGuard,
742
- * } from "@securitydept/token-set-context-client-angular";
743
- *
744
- * // Simple — kind-level handler
745
- * const guard = createTokenSetRouteAggregationGuard({
746
- * requirementHandlers: {
747
- * frontend_oidc: createFrontendOidcLoginRedirectHandler({ clientKey: "confluence" }),
748
- * },
749
- * });
750
- *
751
- * // Fine-grained — per-requirement policy
752
- * const guard = createTokenSetRouteAggregationGuard({
753
- * requirementPolicies: {
754
- * "confluence-oidc": {
755
- * selector: { clientKey: "confluence" },
756
- * onUnauthenticated: () => "/auth/confluence",
757
- * },
758
- * "admin-oidc": {
759
- * selector: { query: { providerFamily: "internal-sso" } },
760
- * onUnauthenticated: (failing) => "/auth/admin",
761
- * },
762
- * },
763
- * });
764
- *
765
- * export const routes: Routes = [
766
- * {
767
- * path: "",
768
- * data: withRouteRequirements([{ id: "session", kind: "session" }]),
769
- * children: [
770
- * {
771
- * path: "confluence",
772
- * data: withRouteRequirements([{ id: "confluence-oidc", kind: "frontend_oidc" }]),
773
- * canActivate: [guard],
774
- * },
775
- * ],
776
- * },
777
- * ];
778
- * ```
779
- */
780
- declare function createTokenSetRouteAggregationGuard(options?: CreateTokenSetRouteAggregationGuardOptions): CanActivateFn;
781
- /**
782
- * Build an Angular route-security handler that starts frontend-oidc login and
783
- * records the attempted navigation URL as `postAuthRedirectUri`.
784
- *
785
- * Use this instead of reading `Router.url` inside a guard handler. During guard
786
- * execution Angular has not committed the attempted navigation yet, so
787
- * `Router.url` still points at the previously active page.
788
- *
789
- * After the browser redirect is started, the returned guard result intentionally
790
- * never settles. That keeps Angular from finalizing the rejected in-app
791
- * navigation while the page is already leaving for an external IdP.
792
- */
793
- declare function createFrontendOidcLoginRedirectHandler(options?: {
794
- /**
795
- * Explicit client key. When omitted, the first failing registry entry is
796
- * used, which is the common one-client-per-requirement case.
797
- */
798
- clientKey?: string;
799
- /**
800
- * Fallback used only when Angular does not provide a target URL.
801
- * @default "/"
802
- */
803
- fallbackPostAuthRedirectUri?: string;
804
- }): TokenSetRouteUnauthenticatedHandler;
90
+ declare function provideTokenSetClientRegistryAuthorizationInterceptor(options?: TokenSetClientRegistryAuthorizationInterceptorProviderOptions): Provider[];
91
+ declare function createTokenSetClientRegistryAuthorizationInterceptor(options?: TokenSetClientRegistryAuthorizationInterceptorOptions): HttpInterceptorFn;
92
+ declare function defaultTokenSetClientRegistryAuthorizationForRequest(registry: TokenSetClientRegistry<BaseOidcModeClient>, request: TokenSetClientRegistryAuthorizationRequest): Promise<string | null>;
805
93
 
806
- /**
807
- * Route data key for choosing a planner-host registered at the route root.
808
- */
809
- declare const TOKEN_SET_ROUTE_PLANNER_HOST_KEY_DATA_KEY = "tokenSetPlannerHostKey";
810
- /**
811
- * Serializable route-level security declaration.
812
- *
813
- * This object is safe to embed in Angular route metadata. Non-serializable
814
- * runtime policy (planner host instances, callbacks, chooser implementations)
815
- * belongs in {@link SecureRouteRootSecurityOptions}.
816
- */
817
- interface SecureRouteSecurityOptions {
818
- /**
819
- * Requirements declared at this route segment.
820
- * @default []
821
- */
822
- requirements?: AuthRequirement[];
823
- /**
824
- * How this segment composes with ancestor route requirements.
825
- * @default merge
826
- */
827
- composition?: RequirementsClientSetComposition;
828
- /**
829
- * Serializable lookup key for a planner-host provided by the root route.
830
- *
831
- * The nearest declared key on the active route chain wins.
832
- */
833
- plannerHostKey?: string;
834
- }
835
- /**
836
- * Root-level runtime policy for a secured route tree.
837
- *
838
- * Everything here is intentionally non-serializable and lives outside route
839
- * metadata. Child `secureRoute()` calls only reference these policies by
840
- * serializable keys / requirement ids.
841
- */
842
- interface SecureRouteRootSecurityOptions extends SecureRouteSecurityOptions, Omit<CreateTokenSetRouteAggregationGuardOptions, "plannerHost" | "plannerHostResolver"> {
843
- /**
844
- * Named planner-host instances available to the secured route tree.
845
- */
846
- plannerHosts?: Record<string, PlannerHost>;
847
- /**
848
- * Fallback planner-host key when no route segment declares one.
849
- */
850
- defaultPlannerHostKey?: string;
94
+ type BackendCallbackResult = OidcModeCallbackHandlingResult<TokenSetAuthSnapshot>;
95
+ declare class TokenSetBackendCallbackComponent {
96
+ readonly clientQuery: _angular_core.InputSignal<TokenSetCallbackClientQuery | undefined>;
97
+ readonly clientGuard: _angular_core.InputSignal<TokenSetCallbackClientGuard<TokenSetBackendCallbackClient> | undefined>;
98
+ readonly autoInitialize: _angular_core.InputSignal<boolean>;
99
+ private readonly environment;
100
+ private readonly registry;
101
+ private readonly destroyRef;
102
+ private readonly selectionSource;
103
+ private readonly selectionSignal;
104
+ readonly selection: Signal<TokenSetCallbackClientSelectionSnapshot<TokenSetBackendCallbackClient>>;
105
+ readonly resource: _securitydept_client.WithInteropObservableTraitCompat<_securitydept_client.ResourceTrait<BackendCallbackResult>, ResourceSnapshot<BackendCallbackResult>>;
106
+ readonly state: Signal<ResourceSnapshot<BackendCallbackResult>>;
107
+ constructor();
108
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TokenSetBackendCallbackComponent, never>;
109
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<TokenSetBackendCallbackComponent, "sd-token-set-backend-callback", ["sdTokenSetBackendCallback"], { "clientQuery": { "alias": "clientQuery"; "required": false; "isSignal": true; }; "clientGuard": { "alias": "clientGuard"; "required": false; "isSignal": true; }; "autoInitialize": { "alias": "autoInitialize"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
851
110
  }
852
- type SecureRouteOptions = Omit<Route, "path" | "data"> & {
853
- data?: Record<string, unknown>;
854
- };
855
- /**
856
- * Build a secured child route declaration.
857
- *
858
- * The returned route contains only serializable metadata:
859
- * requirements, composition strategy, planner-host lookup key, and any extra
860
- * route data the caller provides.
861
- */
862
- declare function secureRoute(path: string, securityOptions?: SecureRouteSecurityOptions, routeOptions?: SecureRouteOptions): Route;
863
- /**
864
- * Build a secured route-tree root.
865
- *
866
- * This is the canonical Angular adopter entry for token-set route security:
867
- * root-level runtime policy stays here, child routes use {@link secureRoute}
868
- * for serializable declarations only.
869
- */
870
- declare function secureRouteRoot(path: string, securityOptions?: SecureRouteRootSecurityOptions, routeOptions?: SecureRouteOptions): Route;
871
- /**
872
- * Alias with a token-set-specific name for callers who prefer explicit imports.
873
- */
874
- declare const secureTokenSetRoute: typeof secureRoute;
875
- /**
876
- * Alias with a token-set-specific name for callers who prefer explicit imports.
877
- */
878
- declare const secureTokenSetRouteRoot: typeof secureRouteRoot;
879
111
 
880
- /**
881
- * Drop-in standalone Angular component for OIDC redirect callback routes.
882
- *
883
- * Handles the full callback lifecycle on initialization:
884
- * 1. Calls `CallbackResumeService.handleCallback()` with the current URL.
885
- * 2. Navigates to `result.resumeUrl` (the post-auth redirect set at login time).
886
- * 3. On error: logs and falls back to navigating to `"/"`.
887
- *
888
- * Register as a route component — no additional glue needed:
889
- * ```ts
890
- * import { TokenSetCallbackComponent } from "@securitydept/token-set-context-client-angular";
891
- *
892
- * export const routes: Routes = [
893
- * { path: "auth/callback", component: TokenSetCallbackComponent },
894
- * ];
895
- * ```
896
- *
897
- * For custom error handling or UI, subclass this component or build your own
898
- * using `CallbackResumeService` directly.
899
- */
900
- declare class TokenSetCallbackComponent implements OnInit {
901
- private readonly callbackService;
902
- private readonly router;
903
- ngOnInit(): void;
904
- static ɵfac: i0.ɵɵFactoryDeclaration<TokenSetCallbackComponent, never>;
905
- static ɵcmp: i0.ɵɵComponentDeclaration<TokenSetCallbackComponent, "token-set-callback", never, {}, {}, never, never, true, never>;
112
+ type FrontendCallbackResult = OidcModeCallbackHandlingResult<FrontendOidcModeCallbackResult>;
113
+ declare class TokenSetFrontendCallbackComponent {
114
+ readonly clientQuery: _angular_core.InputSignal<TokenSetCallbackClientQuery | undefined>;
115
+ readonly clientGuard: _angular_core.InputSignal<TokenSetCallbackClientGuard<TokenSetFrontendCallbackClient> | undefined>;
116
+ readonly autoInitialize: _angular_core.InputSignal<boolean>;
117
+ private readonly environment;
118
+ private readonly registry;
119
+ private readonly destroyRef;
120
+ private readonly selectionSource;
121
+ private readonly selectionSignal;
122
+ readonly selection: Signal<TokenSetCallbackClientSelectionSnapshot<TokenSetFrontendCallbackClient>>;
123
+ readonly resource: _securitydept_client.WithInteropObservableTraitCompat<_securitydept_client.ResourceTrait<FrontendCallbackResult>, ResourceSnapshot<FrontendCallbackResult>>;
124
+ readonly state: Signal<ResourceSnapshot<FrontendCallbackResult>>;
125
+ constructor();
126
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TokenSetFrontendCallbackComponent, never>;
127
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<TokenSetFrontendCallbackComponent, "sd-token-set-frontend-callback", ["sdTokenSetFrontendCallback"], { "clientQuery": { "alias": "clientQuery"; "required": false; "isSignal": true; }; "clientGuard": { "alias": "clientGuard"; "required": false; "isSignal": true; }; "autoInitialize": { "alias": "autoInitialize"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
906
128
  }
907
129
 
908
- /** InjectionToken for the multi-client auth registry. */
909
- declare const TOKEN_SET_AUTH_REGISTRY: InjectionToken<TokenSetAuthRegistry>;
910
-
911
- export { CallbackResumeService, TOKEN_SET_AUTH_REGISTRY, TOKEN_SET_BEARER_INTERCEPTOR_OPTIONS, TOKEN_SET_ROUTE_PLANNER_HOST_KEY_DATA_KEY, TokenSetAuthRegistry, TokenSetAuthService, TokenSetBearerInterceptor, TokenSetCallbackComponent, createFrontendOidcLoginRedirectHandler, createTokenSetBearerInterceptor, createTokenSetRouteAggregationGuard, isOidcCallback, provideTokenSetAuth, provideTokenSetBearerInterceptor, secureRoute, secureRouteRoot, secureTokenSetRoute, secureTokenSetRouteRoot };
912
- export type { BearerInterceptorOptions, CreateTokenSetRouteAggregationGuardOptions, ProvideTokenSetAuthOptions, SecureRouteRootSecurityOptions, SecureRouteSecurityOptions, TokenSetAngularClient, TokenSetClientEntry, TokenSetClientSelector, TokenSetRequirementPolicy, TokenSetRouteUnauthenticatedContext, TokenSetRouteUnauthenticatedHandler, UnauthenticatedEntry };
130
+ export { TOKEN_SET_CLIENT_REGISTRY, TOKEN_SET_CLIENT_REGISTRY_AUTHORIZATION_FOR_REQUEST, TokenSetBackendCallbackComponent, TokenSetClientRegistryAuthorizationInterceptor, TokenSetFrontendCallbackComponent, createTokenSetCanActivate, createTokenSetCanActivateChild, createTokenSetClientRegistryAuthorizationInterceptor, defaultTokenSetClientRegistryAuthorizationForRequest, provideTokenSetClientRegistry, provideTokenSetClientRegistryAuthorizationInterceptor, provideTokenSetRequirementPlannerHost, secureTokenSetRoute, secureTokenSetRouteRoot };
131
+ export type { ProvideTokenSetRequirementPlannerHostOptions, TokenSetAngularGuardOptions, TokenSetClientRegistryAuthorizationForRequest, TokenSetClientRegistryAuthorizationInterceptorOptions, TokenSetClientRegistryAuthorizationInterceptorProviderOptions, TokenSetClientRegistryAuthorizationRequest, TokenSetSecureRouteRootSecurityOptions, TokenSetSecureRouteSecurityOptions };
913
132
  //# sourceMappingURL=securitydept-token-set-context-client-angular.d.ts.map