@securitydept/basic-auth-context-client 0.3.0-beta.6 → 0.3.0-beta.7
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/dist/index.d.mts +51 -24
- package/dist/index.mjs +40 -30
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CancellationTokenOptions,
|
|
1
|
+
import { CancellationTokenOptions, ClientError, DisposableTrait, EventStreamTrait, FoundationEnvironment, ReadableSignalTrait, ResourceSnapshot, ResourceTrait, SYMBOL_DISPOSE, SecuritydeptInjectorTrait, SecuritydeptProvider, SpanTrait } from "@securitydept/client";
|
|
2
2
|
//#region src/authorization-header.d.ts
|
|
3
3
|
interface CreateBasicAuthorizationHeaderValueOptions {
|
|
4
4
|
readonly username: string;
|
|
@@ -7,17 +7,6 @@ interface CreateBasicAuthorizationHeaderValueOptions {
|
|
|
7
7
|
declare function createBasicAuthorizationHeaderValue(options: CreateBasicAuthorizationHeaderValueOptions): string;
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/types.d.ts
|
|
10
|
-
/** Configuration for a single Basic Auth zone. */
|
|
11
|
-
declare const BasicAuthContextErrorCode: {
|
|
12
|
-
readonly OperationFailed: "basic_auth.operation_failed";
|
|
13
|
-
readonly InvalidConfig: "basic_auth.invalid_config";
|
|
14
|
-
readonly ClientDisposed: "basic_auth.client_disposed";
|
|
15
|
-
readonly RouterUnavailable: "basic_auth.router_unavailable";
|
|
16
|
-
readonly ProbePathRequired: "basic_auth.probe_path_required";
|
|
17
|
-
readonly ZoneNotFound: "basic_auth.zone_not_found";
|
|
18
|
-
readonly ZoneRequired: "basic_auth.zone_required";
|
|
19
|
-
};
|
|
20
|
-
type BasicAuthContextErrorCode = (typeof BasicAuthContextErrorCode)[keyof typeof BasicAuthContextErrorCode];
|
|
21
10
|
interface BasicAuthZoneConfig {
|
|
22
11
|
/** URL path prefix for this zone (e.g. "/basic"). */
|
|
23
12
|
zonePrefix: string;
|
|
@@ -66,10 +55,6 @@ interface BasicAuthBoundarySnapshot {
|
|
|
66
55
|
challengeHeader: string | null;
|
|
67
56
|
zone?: ResolvedBasicAuthZone;
|
|
68
57
|
}
|
|
69
|
-
declare const BasicAuthContextSource: {
|
|
70
|
-
readonly BasicAuthContext: "basic-auth-context";
|
|
71
|
-
};
|
|
72
|
-
type BasicAuthContextSource = (typeof BasicAuthContextSource)[keyof typeof BasicAuthContextSource];
|
|
73
58
|
declare const BasicAuthContextEventType: {
|
|
74
59
|
readonly BoundaryRefreshStarted: "basic_auth.boundary.refresh.started";
|
|
75
60
|
readonly BoundaryRefreshSucceeded: "basic_auth.boundary.refresh.succeeded";
|
|
@@ -83,16 +68,42 @@ declare const BasicAuthContextEventType: {
|
|
|
83
68
|
readonly LoginRedirectFailed: "basic_auth.login.redirect.failed";
|
|
84
69
|
};
|
|
85
70
|
type BasicAuthContextEventType = (typeof BasicAuthContextEventType)[keyof typeof BasicAuthContextEventType];
|
|
86
|
-
interface
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
id: string;
|
|
71
|
+
interface BasicAuthContextEventBase {
|
|
72
|
+
readonly at: number;
|
|
73
|
+
readonly client: {
|
|
74
|
+
readonly id: string;
|
|
91
75
|
};
|
|
92
|
-
snapshot?: BasicAuthBoundarySnapshot | null;
|
|
93
|
-
zone?: ResolvedBasicAuthZone;
|
|
94
|
-
errorSummary?: ErrorSummary;
|
|
95
76
|
}
|
|
77
|
+
type BasicAuthContextEventData = {
|
|
78
|
+
readonly type: typeof BasicAuthContextEventType.BoundaryRefreshStarted;
|
|
79
|
+
readonly snapshot: BasicAuthBoundarySnapshot | null;
|
|
80
|
+
} | {
|
|
81
|
+
readonly type: typeof BasicAuthContextEventType.BoundaryRefreshSucceeded;
|
|
82
|
+
readonly snapshot: BasicAuthBoundarySnapshot;
|
|
83
|
+
readonly zone?: ResolvedBasicAuthZone;
|
|
84
|
+
} | {
|
|
85
|
+
readonly type: typeof BasicAuthContextEventType.BoundaryRefreshFailed;
|
|
86
|
+
readonly snapshot: BasicAuthBoundarySnapshot | null;
|
|
87
|
+
readonly error: ClientError;
|
|
88
|
+
} | {
|
|
89
|
+
readonly type: typeof BasicAuthContextEventType.LogoutStarted;
|
|
90
|
+
readonly snapshot: BasicAuthBoundarySnapshot | null;
|
|
91
|
+
} | {
|
|
92
|
+
readonly type: typeof BasicAuthContextEventType.LogoutSucceeded;
|
|
93
|
+
readonly snapshot: null;
|
|
94
|
+
} | {
|
|
95
|
+
readonly type: typeof BasicAuthContextEventType.LogoutFailed;
|
|
96
|
+
readonly snapshot: BasicAuthBoundarySnapshot | null;
|
|
97
|
+
readonly error: ClientError;
|
|
98
|
+
} | {
|
|
99
|
+
readonly type: typeof BasicAuthContextEventType.LoginRedirectStarted | typeof BasicAuthContextEventType.LoginRedirectSucceeded;
|
|
100
|
+
readonly zone: ResolvedBasicAuthZone;
|
|
101
|
+
} | {
|
|
102
|
+
readonly type: typeof BasicAuthContextEventType.LoginRedirectFailed;
|
|
103
|
+
readonly zone: ResolvedBasicAuthZone;
|
|
104
|
+
readonly error: ClientError;
|
|
105
|
+
};
|
|
106
|
+
type BasicAuthContextEvent = BasicAuthContextEventBase & BasicAuthContextEventData;
|
|
96
107
|
interface BasicAuthContextOperationSignals {
|
|
97
108
|
readonly startPending: ReadableSignalTrait<boolean>;
|
|
98
109
|
readonly refreshPending: ReadableSignalTrait<boolean>;
|
|
@@ -228,6 +239,22 @@ declare class BasicAuthContextClient implements DisposableTrait {
|
|
|
228
239
|
private _emitEvent;
|
|
229
240
|
}
|
|
230
241
|
//#endregion
|
|
242
|
+
//#region src/error.d.ts
|
|
243
|
+
declare const BasicAuthContextErrorCode: {
|
|
244
|
+
readonly OperationFailed: "basic_auth.operation_failed";
|
|
245
|
+
readonly InvalidConfig: "basic_auth.invalid_config";
|
|
246
|
+
readonly ClientDisposed: "basic_auth.client_disposed";
|
|
247
|
+
readonly RouterUnavailable: "basic_auth.router_unavailable";
|
|
248
|
+
readonly ProbePathRequired: "basic_auth.probe_path_required";
|
|
249
|
+
readonly ZoneNotFound: "basic_auth.zone_not_found";
|
|
250
|
+
readonly ZoneRequired: "basic_auth.zone_required";
|
|
251
|
+
};
|
|
252
|
+
type BasicAuthContextErrorCode = (typeof BasicAuthContextErrorCode)[keyof typeof BasicAuthContextErrorCode];
|
|
253
|
+
declare const BasicAuthContextSource: {
|
|
254
|
+
readonly BasicAuthContext: "basic-auth-context";
|
|
255
|
+
};
|
|
256
|
+
type BasicAuthContextSource = (typeof BasicAuthContextSource)[keyof typeof BasicAuthContextSource];
|
|
257
|
+
//#endregion
|
|
231
258
|
//#region src/providers.d.ts
|
|
232
259
|
interface ProvideBasicAuthContextOptions {
|
|
233
260
|
readonly config: BasicAuthContextClientConfig;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ClientError, ClientErrorKind, ENVIRONMENT_TOKEN, INJECTOR_TOKEN, ResourceSnapshotUpdateKind, ResourceStatus, RouterNavigationIntent, RouterNavigationMode, SYMBOL_DISPOSE, SecuritydeptDestroyRef, SecuritydeptInjectionToken, UriReferenceString, createCancellationTokenSource, createLinkedCancellationToken, createOnceAsyncLockCallable, createSignal, defineInstrumentMethodDecorator,
|
|
2
|
-
import {
|
|
1
|
+
import { ClientError, ClientErrorKind, ENVIRONMENT_TOKEN, INJECTOR_TOKEN, ResourceSnapshotUpdateKind, ResourceStatus, RouterNavigationIntent, RouterNavigationMode, SYMBOL_DISPOSE, SecuritydeptDestroyRef, SecuritydeptInjectionToken, SpanSharedAttributeName, UriReferenceString, createCancellationTokenSource, createLinkedCancellationToken, createOnceAsyncLockCallable, createSignal, defineInstrumentMethodDecorator, encodeUint8ArrayToBase64, injectDisposableStackFrom, mapResource, readonlySignal, reduceResourceSnapshot, resourceFromSnapshots, throwValidationClientError, validateTraitInput, withDisposableStack } from "@securitydept/client";
|
|
2
|
+
import { RxEventSubject, RxStateSignal, commandResponseData, concatCommand, dispatchCommandLocallyToStream } from "@securitydept/client/rx";
|
|
3
3
|
import { filter, from, lastValueFrom, take, takeUntil } from "rxjs";
|
|
4
4
|
import { v7 } from "uuid";
|
|
5
5
|
import { type } from "arktype";
|
|
@@ -14,6 +14,26 @@ function createBasicAuthorizationHeaderValue(options) {
|
|
|
14
14
|
return `Basic ${encodeUint8ArrayToBase64(new TextEncoder().encode(`${options.username}:${options.password}`))}`;
|
|
15
15
|
}
|
|
16
16
|
//#endregion
|
|
17
|
+
//#region src/error.ts
|
|
18
|
+
const BasicAuthContextErrorCode = {
|
|
19
|
+
OperationFailed: "basic_auth.operation_failed",
|
|
20
|
+
InvalidConfig: "basic_auth.invalid_config",
|
|
21
|
+
ClientDisposed: "basic_auth.client_disposed",
|
|
22
|
+
RouterUnavailable: "basic_auth.router_unavailable",
|
|
23
|
+
ProbePathRequired: "basic_auth.probe_path_required",
|
|
24
|
+
ZoneNotFound: "basic_auth.zone_not_found",
|
|
25
|
+
ZoneRequired: "basic_auth.zone_required"
|
|
26
|
+
};
|
|
27
|
+
const BasicAuthContextSource = { BasicAuthContext: "basic-auth-context" };
|
|
28
|
+
function clientErrorFromBasicAuthError(error, options) {
|
|
29
|
+
return ClientError.fromUnknown(error, {
|
|
30
|
+
code: BasicAuthContextErrorCode.OperationFailed,
|
|
31
|
+
message: "The Basic Auth operation failed unexpectedly",
|
|
32
|
+
source: BasicAuthContextSource.BasicAuthContext,
|
|
33
|
+
span: options.span
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
17
37
|
//#region src/schemas.ts
|
|
18
38
|
const BasicAuthZoneConfigSchema = type({
|
|
19
39
|
zonePrefix: "string > 0",
|
|
@@ -36,21 +56,11 @@ const BASIC_AUTH_CONTEXT_CLIENT = new SecuritydeptInjectionToken("BASIC_AUTH_CON
|
|
|
36
56
|
const BASIC_AUTH_CONTEXT_CLIENT_CONFIG = new SecuritydeptInjectionToken("BASIC_AUTH_CONTEXT_CLIENT_CONFIG");
|
|
37
57
|
//#endregion
|
|
38
58
|
//#region src/types.ts
|
|
39
|
-
/** Configuration for a single Basic Auth zone. */ const BasicAuthContextErrorCode = {
|
|
40
|
-
OperationFailed: "basic_auth.operation_failed",
|
|
41
|
-
InvalidConfig: "basic_auth.invalid_config",
|
|
42
|
-
ClientDisposed: "basic_auth.client_disposed",
|
|
43
|
-
RouterUnavailable: "basic_auth.router_unavailable",
|
|
44
|
-
ProbePathRequired: "basic_auth.probe_path_required",
|
|
45
|
-
ZoneNotFound: "basic_auth.zone_not_found",
|
|
46
|
-
ZoneRequired: "basic_auth.zone_required"
|
|
47
|
-
};
|
|
48
59
|
const BasicAuthBoundaryKind = {
|
|
49
60
|
Authenticated: "authenticated",
|
|
50
61
|
Challenge: "challenge",
|
|
51
62
|
Unauthorized: "unauthorized"
|
|
52
63
|
};
|
|
53
|
-
const BasicAuthContextSource = { BasicAuthContext: "basic-auth-context" };
|
|
54
64
|
const BasicAuthContextEventType = {
|
|
55
65
|
BoundaryRefreshStarted: "basic_auth.boundary.refresh.started",
|
|
56
66
|
BoundaryRefreshSucceeded: "basic_auth.boundary.refresh.succeeded",
|
|
@@ -298,12 +308,8 @@ const instrumentBasicAuthMethod = defineInstrumentMethodDecorator(({ factoryArgs
|
|
|
298
308
|
span: this.span,
|
|
299
309
|
name: `${this.config.tracing.prefix}.${operation}`,
|
|
300
310
|
target: this.config.tracing.target,
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
code: BasicAuthContextErrorCode.OperationFailed,
|
|
304
|
-
message: "The Basic Auth operation failed unexpectedly",
|
|
305
|
-
source: BasicAuthContextSource.BasicAuthContext
|
|
306
|
-
})
|
|
311
|
+
traceAttributes: { operation },
|
|
312
|
+
clientErrorFromUnknown: (error, options) => clientErrorFromBasicAuthError(error, options)
|
|
307
313
|
};
|
|
308
314
|
});
|
|
309
315
|
function resolveZone(config) {
|
|
@@ -384,7 +390,7 @@ _dec = instrumentBasicAuthMethod("start"), _dec1 = withDisposableStack(0, true),
|
|
|
384
390
|
logoutPending: createSignal(false),
|
|
385
391
|
loginRedirectPending: createSignal(false)
|
|
386
392
|
};
|
|
387
|
-
_eventSubject = new
|
|
393
|
+
_eventSubject = new RxEventSubject();
|
|
388
394
|
_refreshCommandSubject = new RxEventSubject();
|
|
389
395
|
_refreshResponseSubject = new RxEventSubject();
|
|
390
396
|
_startOnce = createOnceAsyncLockCallable(async (cancellationToken, operationSpan) => {
|
|
@@ -449,8 +455,8 @@ _dec = instrumentBasicAuthMethod("start"), _dec1 = withDisposableStack(0, true),
|
|
|
449
455
|
this.id = resolvedConfig.id;
|
|
450
456
|
this.zones = resolvedConfig.zones;
|
|
451
457
|
this._span = environment.span.fork({ attributes: {
|
|
452
|
-
|
|
453
|
-
|
|
458
|
+
[SpanSharedAttributeName.ClientName]: this.constructor.name,
|
|
459
|
+
[SpanSharedAttributeName.ClientId]: this.id
|
|
454
460
|
} });
|
|
455
461
|
this.boundarySnapshot = readonlySignal(this._boundarySnapshotSignal);
|
|
456
462
|
this.boundaryResource = resourceFromSnapshots(() => this._boundarySnapshotSignal.get());
|
|
@@ -517,18 +523,19 @@ _dec = instrumentBasicAuthMethod("start"), _dec1 = withDisposableStack(0, true),
|
|
|
517
523
|
status: ResourceStatus.Resolved,
|
|
518
524
|
value: null
|
|
519
525
|
});
|
|
520
|
-
operationSpan?.
|
|
526
|
+
operationSpan?.setTraceAttributes({ localProjectionCleared: true });
|
|
521
527
|
this._emitEvent({
|
|
522
528
|
type: BasicAuthContextEventType.LogoutSucceeded,
|
|
523
529
|
snapshot: null
|
|
524
530
|
});
|
|
525
531
|
} catch (error) {
|
|
532
|
+
const clientError = clientErrorFromBasicAuthError(error, { span: operationSpan?.span });
|
|
526
533
|
this._emitEvent({
|
|
527
534
|
type: BasicAuthContextEventType.LogoutFailed,
|
|
528
535
|
snapshot: this._readCurrentSnapshot(),
|
|
529
|
-
|
|
536
|
+
error: clientError
|
|
530
537
|
});
|
|
531
|
-
throw
|
|
538
|
+
throw clientError;
|
|
532
539
|
} finally {
|
|
533
540
|
this._operationSignals.logoutPending.set(false);
|
|
534
541
|
}
|
|
@@ -567,12 +574,13 @@ _dec = instrumentBasicAuthMethod("start"), _dec1 = withDisposableStack(0, true),
|
|
|
567
574
|
zone
|
|
568
575
|
});
|
|
569
576
|
} catch (error) {
|
|
577
|
+
const clientError = clientErrorFromBasicAuthError(error, { span: _operationSpan?.span });
|
|
570
578
|
this._emitEvent({
|
|
571
579
|
type: BasicAuthContextEventType.LoginRedirectFailed,
|
|
572
580
|
zone,
|
|
573
|
-
|
|
581
|
+
error: clientError
|
|
574
582
|
});
|
|
575
|
-
throw
|
|
583
|
+
throw clientError;
|
|
576
584
|
} finally {
|
|
577
585
|
this._operationSignals.loginRedirectPending.set(false);
|
|
578
586
|
}
|
|
@@ -621,6 +629,7 @@ _dec = instrumentBasicAuthMethod("start"), _dec1 = withDisposableStack(0, true),
|
|
|
621
629
|
}
|
|
622
630
|
dispose() {
|
|
623
631
|
this._destroyed.set(true);
|
|
632
|
+
this._eventSubject.complete();
|
|
624
633
|
}
|
|
625
634
|
[SYMBOL_DISPOSE]() {
|
|
626
635
|
this.dispose();
|
|
@@ -696,7 +705,7 @@ _dec = instrumentBasicAuthMethod("start"), _dec1 = withDisposableStack(0, true),
|
|
|
696
705
|
kind: ResourceSnapshotUpdateKind.Resolve,
|
|
697
706
|
value: snapshot
|
|
698
707
|
}));
|
|
699
|
-
operationSpan?.
|
|
708
|
+
operationSpan?.setTraceAttributes({
|
|
700
709
|
authenticated: snapshot.authenticated,
|
|
701
710
|
boundaryKind: snapshot.boundaryKind
|
|
702
711
|
});
|
|
@@ -707,16 +716,17 @@ _dec = instrumentBasicAuthMethod("start"), _dec1 = withDisposableStack(0, true),
|
|
|
707
716
|
});
|
|
708
717
|
return snapshot;
|
|
709
718
|
} catch (error) {
|
|
719
|
+
const clientError = clientErrorFromBasicAuthError(error, { span: operationSpan?.span });
|
|
710
720
|
this._boundarySnapshotSignal.set(reduceResourceSnapshot(loadingSnapshot, {
|
|
711
721
|
kind: ResourceSnapshotUpdateKind.Fail,
|
|
712
|
-
error
|
|
722
|
+
error: clientError
|
|
713
723
|
}));
|
|
714
724
|
this._emitEvent({
|
|
715
725
|
type: BasicAuthContextEventType.BoundaryRefreshFailed,
|
|
716
726
|
snapshot: this._readCurrentSnapshot(),
|
|
717
|
-
|
|
727
|
+
error: clientError
|
|
718
728
|
});
|
|
719
|
-
throw
|
|
729
|
+
throw clientError;
|
|
720
730
|
} finally {
|
|
721
731
|
this._operationSignals.refreshPending.set(false);
|
|
722
732
|
}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["ClientError","ClientErrorKind","encodeUint8ArrayToBase64","createBasicAuthorizationHeaderValue","options","username","includes","kind","Configuration","code","message","source","TextEncoder","encode","password","type","defineType","BasicAuthZoneConfigSchema","zonePrefix","BasicAuthContextClientConfigSchema","baseUrl","zones","array","atLeastLength","SecuritydeptInjectionToken","BASIC_AUTH_CONTEXT_CLIENT","BASIC_AUTH_CONTEXT_CLIENT_CONFIG","BasicAuthContextErrorCode","OperationFailed","InvalidConfig","ClientDisposed","RouterUnavailable","ProbePathRequired","ZoneNotFound","ZoneRequired","BasicAuthBoundaryKind","Authenticated","Challenge","Unauthorized","BasicAuthContextSource","BasicAuthContext","BasicAuthContextEventType","BoundaryRefreshStarted","BoundaryRefreshSucceeded","BoundaryRefreshFailed","LogoutStarted","LogoutSucceeded","LogoutFailed","LoginRedirectStarted","LoginRedirectSucceeded","LoginRedirectFailed","AuthGuardResultKind","Ok","Redirect","AuthGuardRedirectStatus","Found","SeeOther","TemporaryRedirect","ClientError","ClientErrorKind","createCancellationTokenSource","createLinkedCancellationToken","createOnceAsyncLockCallable","createSignal","defineInstrumentMethodDecorator","describeError","ENVIRONMENT_TOKEN","injectDisposableStackFrom","mapResource","ResourceSnapshotUpdateKind","ResourceStatus","RouterNavigationIntent","RouterNavigationMode","readonlySignal","reduceResourceSnapshot","resourceFromSnapshots","SecuritydeptDestroyRef","SYMBOL_DISPOSE","throwValidationClientError","UriReferenceString","validateTraitInput","withDisposableStack","commandResponseData","concatCommand","dispatchCommandLocallyToStream","RxEventReplaySubject","RxEventSubject","RxStateSignal","filter","from","lastValueFrom","take","takeUntil","v7","uuidv7","BasicAuthContextClientConfigSchema","BASIC_AUTH_CONTEXT_CLIENT_CONFIG","AuthGuardRedirectStatus","AuthGuardResultKind","BasicAuthBoundaryKind","BasicAuthBoundaryKindValues","BasicAuthContextErrorCode","BasicAuthContextEventType","BasicAuthContextSource","DEFAULT_LOGIN_SUBPATH","POST_AUTH_REDIRECT_PARAM","instrumentBasicAuthMethod","factoryArgs","operation","environment","span","name","config","tracing","prefix","target","fields","normalizeError","error","fromUnknown","code","OperationFailed","message","source","BasicAuthContext","resolveZone","zonePrefix","replace","loginSub","loginSubpath","loginPath","readBasicAuthBoundaryKind","options","status","Authenticated","challengeHeader","Challenge","Unauthorized","BasicAuthContextClient","_start","refresh","_refresh","logout","_logout","loginWithRedirect","_loginWithRedirect","defaultOptions","_environment","_config","_span","_rootCancellation","_destroyed","fromInitialValue","destroyed$","pipe","value","_boundarySnapshotSignal","Idle","_operationSignals","startPending","refreshPending","logoutPending","loginRedirectPending","_eventSubject","_refreshCommandSubject","_refreshResponseSubject","_startOnce","cancellationToken","operationSpan","throwIfCancellationRequested","set","_dispatchRefresh","_resolveRefreshOptions","id","zones","boundarySnapshot","boundaryResource","isAuthenticated","operations","events","fromEnvironmentConfig","fromInjector","injector","client","get","onDestroy","dispose","bundledSchema","onInvalid","failure","InvalidConfig","messagePrefix","resolvedConfig","baseUrl","map","probePath","fork","attributes","clientName","snapshot","authenticated","subscribe","cancel","kind","Cancelled","ClientDisposed","command","_executeRefresh","payload","autoStart","start","catch","token","disposableStack","use","_options","_emitEvent","type","LogoutStarted","_readCurrentSnapshot","Resolved","setAttributes","localProjectionCleared","LogoutSucceeded","LogoutFailed","errorSummary","_operationSpan","router","Configuration","RouterUnavailable","zone","_resolveZoneForAction","postAuthRedirectUri","currentPath","LoginRedirectStarted","navigate","url","parse","loginUrl","intent","AuthRedirect","mode","External","LoginRedirectSucceeded","LoginRedirectFailed","zoneForPath","path","matchedZone","matches","startsWith","length","zoneForPrefix","find","isInZone","undefined","base","params","URLSearchParams","toString","loginUrlForZonePrefix","handleUnauthorized","responseStatus","Ok","Redirect","Found","location","ProbePathRequired","action","ZoneNotFound","ZoneRequired","requestStream","responseStream","createCommandExtra","previous","loadingSnapshot","Load","BoundaryRefreshStarted","response","transport","execute","method","headers","accept","fromHttpResponse","body","_snapshotFromResponse","Resolve","boundaryKind","BoundaryRefreshSucceeded","Fail","BoundaryRefreshFailed","requestPath","Reloading","Error","input","next","at","time","now","INJECTOR_TOKEN","BasicAuthContextClient","BASIC_AUTH_CONTEXT_CLIENT","BASIC_AUTH_CONTEXT_CLIENT_CONFIG","provideBasicAuthContext","options","provide","useValue","config","useFactory","injector","fromInjector","deps"],"sources":["../src/authorization-header.ts","../src/schemas.ts","../src/tokens.ts","../src/types.ts","../src/client.ts","../src/providers.ts"],"sourcesContent":["import {\n\tClientError,\n\tClientErrorKind,\n\tencodeUint8ArrayToBase64,\n} from \"@securitydept/client\";\n\nexport interface CreateBasicAuthorizationHeaderValueOptions {\n\treadonly username: string;\n\treadonly password: string;\n}\n\nexport function createBasicAuthorizationHeaderValue(\n\toptions: CreateBasicAuthorizationHeaderValueOptions,\n): string {\n\tif (options.username.includes(\":\")) {\n\t\tthrow new ClientError({\n\t\t\tkind: ClientErrorKind.Configuration,\n\t\t\tcode: \"basic_auth.authorization_header.username_contains_colon\",\n\t\t\tmessage: \"A Basic authentication username cannot contain a colon.\",\n\t\t\tsource: \"basic_auth\",\n\t\t});\n\t}\n\n\treturn `Basic ${encodeUint8ArrayToBase64(\n\t\tnew TextEncoder().encode(`${options.username}:${options.password}`),\n\t)}`;\n}\n","import { type as defineType } from \"arktype\";\n\nexport const BasicAuthZoneConfigSchema = defineType({\n\tzonePrefix: \"string > 0\",\n\t\"loginSubpath?\": \"string\",\n});\n\nexport const BasicAuthContextClientConfigSchema = defineType({\n\t\"id?\": \"string > 0\",\n\tbaseUrl: \"string > 0\",\n\tzones: BasicAuthZoneConfigSchema.array().atLeastLength(1),\n\t\"probePath?\": \"string > 0\",\n\t\"autoStart?\": \"boolean\",\n\t\"tracing?\": {\n\t\t\"target?\": \"string > 0\",\n\t\t\"prefix?\": \"string > 0\",\n\t},\n});\n","import { SecuritydeptInjectionToken } from \"@securitydept/client\";\nimport { type BasicAuthContextClient } from \"./client\";\nimport { type BasicAuthContextClientConfig } from \"./types\";\n\nexport const BASIC_AUTH_CONTEXT_CLIENT =\n\tnew SecuritydeptInjectionToken<BasicAuthContextClient>(\n\t\t\"BASIC_AUTH_CONTEXT_CLIENT\",\n\t);\n\nexport const BASIC_AUTH_CONTEXT_CLIENT_CONFIG =\n\tnew SecuritydeptInjectionToken<BasicAuthContextClientConfig>(\n\t\t\"BASIC_AUTH_CONTEXT_CLIENT_CONFIG\",\n\t);\n","// --- Basic Auth Context Client types ---\n\nimport {\n\ttype CancellationTokenOptions,\n\ttype ErrorSummary,\n\ttype ReadableSignalTrait,\n\ttype ResourceSnapshot,\n\ttype ResourceTrait,\n} from \"@securitydept/client\";\n\n/** Configuration for a single Basic Auth zone. */\nexport const BasicAuthContextErrorCode = {\n\tOperationFailed: \"basic_auth.operation_failed\",\n\tInvalidConfig: \"basic_auth.invalid_config\",\n\tClientDisposed: \"basic_auth.client_disposed\",\n\tRouterUnavailable: \"basic_auth.router_unavailable\",\n\tProbePathRequired: \"basic_auth.probe_path_required\",\n\tZoneNotFound: \"basic_auth.zone_not_found\",\n\tZoneRequired: \"basic_auth.zone_required\",\n} as const;\n\nexport type BasicAuthContextErrorCode =\n\t(typeof BasicAuthContextErrorCode)[keyof typeof BasicAuthContextErrorCode];\n\nexport interface BasicAuthZoneConfig {\n\t/** URL path prefix for this zone (e.g. \"/basic\"). */\n\tzonePrefix: string;\n\t/** Login subpath relative to zone prefix (default: \"/login\"). */\n\tloginSubpath?: string;\n}\n\n/** Configuration for the Basic Auth Context Client. */\nexport interface BasicAuthContextClientConfig {\n\tid?: string;\n\t/** Base URL of the SecurityDept server. */\n\tbaseUrl: string;\n\t/** One or more Basic Auth zones to manage. */\n\tzones: BasicAuthZoneConfig[];\n\t/** Protected endpoint used by start()/refresh() to observe the boundary. */\n\tprobePath?: string;\n\tautoStart?: boolean;\n\ttracing?: BasicAuthContextClientTracingOptions;\n}\n\nexport interface BasicAuthContextClientTracingOptions {\n\ttarget?: string;\n\tprefix?: string;\n}\n\nexport interface ResolvedBasicAuthContextClientConfig {\n\tid: string;\n\tbaseUrl: string;\n\tzones: readonly ResolvedBasicAuthZone[];\n\tprobePath?: string;\n\ttracing: Required<BasicAuthContextClientTracingOptions>;\n}\n\nexport const BasicAuthBoundaryKind = {\n\tAuthenticated: \"authenticated\",\n\tChallenge: \"challenge\",\n\tUnauthorized: \"unauthorized\",\n} as const;\n\nexport type BasicAuthBoundaryKind =\n\t(typeof BasicAuthBoundaryKind)[keyof typeof BasicAuthBoundaryKind];\n\nexport interface BasicAuthBoundaryObservation {\n\tstatus: number;\n\tchallengeHeader?: string | null;\n\trequestPath?: string;\n}\n\nexport interface BasicAuthBoundarySnapshot {\n\tauthenticated: boolean;\n\tboundaryKind: BasicAuthBoundaryKind;\n\tstatus: number;\n\tpath: string;\n\tchallengeHeader: string | null;\n\tzone?: ResolvedBasicAuthZone;\n}\n\nexport const BasicAuthContextSource = {\n\tBasicAuthContext: \"basic-auth-context\",\n} as const;\n\nexport type BasicAuthContextSource =\n\t(typeof BasicAuthContextSource)[keyof typeof BasicAuthContextSource];\n\nexport const BasicAuthContextEventType = {\n\tBoundaryRefreshStarted: \"basic_auth.boundary.refresh.started\",\n\tBoundaryRefreshSucceeded: \"basic_auth.boundary.refresh.succeeded\",\n\tBoundaryRefreshFailed: \"basic_auth.boundary.refresh.failed\",\n\t/** These logout events describe local boundary-projection clearing only. */\n\tLogoutStarted: \"basic_auth.logout.started\",\n\tLogoutSucceeded: \"basic_auth.logout.succeeded\",\n\tLogoutFailed: \"basic_auth.logout.failed\",\n\tLoginRedirectStarted: \"basic_auth.login.redirect.started\",\n\tLoginRedirectSucceeded: \"basic_auth.login.redirect.succeeded\",\n\tLoginRedirectFailed: \"basic_auth.login.redirect.failed\",\n} as const;\n\nexport type BasicAuthContextEventType =\n\t(typeof BasicAuthContextEventType)[keyof typeof BasicAuthContextEventType];\n\nexport interface BasicAuthContextEvent {\n\ttype: BasicAuthContextEventType;\n\tat: number;\n\tclient: {\n\t\tid: string;\n\t};\n\tsnapshot?: BasicAuthBoundarySnapshot | null;\n\tzone?: ResolvedBasicAuthZone;\n\terrorSummary?: ErrorSummary;\n}\n\nexport interface BasicAuthContextOperationSignals {\n\treadonly startPending: ReadableSignalTrait<boolean>;\n\treadonly refreshPending: ReadableSignalTrait<boolean>;\n\treadonly logoutPending: ReadableSignalTrait<boolean>;\n\treadonly loginRedirectPending: ReadableSignalTrait<boolean>;\n}\n\nexport interface BasicAuthRefreshOptions extends CancellationTokenOptions {\n\tpath?: string;\n}\n\nexport type BasicAuthZoneSelectionOptions =\n\t| {\n\t\t\tcurrentPath: string;\n\t\t\tzonePrefix?: never;\n\t }\n\t| {\n\t\t\tzonePrefix: string;\n\t\t\tcurrentPath?: never;\n\t };\n\n/** Options for clearing the client's in-memory boundary projection. */\nexport interface BasicAuthLogoutOptions extends CancellationTokenOptions {}\n\nexport type BasicAuthLoginWithRedirectOptions = BasicAuthZoneSelectionOptions &\n\tCancellationTokenOptions & {\n\t\tpostAuthRedirectUri?: string;\n\t};\n\nexport const AuthGuardResultKind = {\n\tOk: \"ok\",\n\tRedirect: \"redirect\",\n} as const;\n\nexport type AuthGuardResultKind =\n\t(typeof AuthGuardResultKind)[keyof typeof AuthGuardResultKind];\n\nexport const AuthGuardRedirectStatus = {\n\tFound: 302,\n\tSeeOther: 303,\n\tTemporaryRedirect: 307,\n} as const;\n\nexport type AuthGuardRedirectStatus =\n\t(typeof AuthGuardRedirectStatus)[keyof typeof AuthGuardRedirectStatus];\n\n/** Redirect instruction — framework-neutral result. */\nexport type AuthGuardResult<T> =\n\t| { kind: typeof AuthGuardResultKind.Ok; value: T }\n\t| {\n\t\t\tkind: typeof AuthGuardResultKind.Redirect;\n\t\t\tstatus: AuthGuardRedirectStatus;\n\t\t\tlocation: string;\n\t };\n\n/** Resolved zone with computed paths. */\nexport interface ResolvedBasicAuthZone {\n\tzonePrefix: string;\n\tloginPath: string;\n}\n\nexport interface BasicAuthContextClientStateSignals {\n\treadonly boundarySnapshot: ReadableSignalTrait<\n\t\tResourceSnapshot<BasicAuthBoundarySnapshot | null>\n\t>;\n\treadonly boundaryResource: ResourceTrait<BasicAuthBoundarySnapshot | null>;\n\treadonly isAuthenticated: ResourceTrait<boolean>;\n}\n","import {\n\ttype CancellationTokenSourceTrait,\n\ttype CancellationTokenTrait,\n\tClientError,\n\tClientErrorKind,\n\tcreateCancellationTokenSource,\n\tcreateLinkedCancellationToken,\n\tcreateOnceAsyncLockCallable,\n\tcreateSignal,\n\ttype DisposableTrait,\n\tdefineInstrumentMethodDecorator,\n\tdescribeError,\n\tENVIRONMENT_TOKEN,\n\ttype EventStreamTrait,\n\ttype FoundationEnvironment,\n\tinjectDisposableStackFrom,\n\tmapResource,\n\ttype OperationSpanTrait,\n\ttype ReadableSignalTrait,\n\ttype ResourceSnapshot,\n\tResourceSnapshotUpdateKind,\n\tResourceStatus,\n\ttype ResourceTrait,\n\tRouterNavigationIntent,\n\tRouterNavigationMode,\n\treadonlySignal,\n\treduceResourceSnapshot,\n\tresourceFromSnapshots,\n\tSecuritydeptDestroyRef,\n\ttype SecuritydeptInjectorTrait,\n\ttype SpanTrait,\n\tSYMBOL_DISPOSE,\n\tthrowValidationClientError,\n\tUriReferenceString,\n\tvalidateTraitInput,\n\ttype WritableSignalTrait,\n\twithDisposableStack,\n} from \"@securitydept/client\";\nimport {\n\ttype Command,\n\ttype CommandResponse,\n\tcommandResponseData,\n\tconcatCommand,\n\tdispatchCommandLocallyToStream,\n\tRxEventReplaySubject,\n\tRxEventSubject,\n\tRxStateSignal,\n} from \"@securitydept/client/rx\";\nimport { filter, from, lastValueFrom, take, takeUntil } from \"rxjs\";\nimport { v7 as uuidv7 } from \"uuid\";\nimport { BasicAuthContextClientConfigSchema } from \"./schemas\";\nimport { BASIC_AUTH_CONTEXT_CLIENT_CONFIG } from \"./tokens\";\nimport {\n\tAuthGuardRedirectStatus,\n\ttype AuthGuardResult,\n\tAuthGuardResultKind,\n\ttype BasicAuthBoundaryKind,\n\tBasicAuthBoundaryKind as BasicAuthBoundaryKindValues,\n\ttype BasicAuthBoundaryObservation,\n\ttype BasicAuthBoundarySnapshot,\n\ttype BasicAuthContextClientConfig,\n\tBasicAuthContextErrorCode,\n\ttype BasicAuthContextEvent,\n\tBasicAuthContextEventType,\n\ttype BasicAuthContextOperationSignals,\n\tBasicAuthContextSource,\n\ttype BasicAuthLoginWithRedirectOptions,\n\ttype BasicAuthLogoutOptions,\n\ttype BasicAuthRefreshOptions,\n\ttype BasicAuthZoneConfig,\n\ttype BasicAuthZoneSelectionOptions,\n\ttype ResolvedBasicAuthContextClientConfig,\n\ttype ResolvedBasicAuthZone,\n} from \"./types\";\n\nconst DEFAULT_LOGIN_SUBPATH = \"/login\";\nconst POST_AUTH_REDIRECT_PARAM = \"post_auth_redirect_uri\";\n\ninterface BasicAuthCommandExtra {\n\tcancellationToken: CancellationTokenTrait;\n\toperationSpan?: OperationSpanTrait;\n}\n\ntype ResolvedBasicAuthRefreshOptions = { path: string };\n\ntype BasicAuthRefreshCommand = Command<\n\tResolvedBasicAuthRefreshOptions,\n\tBasicAuthCommandExtra\n>;\n\nconst instrumentBasicAuthMethod = defineInstrumentMethodDecorator<\n\t[operation: string],\n\tBasicAuthContextClient\n>(\n\t({ factoryArgs: [operation] }) =>\n\t\tfunction (this: BasicAuthContextClient) {\n\t\t\treturn {\n\t\t\t\tenvironment: this.environment,\n\t\t\t\tspan: this.span,\n\t\t\t\tname: `${this.config.tracing.prefix}.${operation}`,\n\t\t\t\ttarget: this.config.tracing.target,\n\t\t\t\tfields: { operation },\n\t\t\t\tnormalizeError: (error: unknown) =>\n\t\t\t\t\tClientError.fromUnknown(error, {\n\t\t\t\t\t\tcode: BasicAuthContextErrorCode.OperationFailed,\n\t\t\t\t\t\tmessage: \"The Basic Auth operation failed unexpectedly\",\n\t\t\t\t\t\tsource: BasicAuthContextSource.BasicAuthContext,\n\t\t\t\t\t}),\n\t\t\t};\n\t\t},\n);\n\nfunction resolveZone(config: BasicAuthZoneConfig): ResolvedBasicAuthZone {\n\tconst prefix = config.zonePrefix.replace(/\\/+$/, \"\");\n\tconst loginSub = config.loginSubpath ?? DEFAULT_LOGIN_SUBPATH;\n\n\treturn {\n\t\tzonePrefix: prefix,\n\t\tloginPath: prefix + loginSub,\n\t};\n}\n\nexport function readBasicAuthBoundaryKind(\n\toptions: BasicAuthBoundaryObservation,\n): BasicAuthBoundaryKind {\n\tif (options.status < 400) {\n\t\treturn BasicAuthBoundaryKindValues.Authenticated;\n\t}\n\n\tif (options.challengeHeader) {\n\t\treturn BasicAuthBoundaryKindValues.Challenge;\n\t}\n\n\treturn BasicAuthBoundaryKindValues.Unauthorized;\n}\n\n/**\n * Basic Auth Context Client.\n *\n * Owns zone-aware Basic Auth boundary observations and login navigation.\n * It does not manage browser credentials or principal data.\n */\nexport class BasicAuthContextClient implements DisposableTrait {\n\tstatic defaultOptions = {\n\t\tloginSubpath: DEFAULT_LOGIN_SUBPATH,\n\t\ttracing: {\n\t\t\ttarget: \"basic-auth-context-client\",\n\t\t\tprefix: \"basic_auth_context\",\n\t\t},\n\t} as const;\n\n\tprivate readonly _environment: FoundationEnvironment;\n\tprivate readonly _config: ResolvedBasicAuthContextClientConfig;\n\tprivate readonly _span: SpanTrait;\n\tprivate readonly _rootCancellation: CancellationTokenSourceTrait =\n\t\tcreateCancellationTokenSource();\n\tprivate readonly _destroyed = RxStateSignal.fromInitialValue(false);\n\tprivate readonly destroyed$ = from(this._destroyed).pipe(\n\t\tfilter((value): value is true => value),\n\t\ttake(1),\n\t);\n\tprivate readonly _boundarySnapshotSignal = RxStateSignal.fromInitialValue<\n\t\tResourceSnapshot<BasicAuthBoundarySnapshot | null>\n\t>({ status: ResourceStatus.Idle });\n\tprivate readonly _operationSignals: {\n\t\treadonly startPending: WritableSignalTrait<boolean>;\n\t\treadonly refreshPending: WritableSignalTrait<boolean>;\n\t\treadonly logoutPending: WritableSignalTrait<boolean>;\n\t\treadonly loginRedirectPending: WritableSignalTrait<boolean>;\n\t} = {\n\t\tstartPending: createSignal(false),\n\t\trefreshPending: createSignal(false),\n\t\tlogoutPending: createSignal(false),\n\t\tloginRedirectPending: createSignal(false),\n\t};\n\tprivate readonly _eventSubject =\n\t\tnew RxEventReplaySubject<BasicAuthContextEvent>(100);\n\tprivate readonly _refreshCommandSubject =\n\t\tnew RxEventSubject<BasicAuthRefreshCommand>();\n\tprivate readonly _refreshResponseSubject = new RxEventSubject<\n\t\tCommandResponse<BasicAuthRefreshCommand, BasicAuthBoundarySnapshot>\n\t>();\n\tprivate readonly _startOnce = createOnceAsyncLockCallable(\n\t\tasync (\n\t\t\tcancellationToken: CancellationTokenTrait,\n\t\t\toperationSpan?: OperationSpanTrait,\n\t\t) => {\n\t\t\tcancellationToken.throwIfCancellationRequested();\n\t\t\tthis._operationSignals.startPending.set(true);\n\t\t\ttry {\n\t\t\t\treturn await this._dispatchRefresh(\n\t\t\t\t\tthis._resolveRefreshOptions({}),\n\t\t\t\t\tcancellationToken,\n\t\t\t\t\toperationSpan,\n\t\t\t\t);\n\t\t\t} finally {\n\t\t\t\tthis._operationSignals.startPending.set(false);\n\t\t\t}\n\t\t},\n\t);\n\n\treadonly id: string;\n\treadonly zones: readonly ResolvedBasicAuthZone[];\n\treadonly boundarySnapshot: ReadableSignalTrait<\n\t\tResourceSnapshot<BasicAuthBoundarySnapshot | null>\n\t>;\n\treadonly boundaryResource: ResourceTrait<BasicAuthBoundarySnapshot | null>;\n\treadonly isAuthenticated: ResourceTrait<boolean>;\n\treadonly operations: BasicAuthContextOperationSignals;\n\treadonly events: EventStreamTrait<BasicAuthContextEvent>;\n\n\tprotected get environment(): FoundationEnvironment {\n\t\treturn this._environment;\n\t}\n\n\tprotected get span(): SpanTrait {\n\t\treturn this._span;\n\t}\n\n\tprotected get config(): ResolvedBasicAuthContextClientConfig {\n\t\treturn this._config;\n\t}\n\n\tstatic fromEnvironmentConfig(options: {\n\t\treadonly config: BasicAuthContextClientConfig;\n\t\treadonly environment: FoundationEnvironment;\n\t}): BasicAuthContextClient {\n\t\treturn new BasicAuthContextClient(options.config, options.environment);\n\t}\n\n\tstatic fromInjector(\n\t\tinjector: SecuritydeptInjectorTrait,\n\t): BasicAuthContextClient {\n\t\tconst client = BasicAuthContextClient.fromEnvironmentConfig({\n\t\t\tconfig: injector.get(BASIC_AUTH_CONTEXT_CLIENT_CONFIG),\n\t\t\tenvironment: injector.get(ENVIRONMENT_TOKEN),\n\t\t});\n\t\tinjector\n\t\t\t.get(SecuritydeptDestroyRef, null)\n\t\t\t?.onDestroy(() => client.dispose());\n\t\treturn client;\n\t}\n\n\tprotected constructor(\n\t\tconfig: BasicAuthContextClientConfig,\n\t\tenvironment: FoundationEnvironment,\n\t) {\n\t\tvalidateTraitInput({\n\t\t\tvalue: config,\n\t\t\tbundledSchema: BasicAuthContextClientConfigSchema,\n\t\t\tonInvalid: (failure) =>\n\t\t\t\tthrowValidationClientError({\n\t\t\t\t\tcode: BasicAuthContextErrorCode.InvalidConfig,\n\t\t\t\t\tsource: BasicAuthContextSource.BasicAuthContext,\n\t\t\t\t\tmessagePrefix: \"BasicAuthContextClient could not validate config\",\n\t\t\t\t\tfailure,\n\t\t\t\t}),\n\t\t});\n\t\tconst resolvedConfig: ResolvedBasicAuthContextClientConfig = {\n\t\t\tid: config.id ?? uuidv7(),\n\t\t\tbaseUrl: (config.baseUrl ?? \"\").replace(/\\/+$/, \"\"),\n\t\t\tzones: (config.zones ?? []).map(resolveZone),\n\t\t\tprobePath: config.probePath,\n\t\t\ttracing: {\n\t\t\t\ttarget:\n\t\t\t\t\tconfig.tracing?.target ??\n\t\t\t\t\tBasicAuthContextClient.defaultOptions.tracing.target,\n\t\t\t\tprefix:\n\t\t\t\t\tconfig.tracing?.prefix ??\n\t\t\t\t\tBasicAuthContextClient.defaultOptions.tracing.prefix,\n\t\t\t},\n\t\t};\n\n\t\tthis._environment = environment;\n\t\tthis._config = resolvedConfig;\n\t\tthis.id = resolvedConfig.id;\n\t\tthis.zones = resolvedConfig.zones;\n\t\tthis._span = environment.span.fork({\n\t\t\tattributes: {\n\t\t\t\tclientName: this.constructor.name,\n\t\t\t\tid: this.id,\n\t\t\t},\n\t\t});\n\t\tthis.boundarySnapshot = readonlySignal(this._boundarySnapshotSignal);\n\t\tthis.boundaryResource = resourceFromSnapshots(() =>\n\t\t\tthis._boundarySnapshotSignal.get(),\n\t\t);\n\t\tthis.isAuthenticated = mapResource(\n\t\t\tthis.boundaryResource,\n\t\t\t(snapshot) => snapshot?.authenticated === true,\n\t\t);\n\t\tthis.operations = {\n\t\t\tstartPending: readonlySignal(this._operationSignals.startPending),\n\t\t\trefreshPending: readonlySignal(this._operationSignals.refreshPending),\n\t\t\tlogoutPending: readonlySignal(this._operationSignals.logoutPending),\n\t\t\tloginRedirectPending: readonlySignal(\n\t\t\t\tthis._operationSignals.loginRedirectPending,\n\t\t\t),\n\t\t};\n\t\tthis.events = this._eventSubject;\n\t\tthis.destroyed$.subscribe(() => {\n\t\t\tthis._rootCancellation.cancel(\n\t\t\t\tnew ClientError({\n\t\t\t\t\tkind: ClientErrorKind.Cancelled,\n\t\t\t\t\tcode: BasicAuthContextErrorCode.ClientDisposed,\n\t\t\t\t\tmessage: \"BasicAuthContextClient has been disposed.\",\n\t\t\t\t\tsource: BasicAuthContextSource.BasicAuthContext,\n\t\t\t\t}),\n\t\t\t);\n\t\t\tthis.isAuthenticated.dispose();\n\t\t\tthis.boundaryResource.dispose();\n\t\t});\n\n\t\tfrom(this._refreshCommandSubject)\n\t\t\t.pipe(\n\t\t\t\ttakeUntil(this.destroyed$),\n\t\t\t\tconcatCommand((command) =>\n\t\t\t\t\tthis._executeRefresh(\n\t\t\t\t\t\tcommand.payload,\n\t\t\t\t\t\tcommand.cancellationToken,\n\t\t\t\t\t\tcommand.operationSpan,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t\t.subscribe(this._refreshResponseSubject);\n\n\t\tif (config.autoStart === true) {\n\t\t\tthis.start().catch(() => {\n\t\t\t\t// Startup failure is reflected by boundarySnapshot.\n\t\t\t});\n\t\t}\n\t}\n\n\tasync start(): Promise<BasicAuthBoundarySnapshot> {\n\t\tconst cancellationToken = this._rootCancellation.token;\n\t\treturn await this._start(cancellationToken);\n\t}\n\n\t@instrumentBasicAuthMethod(\"start\")\n\tprivate async _start(\n\t\tcancellationToken: CancellationTokenTrait,\n\t\toperationSpan?: OperationSpanTrait,\n\t): Promise<BasicAuthBoundarySnapshot> {\n\t\treturn await this._startOnce(cancellationToken, operationSpan);\n\t}\n\n\t@withDisposableStack(0, true)\n\tasync refresh(\n\t\toptions: BasicAuthRefreshOptions = {},\n\t): Promise<BasicAuthBoundarySnapshot> {\n\t\tconst disposableStack = injectDisposableStackFrom(options, true);\n\t\tconst cancellationToken = createLinkedCancellationToken(\n\t\t\tthis._rootCancellation.token,\n\t\t\toptions.cancellationToken,\n\t\t);\n\t\tdisposableStack?.use(cancellationToken);\n\t\treturn await this._refresh(options, cancellationToken);\n\t}\n\n\t@instrumentBasicAuthMethod(\"refresh\")\n\tprivate async _refresh(\n\t\toptions: BasicAuthRefreshOptions,\n\t\tcancellationToken: CancellationTokenTrait,\n\t\toperationSpan?: OperationSpanTrait,\n\t): Promise<BasicAuthBoundarySnapshot> {\n\t\tcancellationToken.throwIfCancellationRequested();\n\t\treturn await this._dispatchRefresh(\n\t\t\tthis._resolveRefreshOptions(options),\n\t\t\tcancellationToken,\n\t\t\toperationSpan,\n\t\t);\n\t}\n\n\t/**\n\t * Clears only this client's in-memory Basic Auth boundary projection.\n\t *\n\t * Browsers own HTTP Basic credentials. This method cannot revoke or clear\n\t * those credentials, and a later probe may observe an authenticated state\n\t * again when the browser continues sending them.\n\t */\n\t@withDisposableStack(0, true)\n\tasync logout(options: BasicAuthLogoutOptions = {}): Promise<void> {\n\t\tconst disposableStack = injectDisposableStackFrom(options, true);\n\t\tconst cancellationToken = createLinkedCancellationToken(\n\t\t\tthis._rootCancellation.token,\n\t\t\toptions.cancellationToken,\n\t\t);\n\t\tdisposableStack?.use(cancellationToken);\n\t\treturn await this._logout(options, cancellationToken);\n\t}\n\n\t@instrumentBasicAuthMethod(\"logout\")\n\tprivate async _logout(\n\t\t_options: BasicAuthLogoutOptions,\n\t\tcancellationToken: CancellationTokenTrait,\n\t\toperationSpan?: OperationSpanTrait,\n\t): Promise<void> {\n\t\tcancellationToken.throwIfCancellationRequested();\n\t\tthis._operationSignals.logoutPending.set(true);\n\t\tthis._emitEvent({\n\t\t\ttype: BasicAuthContextEventType.LogoutStarted,\n\t\t\tsnapshot: this._readCurrentSnapshot(),\n\t\t});\n\t\ttry {\n\t\t\tcancellationToken.throwIfCancellationRequested();\n\t\t\tthis._boundarySnapshotSignal.set({\n\t\t\t\tstatus: ResourceStatus.Resolved,\n\t\t\t\tvalue: null,\n\t\t\t});\n\t\t\toperationSpan?.setAttributes({ localProjectionCleared: true });\n\t\t\tthis._emitEvent({\n\t\t\t\ttype: BasicAuthContextEventType.LogoutSucceeded,\n\t\t\t\tsnapshot: null,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tthis._emitEvent({\n\t\t\t\ttype: BasicAuthContextEventType.LogoutFailed,\n\t\t\t\tsnapshot: this._readCurrentSnapshot(),\n\t\t\t\terrorSummary: describeError(error),\n\t\t\t});\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tthis._operationSignals.logoutPending.set(false);\n\t\t}\n\t}\n\n\t@withDisposableStack(0, true)\n\tasync loginWithRedirect(\n\t\toptions: BasicAuthLoginWithRedirectOptions,\n\t): Promise<void> {\n\t\tconst disposableStack = injectDisposableStackFrom(options, true);\n\t\tconst cancellationToken = createLinkedCancellationToken(\n\t\t\tthis._rootCancellation.token,\n\t\t\toptions.cancellationToken,\n\t\t);\n\t\tdisposableStack?.use(cancellationToken);\n\t\tawait this._loginWithRedirect(options, cancellationToken);\n\t}\n\n\t@instrumentBasicAuthMethod(\"login.redirect\")\n\tprivate async _loginWithRedirect(\n\t\toptions: BasicAuthLoginWithRedirectOptions,\n\t\tcancellationToken: CancellationTokenTrait,\n\t\t_operationSpan?: OperationSpanTrait,\n\t): Promise<void> {\n\t\tcancellationToken.throwIfCancellationRequested();\n\t\tconst router = this._environment.router;\n\t\tif (!router) {\n\t\t\tthrow new ClientError({\n\t\t\t\tkind: ClientErrorKind.Configuration,\n\t\t\t\tcode: BasicAuthContextErrorCode.RouterUnavailable,\n\t\t\t\tmessage: \"loginWithRedirect() requires environment.router.\",\n\t\t\t\tsource: BasicAuthContextSource.BasicAuthContext,\n\t\t\t});\n\t\t}\n\t\tconst zone = this._resolveZoneForAction(options, \"login redirect\");\n\t\tconst postAuthRedirectUri =\n\t\t\toptions.postAuthRedirectUri ?? options.currentPath;\n\n\t\tthis._operationSignals.loginRedirectPending.set(true);\n\t\tthis._emitEvent({\n\t\t\ttype: BasicAuthContextEventType.LoginRedirectStarted,\n\t\t\tzone,\n\t\t});\n\t\ttry {\n\t\t\tawait router.navigate({\n\t\t\t\turl: UriReferenceString.parse(this.loginUrl(zone, postAuthRedirectUri)),\n\t\t\t\tintent: RouterNavigationIntent.AuthRedirect,\n\t\t\t\tmode: RouterNavigationMode.External,\n\t\t\t});\n\t\t\tcancellationToken.throwIfCancellationRequested();\n\t\t\tthis._emitEvent({\n\t\t\t\ttype: BasicAuthContextEventType.LoginRedirectSucceeded,\n\t\t\t\tzone,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tthis._emitEvent({\n\t\t\t\ttype: BasicAuthContextEventType.LoginRedirectFailed,\n\t\t\t\tzone,\n\t\t\t\terrorSummary: describeError(error),\n\t\t\t});\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tthis._operationSignals.loginRedirectPending.set(false);\n\t\t}\n\t}\n\n\t/** Find the zone that contains the given path. */\n\tzoneForPath(path: string): ResolvedBasicAuthZone | undefined {\n\t\tlet matchedZone: ResolvedBasicAuthZone | undefined;\n\n\t\tfor (const zone of this.zones) {\n\t\t\tconst matches =\n\t\t\t\tpath === zone.zonePrefix || path.startsWith(`${zone.zonePrefix}/`);\n\t\t\tif (!matches) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!matchedZone ||\n\t\t\t\tzone.zonePrefix.length > matchedZone.zonePrefix.length\n\t\t\t) {\n\t\t\t\tmatchedZone = zone;\n\t\t\t}\n\t\t}\n\n\t\treturn matchedZone;\n\t}\n\n\tzoneForPrefix(zonePrefix: string): ResolvedBasicAuthZone | undefined {\n\t\treturn this.zones.find((zone) => zone.zonePrefix === zonePrefix);\n\t}\n\n\t/** Check whether a path falls inside any configured zone. */\n\tisInZone(path: string): boolean {\n\t\treturn this.zoneForPath(path) !== undefined;\n\t}\n\n\t/** Build the full login URL for a zone, optionally with a post-auth redirect. */\n\tloginUrl(zone: ResolvedBasicAuthZone, postAuthRedirectUri?: string): string {\n\t\tconst base = this._config.baseUrl + zone.loginPath;\n\t\tif (postAuthRedirectUri) {\n\t\t\tconst params = new URLSearchParams({\n\t\t\t\t[POST_AUTH_REDIRECT_PARAM]: postAuthRedirectUri,\n\t\t\t});\n\t\t\treturn `${base}?${params.toString()}`;\n\t\t}\n\t\treturn base;\n\t}\n\n\tloginUrlForZonePrefix(\n\t\tzonePrefix: string,\n\t\tpostAuthRedirectUri?: string,\n\t): string | null {\n\t\tconst zone = this.zoneForPrefix(zonePrefix);\n\t\treturn zone ? this.loginUrl(zone, postAuthRedirectUri) : null;\n\t}\n\n\t/**\n\t * Handle a 401 response: if the current path is inside a zone,\n\t * return a redirect instruction to the zone's login URL.\n\t */\n\thandleUnauthorized(\n\t\tcurrentPath: string,\n\t\tresponseStatus: number,\n\t): AuthGuardResult<null> {\n\t\tif (responseStatus !== 401) {\n\t\t\treturn { kind: AuthGuardResultKind.Ok, value: null };\n\t\t}\n\n\t\tconst zone = this.zoneForPath(currentPath);\n\t\tif (!zone) {\n\t\t\treturn { kind: AuthGuardResultKind.Ok, value: null };\n\t\t}\n\n\t\treturn {\n\t\t\tkind: AuthGuardResultKind.Redirect,\n\t\t\tstatus: AuthGuardRedirectStatus.Found,\n\t\t\tlocation: this.loginUrl(zone, currentPath),\n\t\t};\n\t}\n\n\tdispose(): void {\n\t\tthis._destroyed.set(true);\n\t}\n\n\t[SYMBOL_DISPOSE](): void {\n\t\tthis.dispose();\n\t}\n\n\tprivate _resolveRefreshOptions(\n\t\toptions: BasicAuthRefreshOptions,\n\t): ResolvedBasicAuthRefreshOptions {\n\t\tconst path = options.path ?? this._config.probePath;\n\t\tif (!path) {\n\t\t\tthrow new ClientError({\n\t\t\t\tkind: ClientErrorKind.Configuration,\n\t\t\t\tcode: BasicAuthContextErrorCode.ProbePathRequired,\n\t\t\t\tmessage:\n\t\t\t\t\t\"BasicAuthContextClient.refresh() requires options.path or config.probePath.\",\n\t\t\t\tsource: BasicAuthContextSource.BasicAuthContext,\n\t\t\t});\n\t\t}\n\t\treturn { path };\n\t}\n\n\tprivate _resolveZoneForAction(\n\t\toptions: BasicAuthZoneSelectionOptions,\n\t\taction: string,\n\t): ResolvedBasicAuthZone {\n\t\tif (options.zonePrefix) {\n\t\t\tconst zone = this.zoneForPrefix(options.zonePrefix);\n\t\t\tif (zone) {\n\t\t\t\treturn zone;\n\t\t\t}\n\t\t\tthrow new ClientError({\n\t\t\t\tkind: ClientErrorKind.Configuration,\n\t\t\t\tcode: BasicAuthContextErrorCode.ZoneNotFound,\n\t\t\t\tmessage: `BasicAuthContextClient ${action} could not find zone \"${options.zonePrefix}\".`,\n\t\t\t\tsource: BasicAuthContextSource.BasicAuthContext,\n\t\t\t});\n\t\t}\n\n\t\tconst zone =\n\t\t\ttypeof options.currentPath === \"string\"\n\t\t\t\t? this.zoneForPath(options.currentPath)\n\t\t\t\t: undefined;\n\t\tif (zone) {\n\t\t\treturn zone;\n\t\t}\n\n\t\tthrow new ClientError({\n\t\t\tkind: ClientErrorKind.Configuration,\n\t\t\tcode: BasicAuthContextErrorCode.ZoneRequired,\n\t\t\tmessage: `BasicAuthContextClient ${action} requires options.currentPath inside a configured zone or options.zonePrefix.`,\n\t\t\tsource: BasicAuthContextSource.BasicAuthContext,\n\t\t});\n\t}\n\n\tprivate async _dispatchRefresh(\n\t\tpayload: ResolvedBasicAuthRefreshOptions,\n\t\tcancellationToken: CancellationTokenTrait,\n\t\toperationSpan?: OperationSpanTrait,\n\t): Promise<BasicAuthBoundarySnapshot> {\n\t\tcancellationToken.throwIfCancellationRequested();\n\t\tconst snapshot = await lastValueFrom(\n\t\t\tdispatchCommandLocallyToStream<\n\t\t\t\tResolvedBasicAuthRefreshOptions,\n\t\t\t\tBasicAuthCommandExtra,\n\t\t\t\tBasicAuthBoundarySnapshot,\n\t\t\t\tBasicAuthRefreshCommand\n\t\t\t>({\n\t\t\t\tpayload,\n\t\t\t\trequestStream: this._refreshCommandSubject,\n\t\t\t\tresponseStream: this._refreshResponseSubject,\n\t\t\t\tcreateCommandExtra: () => ({ cancellationToken, operationSpan }),\n\t\t\t}).pipe(commandResponseData()),\n\t\t);\n\t\tcancellationToken.throwIfCancellationRequested();\n\t\treturn snapshot;\n\t}\n\n\tprivate async _executeRefresh(\n\t\toptions: ResolvedBasicAuthRefreshOptions,\n\t\tcancellationToken: CancellationTokenTrait,\n\t\toperationSpan?: OperationSpanTrait,\n\t): Promise<BasicAuthBoundarySnapshot> {\n\t\tcancellationToken.throwIfCancellationRequested();\n\t\tthis._operationSignals.refreshPending.set(true);\n\t\tconst previous = this._boundarySnapshotSignal.get();\n\t\tconst loadingSnapshot = reduceResourceSnapshot(previous, {\n\t\t\tkind: ResourceSnapshotUpdateKind.Load,\n\t\t});\n\t\tthis._boundarySnapshotSignal.set(loadingSnapshot);\n\t\tthis._emitEvent({\n\t\t\ttype: BasicAuthContextEventType.BoundaryRefreshStarted,\n\t\t\tsnapshot: this._readCurrentSnapshot(),\n\t\t});\n\t\ttry {\n\t\t\tconst response = await this._environment.transport.execute({\n\t\t\t\turl: this._config.baseUrl + options.path,\n\t\t\t\tmethod: \"GET\",\n\t\t\t\theaders: { accept: \"application/json\" },\n\t\t\t\tcancellationToken,\n\t\t\t});\n\t\t\tif (\n\t\t\t\tresponse.status >= 400 &&\n\t\t\t\tresponse.status !== 401 &&\n\t\t\t\tresponse.status !== 403\n\t\t\t) {\n\t\t\t\tthrow ClientError.fromHttpResponse({\n\t\t\t\t\tstatus: response.status,\n\t\t\t\t\tbody: response.body,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tcancellationToken.throwIfCancellationRequested();\n\t\t\tconst snapshot = this._snapshotFromResponse(options.path, response);\n\t\t\tthis._boundarySnapshotSignal.set(\n\t\t\t\treduceResourceSnapshot(loadingSnapshot, {\n\t\t\t\t\tkind: ResourceSnapshotUpdateKind.Resolve,\n\t\t\t\t\tvalue: snapshot,\n\t\t\t\t}),\n\t\t\t);\n\t\t\toperationSpan?.setAttributes({\n\t\t\t\tauthenticated: snapshot.authenticated,\n\t\t\t\tboundaryKind: snapshot.boundaryKind,\n\t\t\t});\n\t\t\tthis._emitEvent({\n\t\t\t\ttype: BasicAuthContextEventType.BoundaryRefreshSucceeded,\n\t\t\t\tsnapshot,\n\t\t\t\tzone: snapshot.zone,\n\t\t\t});\n\t\t\treturn snapshot;\n\t\t} catch (error) {\n\t\t\tthis._boundarySnapshotSignal.set(\n\t\t\t\treduceResourceSnapshot(loadingSnapshot, {\n\t\t\t\t\tkind: ResourceSnapshotUpdateKind.Fail,\n\t\t\t\t\terror,\n\t\t\t\t}),\n\t\t\t);\n\t\t\tthis._emitEvent({\n\t\t\t\ttype: BasicAuthContextEventType.BoundaryRefreshFailed,\n\t\t\t\tsnapshot: this._readCurrentSnapshot(),\n\t\t\t\terrorSummary: describeError(error),\n\t\t\t});\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tthis._operationSignals.refreshPending.set(false);\n\t\t}\n\t}\n\n\tprivate _snapshotFromResponse(\n\t\tpath: string,\n\t\tresponse: { status: number; headers: Record<string, string> },\n\t): BasicAuthBoundarySnapshot {\n\t\tconst challengeHeader =\n\t\t\tresponse.headers[\"WWW-Authenticate\"] ??\n\t\t\tresponse.headers[\"www-authenticate\"] ??\n\t\t\tnull;\n\t\tconst zone = this.zoneForPath(path);\n\t\tconst boundaryKind = readBasicAuthBoundaryKind({\n\t\t\tstatus: response.status,\n\t\t\tchallengeHeader,\n\t\t\trequestPath: path,\n\t\t});\n\t\treturn {\n\t\t\tauthenticated: boundaryKind === BasicAuthBoundaryKindValues.Authenticated,\n\t\t\tboundaryKind,\n\t\t\tstatus: response.status,\n\t\t\tpath,\n\t\t\tchallengeHeader,\n\t\t\tzone,\n\t\t};\n\t}\n\n\tprivate _readCurrentSnapshot(): BasicAuthBoundarySnapshot | null {\n\t\tconst snapshot = this._boundarySnapshotSignal.get();\n\t\treturn snapshot.status === ResourceStatus.Reloading ||\n\t\t\tsnapshot.status === ResourceStatus.Resolved ||\n\t\t\tsnapshot.status === ResourceStatus.Error\n\t\t\t? snapshot.value\n\t\t\t: null;\n\t}\n\n\tprivate _emitEvent(\n\t\tinput: Omit<BasicAuthContextEvent, \"at\" | \"client\">,\n\t): void {\n\t\tthis._eventSubject.next({\n\t\t\t...input,\n\t\t\tat: this._environment.time.now(),\n\t\t\tclient: {\n\t\t\t\tid: this.id,\n\t\t\t},\n\t\t});\n\t}\n}\n","import {\n\tINJECTOR_TOKEN,\n\ttype SecuritydeptInjectorTrait,\n\ttype SecuritydeptProvider,\n} from \"@securitydept/client\";\nimport { BasicAuthContextClient } from \"./client\";\nimport {\n\tBASIC_AUTH_CONTEXT_CLIENT,\n\tBASIC_AUTH_CONTEXT_CLIENT_CONFIG,\n} from \"./tokens\";\nimport { type BasicAuthContextClientConfig } from \"./types\";\n\nexport interface ProvideBasicAuthContextOptions {\n\treadonly config: BasicAuthContextClientConfig;\n}\n\nexport function provideBasicAuthContext(\n\toptions: ProvideBasicAuthContextOptions,\n): readonly SecuritydeptProvider[] {\n\treturn [\n\t\t{\n\t\t\tprovide: BASIC_AUTH_CONTEXT_CLIENT_CONFIG,\n\t\t\tuseValue: options.config,\n\t\t},\n\t\t{\n\t\t\tprovide: BASIC_AUTH_CONTEXT_CLIENT,\n\t\t\tuseFactory: (injector: SecuritydeptInjectorTrait) =>\n\t\t\t\tBasicAuthContextClient.fromInjector(injector),\n\t\t\tdeps: [INJECTOR_TOKEN],\n\t\t},\n\t];\n}\n"],"mappings":";;;;;;AAWA,SAAgBG,oCACfC,SAAmD;CAEnD,IAAIA,QAAQC,SAASC,SAAS,GAAA,GAC7B,MAAM,IAAIN,YAAY;EACrBO,MAAMN,gBAAgBO;EACtBC,MAAM;EACNC,SAAS;EACTC,QAAQ;CACT,CAAA;CAGD,OAAO,SAAST,yBACf,IAAIU,YAAAA,CAAAA,CAAcC,OAAO,GAAGT,QAAQC,SAAS,GAAGD,QAAQU,UAAU,CAAA;AAEpE;;;ACxBA,MAAaG,4BAA4BD,KAAW;CACnDE,YAAY;CACZ,iBAAiB;AAClB,CAAA;AAEA,MAAaC,qCAAqCH,KAAW;CAC5D,OAAO;CACPI,SAAS;CACTC,OAAOJ,0BAA0BK,MAAK,CAAA,CAAGC,cAAc,CAAA;CACvD,cAAc;CACd,cAAc;CACd,YAAY;EACX,WAAW;EACX,WAAW;CACZ;AACD,CAAA;;;ACbA,MAAaE,4BACZ,IAAID,2BACH,2BAAA;AAGF,MAAaE,mCACZ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K;GACvB,GAAGD;GACHE,IAAI,KAAKrJ,aAAasJ,KAAKC,IAAG;GAC9BnH,QAAQ,EACPV,IAAI,KAAKA,GACV;EACD,CAAA;CACD;AACD;;;ACpuBA,SAAgBkI,wBACfC,SAAuC;CAEvC,OAAO,CACN;EACCC,SAASH;EACTI,UAAUF,QAAQG;CACnB,GACA;EACCF,SAASJ;EACTO,aAAaC,aACZT,uBAAuBU,aAAaD,QAAAA;EACrCE,MAAM,CAACZ,cAAe;CACvB,CACA;AACF"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["ClientError","ClientErrorKind","encodeUint8ArrayToBase64","createBasicAuthorizationHeaderValue","options","username","includes","kind","Configuration","code","message","source","TextEncoder","encode","password","ClientError","BasicAuthContextErrorCode","OperationFailed","InvalidConfig","ClientDisposed","RouterUnavailable","ProbePathRequired","ZoneNotFound","ZoneRequired","BasicAuthContextSource","BasicAuthContext","clientErrorFromBasicAuthError","error","options","fromUnknown","code","message","source","span","type","defineType","BasicAuthZoneConfigSchema","zonePrefix","BasicAuthContextClientConfigSchema","baseUrl","zones","array","atLeastLength","SecuritydeptInjectionToken","BASIC_AUTH_CONTEXT_CLIENT","BASIC_AUTH_CONTEXT_CLIENT_CONFIG","BasicAuthBoundaryKind","Authenticated","Challenge","Unauthorized","BasicAuthContextEventType","BoundaryRefreshStarted","BoundaryRefreshSucceeded","BoundaryRefreshFailed","LogoutStarted","LogoutSucceeded","LogoutFailed","LoginRedirectStarted","LoginRedirectSucceeded","LoginRedirectFailed","AuthGuardResultKind","Ok","Redirect","AuthGuardRedirectStatus","Found","SeeOther","TemporaryRedirect","ClientError","ClientErrorKind","createCancellationTokenSource","createLinkedCancellationToken","createOnceAsyncLockCallable","createSignal","defineInstrumentMethodDecorator","ENVIRONMENT_TOKEN","injectDisposableStackFrom","mapResource","ResourceSnapshotUpdateKind","ResourceStatus","RouterNavigationIntent","RouterNavigationMode","readonlySignal","reduceResourceSnapshot","resourceFromSnapshots","SecuritydeptDestroyRef","SpanSharedAttributeName","SYMBOL_DISPOSE","throwValidationClientError","UriReferenceString","validateTraitInput","withDisposableStack","commandResponseData","concatCommand","dispatchCommandLocallyToStream","RxEventSubject","RxStateSignal","filter","from","lastValueFrom","take","takeUntil","v7","uuidv7","BasicAuthContextErrorCode","BasicAuthContextSource","clientErrorFromBasicAuthError","BasicAuthContextClientConfigSchema","BASIC_AUTH_CONTEXT_CLIENT_CONFIG","AuthGuardRedirectStatus","AuthGuardResultKind","BasicAuthBoundaryKind","BasicAuthBoundaryKindValues","BasicAuthContextEventType","DEFAULT_LOGIN_SUBPATH","POST_AUTH_REDIRECT_PARAM","instrumentBasicAuthMethod","factoryArgs","operation","environment","span","name","config","tracing","prefix","target","traceAttributes","clientErrorFromUnknown","error","options","resolveZone","zonePrefix","replace","loginSub","loginSubpath","loginPath","readBasicAuthBoundaryKind","status","Authenticated","challengeHeader","Challenge","Unauthorized","BasicAuthContextClient","_start","refresh","_refresh","logout","_logout","loginWithRedirect","_loginWithRedirect","defaultOptions","_environment","_config","_span","_rootCancellation","_destroyed","fromInitialValue","destroyed$","pipe","value","_boundarySnapshotSignal","Idle","_operationSignals","startPending","refreshPending","logoutPending","loginRedirectPending","_eventSubject","_refreshCommandSubject","_refreshResponseSubject","_startOnce","cancellationToken","operationSpan","throwIfCancellationRequested","set","_dispatchRefresh","_resolveRefreshOptions","id","zones","boundarySnapshot","boundaryResource","isAuthenticated","operations","events","fromEnvironmentConfig","fromInjector","injector","client","get","onDestroy","dispose","bundledSchema","onInvalid","failure","code","InvalidConfig","source","BasicAuthContext","messagePrefix","resolvedConfig","baseUrl","map","probePath","fork","attributes","ClientName","ClientId","snapshot","authenticated","subscribe","cancel","kind","Cancelled","ClientDisposed","message","command","_executeRefresh","payload","autoStart","start","catch","token","disposableStack","use","_options","_emitEvent","type","LogoutStarted","_readCurrentSnapshot","Resolved","setTraceAttributes","localProjectionCleared","LogoutSucceeded","clientError","LogoutFailed","_operationSpan","router","Configuration","RouterUnavailable","zone","_resolveZoneForAction","postAuthRedirectUri","currentPath","LoginRedirectStarted","navigate","url","parse","loginUrl","intent","AuthRedirect","mode","External","LoginRedirectSucceeded","LoginRedirectFailed","zoneForPath","path","matchedZone","matches","startsWith","length","zoneForPrefix","find","isInZone","undefined","base","params","URLSearchParams","toString","loginUrlForZonePrefix","handleUnauthorized","responseStatus","Ok","Redirect","Found","location","complete","ProbePathRequired","action","ZoneNotFound","ZoneRequired","requestStream","responseStream","createCommandExtra","previous","loadingSnapshot","Load","BoundaryRefreshStarted","response","transport","execute","method","headers","accept","fromHttpResponse","body","_snapshotFromResponse","Resolve","boundaryKind","BoundaryRefreshSucceeded","Fail","BoundaryRefreshFailed","requestPath","Reloading","Error","input","next","at","time","now","INJECTOR_TOKEN","BasicAuthContextClient","BASIC_AUTH_CONTEXT_CLIENT","BASIC_AUTH_CONTEXT_CLIENT_CONFIG","provideBasicAuthContext","options","provide","useValue","config","useFactory","injector","fromInjector","deps"],"sources":["../src/authorization-header.ts","../src/error.ts","../src/schemas.ts","../src/tokens.ts","../src/types.ts","../src/client.ts","../src/providers.ts"],"sourcesContent":["import {\n\tClientError,\n\tClientErrorKind,\n\tencodeUint8ArrayToBase64,\n} from \"@securitydept/client\";\n\nexport interface CreateBasicAuthorizationHeaderValueOptions {\n\treadonly username: string;\n\treadonly password: string;\n}\n\nexport function createBasicAuthorizationHeaderValue(\n\toptions: CreateBasicAuthorizationHeaderValueOptions,\n): string {\n\tif (options.username.includes(\":\")) {\n\t\tthrow new ClientError({\n\t\t\tkind: ClientErrorKind.Configuration,\n\t\t\tcode: \"basic_auth.authorization_header.username_contains_colon\",\n\t\t\tmessage: \"A Basic authentication username cannot contain a colon.\",\n\t\t\tsource: \"basic_auth\",\n\t\t});\n\t}\n\n\treturn `Basic ${encodeUint8ArrayToBase64(\n\t\tnew TextEncoder().encode(`${options.username}:${options.password}`),\n\t)}`;\n}\n","import { ClientError, type SpanTrait } from \"@securitydept/client\";\n\nexport const BasicAuthContextErrorCode = {\n\tOperationFailed: \"basic_auth.operation_failed\",\n\tInvalidConfig: \"basic_auth.invalid_config\",\n\tClientDisposed: \"basic_auth.client_disposed\",\n\tRouterUnavailable: \"basic_auth.router_unavailable\",\n\tProbePathRequired: \"basic_auth.probe_path_required\",\n\tZoneNotFound: \"basic_auth.zone_not_found\",\n\tZoneRequired: \"basic_auth.zone_required\",\n} as const;\n\nexport type BasicAuthContextErrorCode =\n\t(typeof BasicAuthContextErrorCode)[keyof typeof BasicAuthContextErrorCode];\n\nexport const BasicAuthContextSource = {\n\tBasicAuthContext: \"basic-auth-context\",\n} as const;\n\nexport type BasicAuthContextSource =\n\t(typeof BasicAuthContextSource)[keyof typeof BasicAuthContextSource];\n\nexport function clientErrorFromBasicAuthError(\n\terror: unknown,\n\toptions: { span: SpanTrait | undefined },\n): ClientError {\n\treturn ClientError.fromUnknown(error, {\n\t\tcode: BasicAuthContextErrorCode.OperationFailed,\n\t\tmessage: \"The Basic Auth operation failed unexpectedly\",\n\t\tsource: BasicAuthContextSource.BasicAuthContext,\n\t\tspan: options.span,\n\t});\n}\n","import { type as defineType } from \"arktype\";\n\nexport const BasicAuthZoneConfigSchema = defineType({\n\tzonePrefix: \"string > 0\",\n\t\"loginSubpath?\": \"string\",\n});\n\nexport const BasicAuthContextClientConfigSchema = defineType({\n\t\"id?\": \"string > 0\",\n\tbaseUrl: \"string > 0\",\n\tzones: BasicAuthZoneConfigSchema.array().atLeastLength(1),\n\t\"probePath?\": \"string > 0\",\n\t\"autoStart?\": \"boolean\",\n\t\"tracing?\": {\n\t\t\"target?\": \"string > 0\",\n\t\t\"prefix?\": \"string > 0\",\n\t},\n});\n","import { SecuritydeptInjectionToken } from \"@securitydept/client\";\nimport { type BasicAuthContextClient } from \"./client\";\nimport { type BasicAuthContextClientConfig } from \"./types\";\n\nexport const BASIC_AUTH_CONTEXT_CLIENT =\n\tnew SecuritydeptInjectionToken<BasicAuthContextClient>(\n\t\t\"BASIC_AUTH_CONTEXT_CLIENT\",\n\t);\n\nexport const BASIC_AUTH_CONTEXT_CLIENT_CONFIG =\n\tnew SecuritydeptInjectionToken<BasicAuthContextClientConfig>(\n\t\t\"BASIC_AUTH_CONTEXT_CLIENT_CONFIG\",\n\t);\n","// --- Basic Auth Context Client types ---\n\nimport {\n\ttype CancellationTokenOptions,\n\ttype ClientError,\n\ttype ReadableSignalTrait,\n\ttype ResourceSnapshot,\n\ttype ResourceTrait,\n} from \"@securitydept/client\";\n\nexport interface BasicAuthZoneConfig {\n\t/** URL path prefix for this zone (e.g. \"/basic\"). */\n\tzonePrefix: string;\n\t/** Login subpath relative to zone prefix (default: \"/login\"). */\n\tloginSubpath?: string;\n}\n\n/** Configuration for the Basic Auth Context Client. */\nexport interface BasicAuthContextClientConfig {\n\tid?: string;\n\t/** Base URL of the SecurityDept server. */\n\tbaseUrl: string;\n\t/** One or more Basic Auth zones to manage. */\n\tzones: BasicAuthZoneConfig[];\n\t/** Protected endpoint used by start()/refresh() to observe the boundary. */\n\tprobePath?: string;\n\tautoStart?: boolean;\n\ttracing?: BasicAuthContextClientTracingOptions;\n}\n\nexport interface BasicAuthContextClientTracingOptions {\n\ttarget?: string;\n\tprefix?: string;\n}\n\nexport interface ResolvedBasicAuthContextClientConfig {\n\tid: string;\n\tbaseUrl: string;\n\tzones: readonly ResolvedBasicAuthZone[];\n\tprobePath?: string;\n\ttracing: Required<BasicAuthContextClientTracingOptions>;\n}\n\nexport const BasicAuthBoundaryKind = {\n\tAuthenticated: \"authenticated\",\n\tChallenge: \"challenge\",\n\tUnauthorized: \"unauthorized\",\n} as const;\n\nexport type BasicAuthBoundaryKind =\n\t(typeof BasicAuthBoundaryKind)[keyof typeof BasicAuthBoundaryKind];\n\nexport interface BasicAuthBoundaryObservation {\n\tstatus: number;\n\tchallengeHeader?: string | null;\n\trequestPath?: string;\n}\n\nexport interface BasicAuthBoundarySnapshot {\n\tauthenticated: boolean;\n\tboundaryKind: BasicAuthBoundaryKind;\n\tstatus: number;\n\tpath: string;\n\tchallengeHeader: string | null;\n\tzone?: ResolvedBasicAuthZone;\n}\n\nexport const BasicAuthContextEventType = {\n\tBoundaryRefreshStarted: \"basic_auth.boundary.refresh.started\",\n\tBoundaryRefreshSucceeded: \"basic_auth.boundary.refresh.succeeded\",\n\tBoundaryRefreshFailed: \"basic_auth.boundary.refresh.failed\",\n\t/** These logout events describe local boundary-projection clearing only. */\n\tLogoutStarted: \"basic_auth.logout.started\",\n\tLogoutSucceeded: \"basic_auth.logout.succeeded\",\n\tLogoutFailed: \"basic_auth.logout.failed\",\n\tLoginRedirectStarted: \"basic_auth.login.redirect.started\",\n\tLoginRedirectSucceeded: \"basic_auth.login.redirect.succeeded\",\n\tLoginRedirectFailed: \"basic_auth.login.redirect.failed\",\n} as const;\n\nexport type BasicAuthContextEventType =\n\t(typeof BasicAuthContextEventType)[keyof typeof BasicAuthContextEventType];\n\ninterface BasicAuthContextEventBase {\n\treadonly at: number;\n\treadonly client: {\n\t\treadonly id: string;\n\t};\n}\n\ntype BasicAuthContextEventData =\n\t| {\n\t\t\treadonly type: typeof BasicAuthContextEventType.BoundaryRefreshStarted;\n\t\t\treadonly snapshot: BasicAuthBoundarySnapshot | null;\n\t }\n\t| {\n\t\t\treadonly type: typeof BasicAuthContextEventType.BoundaryRefreshSucceeded;\n\t\t\treadonly snapshot: BasicAuthBoundarySnapshot;\n\t\t\treadonly zone?: ResolvedBasicAuthZone;\n\t }\n\t| {\n\t\t\treadonly type: typeof BasicAuthContextEventType.BoundaryRefreshFailed;\n\t\t\treadonly snapshot: BasicAuthBoundarySnapshot | null;\n\t\t\treadonly error: ClientError;\n\t }\n\t| {\n\t\t\treadonly type: typeof BasicAuthContextEventType.LogoutStarted;\n\t\t\treadonly snapshot: BasicAuthBoundarySnapshot | null;\n\t }\n\t| {\n\t\t\treadonly type: typeof BasicAuthContextEventType.LogoutSucceeded;\n\t\t\treadonly snapshot: null;\n\t }\n\t| {\n\t\t\treadonly type: typeof BasicAuthContextEventType.LogoutFailed;\n\t\t\treadonly snapshot: BasicAuthBoundarySnapshot | null;\n\t\t\treadonly error: ClientError;\n\t }\n\t| {\n\t\t\treadonly type:\n\t\t\t\t| typeof BasicAuthContextEventType.LoginRedirectStarted\n\t\t\t\t| typeof BasicAuthContextEventType.LoginRedirectSucceeded;\n\t\t\treadonly zone: ResolvedBasicAuthZone;\n\t }\n\t| {\n\t\t\treadonly type: typeof BasicAuthContextEventType.LoginRedirectFailed;\n\t\t\treadonly zone: ResolvedBasicAuthZone;\n\t\t\treadonly error: ClientError;\n\t };\n\nexport type BasicAuthContextEvent = BasicAuthContextEventBase &\n\tBasicAuthContextEventData;\n\nexport type BasicAuthContextEventInput = BasicAuthContextEventData;\n\nexport interface BasicAuthContextOperationSignals {\n\treadonly startPending: ReadableSignalTrait<boolean>;\n\treadonly refreshPending: ReadableSignalTrait<boolean>;\n\treadonly logoutPending: ReadableSignalTrait<boolean>;\n\treadonly loginRedirectPending: ReadableSignalTrait<boolean>;\n}\n\nexport interface BasicAuthRefreshOptions extends CancellationTokenOptions {\n\tpath?: string;\n}\n\nexport type BasicAuthZoneSelectionOptions =\n\t| {\n\t\t\tcurrentPath: string;\n\t\t\tzonePrefix?: never;\n\t }\n\t| {\n\t\t\tzonePrefix: string;\n\t\t\tcurrentPath?: never;\n\t };\n\n/** Options for clearing the client's in-memory boundary projection. */\nexport interface BasicAuthLogoutOptions extends CancellationTokenOptions {}\n\nexport type BasicAuthLoginWithRedirectOptions = BasicAuthZoneSelectionOptions &\n\tCancellationTokenOptions & {\n\t\tpostAuthRedirectUri?: string;\n\t};\n\nexport const AuthGuardResultKind = {\n\tOk: \"ok\",\n\tRedirect: \"redirect\",\n} as const;\n\nexport type AuthGuardResultKind =\n\t(typeof AuthGuardResultKind)[keyof typeof AuthGuardResultKind];\n\nexport const AuthGuardRedirectStatus = {\n\tFound: 302,\n\tSeeOther: 303,\n\tTemporaryRedirect: 307,\n} as const;\n\nexport type AuthGuardRedirectStatus =\n\t(typeof AuthGuardRedirectStatus)[keyof typeof AuthGuardRedirectStatus];\n\n/** Redirect instruction — framework-neutral result. */\nexport type AuthGuardResult<T> =\n\t| { kind: typeof AuthGuardResultKind.Ok; value: T }\n\t| {\n\t\t\tkind: typeof AuthGuardResultKind.Redirect;\n\t\t\tstatus: AuthGuardRedirectStatus;\n\t\t\tlocation: string;\n\t };\n\n/** Resolved zone with computed paths. */\nexport interface ResolvedBasicAuthZone {\n\tzonePrefix: string;\n\tloginPath: string;\n}\n\nexport interface BasicAuthContextClientStateSignals {\n\treadonly boundarySnapshot: ReadableSignalTrait<\n\t\tResourceSnapshot<BasicAuthBoundarySnapshot | null>\n\t>;\n\treadonly boundaryResource: ResourceTrait<BasicAuthBoundarySnapshot | null>;\n\treadonly isAuthenticated: ResourceTrait<boolean>;\n}\n","import {\n\ttype CancellationTokenSourceTrait,\n\ttype CancellationTokenTrait,\n\tClientError,\n\tClientErrorKind,\n\tcreateCancellationTokenSource,\n\tcreateLinkedCancellationToken,\n\tcreateOnceAsyncLockCallable,\n\tcreateSignal,\n\ttype DisposableTrait,\n\tdefineInstrumentMethodDecorator,\n\tENVIRONMENT_TOKEN,\n\ttype EventStreamTrait,\n\ttype FoundationEnvironment,\n\tinjectDisposableStackFrom,\n\tmapResource,\n\ttype OperationSpanTrait,\n\ttype ReadableSignalTrait,\n\ttype ResourceSnapshot,\n\tResourceSnapshotUpdateKind,\n\tResourceStatus,\n\ttype ResourceTrait,\n\tRouterNavigationIntent,\n\tRouterNavigationMode,\n\treadonlySignal,\n\treduceResourceSnapshot,\n\tresourceFromSnapshots,\n\tSecuritydeptDestroyRef,\n\ttype SecuritydeptInjectorTrait,\n\tSpanSharedAttributeName,\n\ttype SpanTrait,\n\tSYMBOL_DISPOSE,\n\tthrowValidationClientError,\n\tUriReferenceString,\n\tvalidateTraitInput,\n\ttype WritableSignalTrait,\n\twithDisposableStack,\n} from \"@securitydept/client\";\nimport {\n\ttype Command,\n\ttype CommandResponse,\n\tcommandResponseData,\n\tconcatCommand,\n\tdispatchCommandLocallyToStream,\n\tRxEventSubject,\n\tRxStateSignal,\n} from \"@securitydept/client/rx\";\nimport { filter, from, lastValueFrom, take, takeUntil } from \"rxjs\";\nimport { v7 as uuidv7 } from \"uuid\";\nimport {\n\tBasicAuthContextErrorCode,\n\tBasicAuthContextSource,\n\tclientErrorFromBasicAuthError,\n} from \"./error\";\nimport { BasicAuthContextClientConfigSchema } from \"./schemas\";\nimport { BASIC_AUTH_CONTEXT_CLIENT_CONFIG } from \"./tokens\";\nimport {\n\tAuthGuardRedirectStatus,\n\ttype AuthGuardResult,\n\tAuthGuardResultKind,\n\ttype BasicAuthBoundaryKind,\n\tBasicAuthBoundaryKind as BasicAuthBoundaryKindValues,\n\ttype BasicAuthBoundaryObservation,\n\ttype BasicAuthBoundarySnapshot,\n\ttype BasicAuthContextClientConfig,\n\ttype BasicAuthContextEvent,\n\ttype BasicAuthContextEventInput,\n\tBasicAuthContextEventType,\n\ttype BasicAuthContextOperationSignals,\n\ttype BasicAuthLoginWithRedirectOptions,\n\ttype BasicAuthLogoutOptions,\n\ttype BasicAuthRefreshOptions,\n\ttype BasicAuthZoneConfig,\n\ttype BasicAuthZoneSelectionOptions,\n\ttype ResolvedBasicAuthContextClientConfig,\n\ttype ResolvedBasicAuthZone,\n} from \"./types\";\n\nconst DEFAULT_LOGIN_SUBPATH = \"/login\";\nconst POST_AUTH_REDIRECT_PARAM = \"post_auth_redirect_uri\";\n\ninterface BasicAuthCommandExtra {\n\tcancellationToken: CancellationTokenTrait;\n\toperationSpan?: OperationSpanTrait;\n}\n\ntype ResolvedBasicAuthRefreshOptions = { path: string };\n\ntype BasicAuthRefreshCommand = Command<\n\tResolvedBasicAuthRefreshOptions,\n\tBasicAuthCommandExtra\n>;\n\nconst instrumentBasicAuthMethod = defineInstrumentMethodDecorator<\n\t[operation: string],\n\tBasicAuthContextClient\n>(\n\t({ factoryArgs: [operation] }) =>\n\t\tfunction (this: BasicAuthContextClient) {\n\t\t\treturn {\n\t\t\t\tenvironment: this.environment,\n\t\t\t\tspan: this.span,\n\t\t\t\tname: `${this.config.tracing.prefix}.${operation}`,\n\t\t\t\ttarget: this.config.tracing.target,\n\t\t\t\ttraceAttributes: { operation },\n\t\t\t\tclientErrorFromUnknown: (error, options) =>\n\t\t\t\t\tclientErrorFromBasicAuthError(error, options),\n\t\t\t};\n\t\t},\n);\n\nfunction resolveZone(config: BasicAuthZoneConfig): ResolvedBasicAuthZone {\n\tconst prefix = config.zonePrefix.replace(/\\/+$/, \"\");\n\tconst loginSub = config.loginSubpath ?? DEFAULT_LOGIN_SUBPATH;\n\n\treturn {\n\t\tzonePrefix: prefix,\n\t\tloginPath: prefix + loginSub,\n\t};\n}\n\nexport function readBasicAuthBoundaryKind(\n\toptions: BasicAuthBoundaryObservation,\n): BasicAuthBoundaryKind {\n\tif (options.status < 400) {\n\t\treturn BasicAuthBoundaryKindValues.Authenticated;\n\t}\n\n\tif (options.challengeHeader) {\n\t\treturn BasicAuthBoundaryKindValues.Challenge;\n\t}\n\n\treturn BasicAuthBoundaryKindValues.Unauthorized;\n}\n\n/**\n * Basic Auth Context Client.\n *\n * Owns zone-aware Basic Auth boundary observations and login navigation.\n * It does not manage browser credentials or principal data.\n */\nexport class BasicAuthContextClient implements DisposableTrait {\n\tstatic defaultOptions = {\n\t\tloginSubpath: DEFAULT_LOGIN_SUBPATH,\n\t\ttracing: {\n\t\t\ttarget: \"basic-auth-context-client\",\n\t\t\tprefix: \"basic_auth_context\",\n\t\t},\n\t} as const;\n\n\tprivate readonly _environment: FoundationEnvironment;\n\tprivate readonly _config: ResolvedBasicAuthContextClientConfig;\n\tprivate readonly _span: SpanTrait;\n\tprivate readonly _rootCancellation: CancellationTokenSourceTrait =\n\t\tcreateCancellationTokenSource();\n\tprivate readonly _destroyed = RxStateSignal.fromInitialValue(false);\n\tprivate readonly destroyed$ = from(this._destroyed).pipe(\n\t\tfilter((value): value is true => value),\n\t\ttake(1),\n\t);\n\tprivate readonly _boundarySnapshotSignal = RxStateSignal.fromInitialValue<\n\t\tResourceSnapshot<BasicAuthBoundarySnapshot | null>\n\t>({ status: ResourceStatus.Idle });\n\tprivate readonly _operationSignals: {\n\t\treadonly startPending: WritableSignalTrait<boolean>;\n\t\treadonly refreshPending: WritableSignalTrait<boolean>;\n\t\treadonly logoutPending: WritableSignalTrait<boolean>;\n\t\treadonly loginRedirectPending: WritableSignalTrait<boolean>;\n\t} = {\n\t\tstartPending: createSignal(false),\n\t\trefreshPending: createSignal(false),\n\t\tlogoutPending: createSignal(false),\n\t\tloginRedirectPending: createSignal(false),\n\t};\n\tprivate readonly _eventSubject = new RxEventSubject<BasicAuthContextEvent>();\n\tprivate readonly _refreshCommandSubject =\n\t\tnew RxEventSubject<BasicAuthRefreshCommand>();\n\tprivate readonly _refreshResponseSubject = new RxEventSubject<\n\t\tCommandResponse<BasicAuthRefreshCommand, BasicAuthBoundarySnapshot>\n\t>();\n\tprivate readonly _startOnce = createOnceAsyncLockCallable(\n\t\tasync (\n\t\t\tcancellationToken: CancellationTokenTrait,\n\t\t\toperationSpan?: OperationSpanTrait,\n\t\t) => {\n\t\t\tcancellationToken.throwIfCancellationRequested();\n\t\t\tthis._operationSignals.startPending.set(true);\n\t\t\ttry {\n\t\t\t\treturn await this._dispatchRefresh(\n\t\t\t\t\tthis._resolveRefreshOptions({}),\n\t\t\t\t\tcancellationToken,\n\t\t\t\t\toperationSpan,\n\t\t\t\t);\n\t\t\t} finally {\n\t\t\t\tthis._operationSignals.startPending.set(false);\n\t\t\t}\n\t\t},\n\t);\n\n\treadonly id: string;\n\treadonly zones: readonly ResolvedBasicAuthZone[];\n\treadonly boundarySnapshot: ReadableSignalTrait<\n\t\tResourceSnapshot<BasicAuthBoundarySnapshot | null>\n\t>;\n\treadonly boundaryResource: ResourceTrait<BasicAuthBoundarySnapshot | null>;\n\treadonly isAuthenticated: ResourceTrait<boolean>;\n\treadonly operations: BasicAuthContextOperationSignals;\n\treadonly events: EventStreamTrait<BasicAuthContextEvent>;\n\n\tprotected get environment(): FoundationEnvironment {\n\t\treturn this._environment;\n\t}\n\n\tprotected get span(): SpanTrait {\n\t\treturn this._span;\n\t}\n\n\tprotected get config(): ResolvedBasicAuthContextClientConfig {\n\t\treturn this._config;\n\t}\n\n\tstatic fromEnvironmentConfig(options: {\n\t\treadonly config: BasicAuthContextClientConfig;\n\t\treadonly environment: FoundationEnvironment;\n\t}): BasicAuthContextClient {\n\t\treturn new BasicAuthContextClient(options.config, options.environment);\n\t}\n\n\tstatic fromInjector(\n\t\tinjector: SecuritydeptInjectorTrait,\n\t): BasicAuthContextClient {\n\t\tconst client = BasicAuthContextClient.fromEnvironmentConfig({\n\t\t\tconfig: injector.get(BASIC_AUTH_CONTEXT_CLIENT_CONFIG),\n\t\t\tenvironment: injector.get(ENVIRONMENT_TOKEN),\n\t\t});\n\t\tinjector\n\t\t\t.get(SecuritydeptDestroyRef, null)\n\t\t\t?.onDestroy(() => client.dispose());\n\t\treturn client;\n\t}\n\n\tprotected constructor(\n\t\tconfig: BasicAuthContextClientConfig,\n\t\tenvironment: FoundationEnvironment,\n\t) {\n\t\tvalidateTraitInput({\n\t\t\tvalue: config,\n\t\t\tbundledSchema: BasicAuthContextClientConfigSchema,\n\t\t\tonInvalid: (failure) =>\n\t\t\t\tthrowValidationClientError({\n\t\t\t\t\tcode: BasicAuthContextErrorCode.InvalidConfig,\n\t\t\t\t\tsource: BasicAuthContextSource.BasicAuthContext,\n\t\t\t\t\tmessagePrefix: \"BasicAuthContextClient could not validate config\",\n\t\t\t\t\tfailure,\n\t\t\t\t}),\n\t\t});\n\t\tconst resolvedConfig: ResolvedBasicAuthContextClientConfig = {\n\t\t\tid: config.id ?? uuidv7(),\n\t\t\tbaseUrl: (config.baseUrl ?? \"\").replace(/\\/+$/, \"\"),\n\t\t\tzones: (config.zones ?? []).map(resolveZone),\n\t\t\tprobePath: config.probePath,\n\t\t\ttracing: {\n\t\t\t\ttarget:\n\t\t\t\t\tconfig.tracing?.target ??\n\t\t\t\t\tBasicAuthContextClient.defaultOptions.tracing.target,\n\t\t\t\tprefix:\n\t\t\t\t\tconfig.tracing?.prefix ??\n\t\t\t\t\tBasicAuthContextClient.defaultOptions.tracing.prefix,\n\t\t\t},\n\t\t};\n\n\t\tthis._environment = environment;\n\t\tthis._config = resolvedConfig;\n\t\tthis.id = resolvedConfig.id;\n\t\tthis.zones = resolvedConfig.zones;\n\t\tthis._span = environment.span.fork({\n\t\t\tattributes: {\n\t\t\t\t[SpanSharedAttributeName.ClientName]: this.constructor.name,\n\t\t\t\t[SpanSharedAttributeName.ClientId]: this.id,\n\t\t\t},\n\t\t});\n\t\tthis.boundarySnapshot = readonlySignal(this._boundarySnapshotSignal);\n\t\tthis.boundaryResource = resourceFromSnapshots(() =>\n\t\t\tthis._boundarySnapshotSignal.get(),\n\t\t);\n\t\tthis.isAuthenticated = mapResource(\n\t\t\tthis.boundaryResource,\n\t\t\t(snapshot) => snapshot?.authenticated === true,\n\t\t);\n\t\tthis.operations = {\n\t\t\tstartPending: readonlySignal(this._operationSignals.startPending),\n\t\t\trefreshPending: readonlySignal(this._operationSignals.refreshPending),\n\t\t\tlogoutPending: readonlySignal(this._operationSignals.logoutPending),\n\t\t\tloginRedirectPending: readonlySignal(\n\t\t\t\tthis._operationSignals.loginRedirectPending,\n\t\t\t),\n\t\t};\n\t\tthis.events = this._eventSubject;\n\t\tthis.destroyed$.subscribe(() => {\n\t\t\tthis._rootCancellation.cancel(\n\t\t\t\tnew ClientError({\n\t\t\t\t\tkind: ClientErrorKind.Cancelled,\n\t\t\t\t\tcode: BasicAuthContextErrorCode.ClientDisposed,\n\t\t\t\t\tmessage: \"BasicAuthContextClient has been disposed.\",\n\t\t\t\t\tsource: BasicAuthContextSource.BasicAuthContext,\n\t\t\t\t}),\n\t\t\t);\n\t\t\tthis.isAuthenticated.dispose();\n\t\t\tthis.boundaryResource.dispose();\n\t\t});\n\n\t\tfrom(this._refreshCommandSubject)\n\t\t\t.pipe(\n\t\t\t\ttakeUntil(this.destroyed$),\n\t\t\t\tconcatCommand((command) =>\n\t\t\t\t\tthis._executeRefresh(\n\t\t\t\t\t\tcommand.payload,\n\t\t\t\t\t\tcommand.cancellationToken,\n\t\t\t\t\t\tcommand.operationSpan,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t\t.subscribe(this._refreshResponseSubject);\n\n\t\tif (config.autoStart === true) {\n\t\t\tthis.start().catch(() => {\n\t\t\t\t// Startup failure is reflected by boundarySnapshot.\n\t\t\t});\n\t\t}\n\t}\n\n\tasync start(): Promise<BasicAuthBoundarySnapshot> {\n\t\tconst cancellationToken = this._rootCancellation.token;\n\t\treturn await this._start(cancellationToken);\n\t}\n\n\t@instrumentBasicAuthMethod(\"start\")\n\tprivate async _start(\n\t\tcancellationToken: CancellationTokenTrait,\n\t\toperationSpan?: OperationSpanTrait,\n\t): Promise<BasicAuthBoundarySnapshot> {\n\t\treturn await this._startOnce(cancellationToken, operationSpan);\n\t}\n\n\t@withDisposableStack(0, true)\n\tasync refresh(\n\t\toptions: BasicAuthRefreshOptions = {},\n\t): Promise<BasicAuthBoundarySnapshot> {\n\t\tconst disposableStack = injectDisposableStackFrom(options, true);\n\t\tconst cancellationToken = createLinkedCancellationToken(\n\t\t\tthis._rootCancellation.token,\n\t\t\toptions.cancellationToken,\n\t\t);\n\t\tdisposableStack?.use(cancellationToken);\n\t\treturn await this._refresh(options, cancellationToken);\n\t}\n\n\t@instrumentBasicAuthMethod(\"refresh\")\n\tprivate async _refresh(\n\t\toptions: BasicAuthRefreshOptions,\n\t\tcancellationToken: CancellationTokenTrait,\n\t\toperationSpan?: OperationSpanTrait,\n\t): Promise<BasicAuthBoundarySnapshot> {\n\t\tcancellationToken.throwIfCancellationRequested();\n\t\treturn await this._dispatchRefresh(\n\t\t\tthis._resolveRefreshOptions(options),\n\t\t\tcancellationToken,\n\t\t\toperationSpan,\n\t\t);\n\t}\n\n\t/**\n\t * Clears only this client's in-memory Basic Auth boundary projection.\n\t *\n\t * Browsers own HTTP Basic credentials. This method cannot revoke or clear\n\t * those credentials, and a later probe may observe an authenticated state\n\t * again when the browser continues sending them.\n\t */\n\t@withDisposableStack(0, true)\n\tasync logout(options: BasicAuthLogoutOptions = {}): Promise<void> {\n\t\tconst disposableStack = injectDisposableStackFrom(options, true);\n\t\tconst cancellationToken = createLinkedCancellationToken(\n\t\t\tthis._rootCancellation.token,\n\t\t\toptions.cancellationToken,\n\t\t);\n\t\tdisposableStack?.use(cancellationToken);\n\t\treturn await this._logout(options, cancellationToken);\n\t}\n\n\t@instrumentBasicAuthMethod(\"logout\")\n\tprivate async _logout(\n\t\t_options: BasicAuthLogoutOptions,\n\t\tcancellationToken: CancellationTokenTrait,\n\t\toperationSpan?: OperationSpanTrait,\n\t): Promise<void> {\n\t\tcancellationToken.throwIfCancellationRequested();\n\t\tthis._operationSignals.logoutPending.set(true);\n\t\tthis._emitEvent({\n\t\t\ttype: BasicAuthContextEventType.LogoutStarted,\n\t\t\tsnapshot: this._readCurrentSnapshot(),\n\t\t});\n\t\ttry {\n\t\t\tcancellationToken.throwIfCancellationRequested();\n\t\t\tthis._boundarySnapshotSignal.set({\n\t\t\t\tstatus: ResourceStatus.Resolved,\n\t\t\t\tvalue: null,\n\t\t\t});\n\t\t\toperationSpan?.setTraceAttributes({ localProjectionCleared: true });\n\t\t\tthis._emitEvent({\n\t\t\t\ttype: BasicAuthContextEventType.LogoutSucceeded,\n\t\t\t\tsnapshot: null,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst clientError = clientErrorFromBasicAuthError(error, {\n\t\t\t\tspan: operationSpan?.span,\n\t\t\t});\n\t\t\tthis._emitEvent({\n\t\t\t\ttype: BasicAuthContextEventType.LogoutFailed,\n\t\t\t\tsnapshot: this._readCurrentSnapshot(),\n\t\t\t\terror: clientError,\n\t\t\t});\n\t\t\tthrow clientError;\n\t\t} finally {\n\t\t\tthis._operationSignals.logoutPending.set(false);\n\t\t}\n\t}\n\n\t@withDisposableStack(0, true)\n\tasync loginWithRedirect(\n\t\toptions: BasicAuthLoginWithRedirectOptions,\n\t): Promise<void> {\n\t\tconst disposableStack = injectDisposableStackFrom(options, true);\n\t\tconst cancellationToken = createLinkedCancellationToken(\n\t\t\tthis._rootCancellation.token,\n\t\t\toptions.cancellationToken,\n\t\t);\n\t\tdisposableStack?.use(cancellationToken);\n\t\tawait this._loginWithRedirect(options, cancellationToken);\n\t}\n\n\t@instrumentBasicAuthMethod(\"login.redirect\")\n\tprivate async _loginWithRedirect(\n\t\toptions: BasicAuthLoginWithRedirectOptions,\n\t\tcancellationToken: CancellationTokenTrait,\n\t\t_operationSpan?: OperationSpanTrait,\n\t): Promise<void> {\n\t\tcancellationToken.throwIfCancellationRequested();\n\t\tconst router = this._environment.router;\n\t\tif (!router) {\n\t\t\tthrow new ClientError({\n\t\t\t\tkind: ClientErrorKind.Configuration,\n\t\t\t\tcode: BasicAuthContextErrorCode.RouterUnavailable,\n\t\t\t\tmessage: \"loginWithRedirect() requires environment.router.\",\n\t\t\t\tsource: BasicAuthContextSource.BasicAuthContext,\n\t\t\t});\n\t\t}\n\t\tconst zone = this._resolveZoneForAction(options, \"login redirect\");\n\t\tconst postAuthRedirectUri =\n\t\t\toptions.postAuthRedirectUri ?? options.currentPath;\n\n\t\tthis._operationSignals.loginRedirectPending.set(true);\n\t\tthis._emitEvent({\n\t\t\ttype: BasicAuthContextEventType.LoginRedirectStarted,\n\t\t\tzone,\n\t\t});\n\t\ttry {\n\t\t\tawait router.navigate({\n\t\t\t\turl: UriReferenceString.parse(this.loginUrl(zone, postAuthRedirectUri)),\n\t\t\t\tintent: RouterNavigationIntent.AuthRedirect,\n\t\t\t\tmode: RouterNavigationMode.External,\n\t\t\t});\n\t\t\tcancellationToken.throwIfCancellationRequested();\n\t\t\tthis._emitEvent({\n\t\t\t\ttype: BasicAuthContextEventType.LoginRedirectSucceeded,\n\t\t\t\tzone,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst clientError = clientErrorFromBasicAuthError(error, {\n\t\t\t\tspan: _operationSpan?.span,\n\t\t\t});\n\t\t\tthis._emitEvent({\n\t\t\t\ttype: BasicAuthContextEventType.LoginRedirectFailed,\n\t\t\t\tzone,\n\t\t\t\terror: clientError,\n\t\t\t});\n\t\t\tthrow clientError;\n\t\t} finally {\n\t\t\tthis._operationSignals.loginRedirectPending.set(false);\n\t\t}\n\t}\n\n\t/** Find the zone that contains the given path. */\n\tzoneForPath(path: string): ResolvedBasicAuthZone | undefined {\n\t\tlet matchedZone: ResolvedBasicAuthZone | undefined;\n\n\t\tfor (const zone of this.zones) {\n\t\t\tconst matches =\n\t\t\t\tpath === zone.zonePrefix || path.startsWith(`${zone.zonePrefix}/`);\n\t\t\tif (!matches) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!matchedZone ||\n\t\t\t\tzone.zonePrefix.length > matchedZone.zonePrefix.length\n\t\t\t) {\n\t\t\t\tmatchedZone = zone;\n\t\t\t}\n\t\t}\n\n\t\treturn matchedZone;\n\t}\n\n\tzoneForPrefix(zonePrefix: string): ResolvedBasicAuthZone | undefined {\n\t\treturn this.zones.find((zone) => zone.zonePrefix === zonePrefix);\n\t}\n\n\t/** Check whether a path falls inside any configured zone. */\n\tisInZone(path: string): boolean {\n\t\treturn this.zoneForPath(path) !== undefined;\n\t}\n\n\t/** Build the full login URL for a zone, optionally with a post-auth redirect. */\n\tloginUrl(zone: ResolvedBasicAuthZone, postAuthRedirectUri?: string): string {\n\t\tconst base = this._config.baseUrl + zone.loginPath;\n\t\tif (postAuthRedirectUri) {\n\t\t\tconst params = new URLSearchParams({\n\t\t\t\t[POST_AUTH_REDIRECT_PARAM]: postAuthRedirectUri,\n\t\t\t});\n\t\t\treturn `${base}?${params.toString()}`;\n\t\t}\n\t\treturn base;\n\t}\n\n\tloginUrlForZonePrefix(\n\t\tzonePrefix: string,\n\t\tpostAuthRedirectUri?: string,\n\t): string | null {\n\t\tconst zone = this.zoneForPrefix(zonePrefix);\n\t\treturn zone ? this.loginUrl(zone, postAuthRedirectUri) : null;\n\t}\n\n\t/**\n\t * Handle a 401 response: if the current path is inside a zone,\n\t * return a redirect instruction to the zone's login URL.\n\t */\n\thandleUnauthorized(\n\t\tcurrentPath: string,\n\t\tresponseStatus: number,\n\t): AuthGuardResult<null> {\n\t\tif (responseStatus !== 401) {\n\t\t\treturn { kind: AuthGuardResultKind.Ok, value: null };\n\t\t}\n\n\t\tconst zone = this.zoneForPath(currentPath);\n\t\tif (!zone) {\n\t\t\treturn { kind: AuthGuardResultKind.Ok, value: null };\n\t\t}\n\n\t\treturn {\n\t\t\tkind: AuthGuardResultKind.Redirect,\n\t\t\tstatus: AuthGuardRedirectStatus.Found,\n\t\t\tlocation: this.loginUrl(zone, currentPath),\n\t\t};\n\t}\n\n\tdispose(): void {\n\t\tthis._destroyed.set(true);\n\t\tthis._eventSubject.complete();\n\t}\n\n\t[SYMBOL_DISPOSE](): void {\n\t\tthis.dispose();\n\t}\n\n\tprivate _resolveRefreshOptions(\n\t\toptions: BasicAuthRefreshOptions,\n\t): ResolvedBasicAuthRefreshOptions {\n\t\tconst path = options.path ?? this._config.probePath;\n\t\tif (!path) {\n\t\t\tthrow new ClientError({\n\t\t\t\tkind: ClientErrorKind.Configuration,\n\t\t\t\tcode: BasicAuthContextErrorCode.ProbePathRequired,\n\t\t\t\tmessage:\n\t\t\t\t\t\"BasicAuthContextClient.refresh() requires options.path or config.probePath.\",\n\t\t\t\tsource: BasicAuthContextSource.BasicAuthContext,\n\t\t\t});\n\t\t}\n\t\treturn { path };\n\t}\n\n\tprivate _resolveZoneForAction(\n\t\toptions: BasicAuthZoneSelectionOptions,\n\t\taction: string,\n\t): ResolvedBasicAuthZone {\n\t\tif (options.zonePrefix) {\n\t\t\tconst zone = this.zoneForPrefix(options.zonePrefix);\n\t\t\tif (zone) {\n\t\t\t\treturn zone;\n\t\t\t}\n\t\t\tthrow new ClientError({\n\t\t\t\tkind: ClientErrorKind.Configuration,\n\t\t\t\tcode: BasicAuthContextErrorCode.ZoneNotFound,\n\t\t\t\tmessage: `BasicAuthContextClient ${action} could not find zone \"${options.zonePrefix}\".`,\n\t\t\t\tsource: BasicAuthContextSource.BasicAuthContext,\n\t\t\t});\n\t\t}\n\n\t\tconst zone =\n\t\t\ttypeof options.currentPath === \"string\"\n\t\t\t\t? this.zoneForPath(options.currentPath)\n\t\t\t\t: undefined;\n\t\tif (zone) {\n\t\t\treturn zone;\n\t\t}\n\n\t\tthrow new ClientError({\n\t\t\tkind: ClientErrorKind.Configuration,\n\t\t\tcode: BasicAuthContextErrorCode.ZoneRequired,\n\t\t\tmessage: `BasicAuthContextClient ${action} requires options.currentPath inside a configured zone or options.zonePrefix.`,\n\t\t\tsource: BasicAuthContextSource.BasicAuthContext,\n\t\t});\n\t}\n\n\tprivate async _dispatchRefresh(\n\t\tpayload: ResolvedBasicAuthRefreshOptions,\n\t\tcancellationToken: CancellationTokenTrait,\n\t\toperationSpan?: OperationSpanTrait,\n\t): Promise<BasicAuthBoundarySnapshot> {\n\t\tcancellationToken.throwIfCancellationRequested();\n\t\tconst snapshot = await lastValueFrom(\n\t\t\tdispatchCommandLocallyToStream<\n\t\t\t\tResolvedBasicAuthRefreshOptions,\n\t\t\t\tBasicAuthCommandExtra,\n\t\t\t\tBasicAuthBoundarySnapshot,\n\t\t\t\tBasicAuthRefreshCommand\n\t\t\t>({\n\t\t\t\tpayload,\n\t\t\t\trequestStream: this._refreshCommandSubject,\n\t\t\t\tresponseStream: this._refreshResponseSubject,\n\t\t\t\tcreateCommandExtra: () => ({ cancellationToken, operationSpan }),\n\t\t\t}).pipe(commandResponseData()),\n\t\t);\n\t\tcancellationToken.throwIfCancellationRequested();\n\t\treturn snapshot;\n\t}\n\n\tprivate async _executeRefresh(\n\t\toptions: ResolvedBasicAuthRefreshOptions,\n\t\tcancellationToken: CancellationTokenTrait,\n\t\toperationSpan?: OperationSpanTrait,\n\t): Promise<BasicAuthBoundarySnapshot> {\n\t\tcancellationToken.throwIfCancellationRequested();\n\t\tthis._operationSignals.refreshPending.set(true);\n\t\tconst previous = this._boundarySnapshotSignal.get();\n\t\tconst loadingSnapshot = reduceResourceSnapshot(previous, {\n\t\t\tkind: ResourceSnapshotUpdateKind.Load,\n\t\t});\n\t\tthis._boundarySnapshotSignal.set(loadingSnapshot);\n\t\tthis._emitEvent({\n\t\t\ttype: BasicAuthContextEventType.BoundaryRefreshStarted,\n\t\t\tsnapshot: this._readCurrentSnapshot(),\n\t\t});\n\t\ttry {\n\t\t\tconst response = await this._environment.transport.execute({\n\t\t\t\turl: this._config.baseUrl + options.path,\n\t\t\t\tmethod: \"GET\",\n\t\t\t\theaders: { accept: \"application/json\" },\n\t\t\t\tcancellationToken,\n\t\t\t});\n\t\t\tif (\n\t\t\t\tresponse.status >= 400 &&\n\t\t\t\tresponse.status !== 401 &&\n\t\t\t\tresponse.status !== 403\n\t\t\t) {\n\t\t\t\tthrow ClientError.fromHttpResponse({\n\t\t\t\t\tstatus: response.status,\n\t\t\t\t\tbody: response.body,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tcancellationToken.throwIfCancellationRequested();\n\t\t\tconst snapshot = this._snapshotFromResponse(options.path, response);\n\t\t\tthis._boundarySnapshotSignal.set(\n\t\t\t\treduceResourceSnapshot(loadingSnapshot, {\n\t\t\t\t\tkind: ResourceSnapshotUpdateKind.Resolve,\n\t\t\t\t\tvalue: snapshot,\n\t\t\t\t}),\n\t\t\t);\n\t\t\toperationSpan?.setTraceAttributes({\n\t\t\t\tauthenticated: snapshot.authenticated,\n\t\t\t\tboundaryKind: snapshot.boundaryKind,\n\t\t\t});\n\t\t\tthis._emitEvent({\n\t\t\t\ttype: BasicAuthContextEventType.BoundaryRefreshSucceeded,\n\t\t\t\tsnapshot,\n\t\t\t\tzone: snapshot.zone,\n\t\t\t});\n\t\t\treturn snapshot;\n\t\t} catch (error) {\n\t\t\tconst clientError = clientErrorFromBasicAuthError(error, {\n\t\t\t\tspan: operationSpan?.span,\n\t\t\t});\n\t\t\tthis._boundarySnapshotSignal.set(\n\t\t\t\treduceResourceSnapshot(loadingSnapshot, {\n\t\t\t\t\tkind: ResourceSnapshotUpdateKind.Fail,\n\t\t\t\t\terror: clientError,\n\t\t\t\t}),\n\t\t\t);\n\t\t\tthis._emitEvent({\n\t\t\t\ttype: BasicAuthContextEventType.BoundaryRefreshFailed,\n\t\t\t\tsnapshot: this._readCurrentSnapshot(),\n\t\t\t\terror: clientError,\n\t\t\t});\n\t\t\tthrow clientError;\n\t\t} finally {\n\t\t\tthis._operationSignals.refreshPending.set(false);\n\t\t}\n\t}\n\n\tprivate _snapshotFromResponse(\n\t\tpath: string,\n\t\tresponse: { status: number; headers: Record<string, string> },\n\t): BasicAuthBoundarySnapshot {\n\t\tconst challengeHeader =\n\t\t\tresponse.headers[\"WWW-Authenticate\"] ??\n\t\t\tresponse.headers[\"www-authenticate\"] ??\n\t\t\tnull;\n\t\tconst zone = this.zoneForPath(path);\n\t\tconst boundaryKind = readBasicAuthBoundaryKind({\n\t\t\tstatus: response.status,\n\t\t\tchallengeHeader,\n\t\t\trequestPath: path,\n\t\t});\n\t\treturn {\n\t\t\tauthenticated: boundaryKind === BasicAuthBoundaryKindValues.Authenticated,\n\t\t\tboundaryKind,\n\t\t\tstatus: response.status,\n\t\t\tpath,\n\t\t\tchallengeHeader,\n\t\t\tzone,\n\t\t};\n\t}\n\n\tprivate _readCurrentSnapshot(): BasicAuthBoundarySnapshot | null {\n\t\tconst snapshot = this._boundarySnapshotSignal.get();\n\t\treturn snapshot.status === ResourceStatus.Reloading ||\n\t\t\tsnapshot.status === ResourceStatus.Resolved ||\n\t\t\tsnapshot.status === ResourceStatus.Error\n\t\t\t? snapshot.value\n\t\t\t: null;\n\t}\n\n\tprivate _emitEvent(input: BasicAuthContextEventInput): void {\n\t\tthis._eventSubject.next({\n\t\t\t...input,\n\t\t\tat: this._environment.time.now(),\n\t\t\tclient: {\n\t\t\t\tid: this.id,\n\t\t\t},\n\t\t});\n\t}\n}\n","import {\n\tINJECTOR_TOKEN,\n\ttype SecuritydeptInjectorTrait,\n\ttype SecuritydeptProvider,\n} from \"@securitydept/client\";\nimport { BasicAuthContextClient } from \"./client\";\nimport {\n\tBASIC_AUTH_CONTEXT_CLIENT,\n\tBASIC_AUTH_CONTEXT_CLIENT_CONFIG,\n} from \"./tokens\";\nimport { type BasicAuthContextClientConfig } from \"./types\";\n\nexport interface ProvideBasicAuthContextOptions {\n\treadonly config: BasicAuthContextClientConfig;\n}\n\nexport function provideBasicAuthContext(\n\toptions: ProvideBasicAuthContextOptions,\n): readonly SecuritydeptProvider[] {\n\treturn [\n\t\t{\n\t\t\tprovide: BASIC_AUTH_CONTEXT_CLIENT_CONFIG,\n\t\t\tuseValue: options.config,\n\t\t},\n\t\t{\n\t\t\tprovide: BASIC_AUTH_CONTEXT_CLIENT,\n\t\t\tuseFactory: (injector: SecuritydeptInjectorTrait) =>\n\t\t\t\tBasicAuthContextClient.fromInjector(injector),\n\t\t\tdeps: [INJECTOR_TOKEN],\n\t\t},\n\t];\n}\n"],"mappings":";;;;;;AAWA,SAAgBG,oCACfC,SAAmD;CAEnD,IAAIA,QAAQC,SAASC,SAAS,GAAA,GAC7B,MAAM,IAAIN,YAAY;EACrBO,MAAMN,gBAAgBO;EACtBC,MAAM;EACNC,SAAS;EACTC,QAAQ;CACT,CAAA;CAGD,OAAO,SAAST,yBACf,IAAIU,YAAAA,CAAAA,CAAcC,OAAO,GAAGT,QAAQC,SAAS,GAAGD,QAAQU,UAAU,CAAA;AAEpE;;;ACxBA,MAAaE,4BAA4B;CACxCC,iBAAiB;CACjBC,eAAe;CACfC,gBAAgB;CAChBC,mBAAmB;CACnBC,mBAAmB;CACnBC,cAAc;CACdC,cAAc;AACf;AAKA,MAAaC,yBAAyB,EACrCC,kBAAkB,qBACnB;AAKA,SAAgBC,8BACfC,OACAC,SAAwC;CAExC,OAAOb,YAAYc,YAAYF,OAAO;EACrCG,MAAMd,0BAA0BC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,QAAQsJ,SAAStJ;GACjBE;GACAkK,aAAa9C;EACd,CAAA;EACA,OAAO;GACN/C,eAAeyF,iBAAiBzL,sBAA4B0B;GAC5D+J;GACAhK,QAAQsJ,SAAStJ;GACjBsH;GACApH;GACAoG;EACD;CACD;CAEQX,uBAAyD;EAChE,MAAMrB,WAAW,KAAK/C,wBAAwB4B,IAAG;EACjD,OAAOmB,SAAStE,WAAW1D,eAAe+N,aACzC/F,SAAStE,WAAW1D,eAAesJ,YACnCtB,SAAStE,WAAW1D,eAAegO,QACjChG,SAAShD,QACT;CACJ;CAEQkE,WAAW+E,OAAyC;EAC3D,KAAKzI,cAAc0I,KAAK;GACvB,GAAGD;GACHE,IAAI,KAAK3J,aAAa4J,KAAKC,IAAG;GAC9BzH,QAAQ,EACPV,IAAI,KAAKA,GACV;EACD,CAAA;CACD;AACD;;;AC1uBA,SAAgBwI,wBACfC,SAAuC;CAEvC,OAAO,CACN;EACCC,SAASH;EACTI,UAAUF,QAAQG;CACnB,GACA;EACCF,SAASJ;EACTO,aAAaC,aACZT,uBAAuBU,aAAaD,QAAAA;EACrCE,MAAM,CAACZ,cAAe;CACvB,CACA;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@securitydept/basic-auth-context-client",
|
|
3
|
-
"version": "0.3.0-beta.
|
|
3
|
+
"version": "0.3.0-beta.7",
|
|
4
4
|
"description": "Basic Auth Context Client of the SecurityDept TypeScript SDK, a layered authentication and authorization toolkit built as reusable Rust crates, a TypeScript client SDK workspace, and reference server/web apps.",
|
|
5
5
|
"author": "Zhou Yeheng <root@aitiotekt.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"arktype": "^2.2.3",
|
|
41
41
|
"rxjs": "^7.8.2",
|
|
42
42
|
"uuid": "^14.0.1",
|
|
43
|
-
"@securitydept/client": "0.3.0-beta.
|
|
43
|
+
"@securitydept/client": "0.3.0-beta.7"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"vitest": "^4.1.10"
|