@angular-helpers/security 21.2.0 → 21.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, EnvironmentProviders } from '@angular/core';
2
+ import { InjectionToken, Signal, EnvironmentProviders } from '@angular/core';
3
+ import { Observable } from 'rxjs';
4
+ import { HttpInterceptorFn } from '@angular/common/http';
3
5
 
4
6
  interface RegexSecurityConfig {
5
7
  timeout?: number;
@@ -273,6 +275,9 @@ declare const SANITIZER_CONFIG: InjectionToken<SanitizerConfig>;
273
275
  * This service is defense-in-depth and DOES NOT replace a Content Security Policy (CSP).
274
276
  * Always configure a proper CSP alongside using this service.
275
277
  *
278
+ * Delegates to shared pure helpers in `internal/validators-core` so Signal Forms and Reactive Forms
279
+ * validators share the exact same sanitization logic.
280
+ *
276
281
  * @example
277
282
  * const clean = sanitizer.sanitizeHtml('<b>Hello</b><script>alert(1)</script>');
278
283
  * // → '<b>Hello</b>'
@@ -310,22 +315,89 @@ declare class InputSanitizerService {
310
315
  * Does NOT use `eval` or `Function` — uses JSON.parse only.
311
316
  */
312
317
  sanitizeJson(input: string): unknown | null;
313
- private processNode;
314
- private sanitizeAttributes;
315
318
  static ɵfac: i0.ɵɵFactoryDeclaration<InputSanitizerService, never>;
316
319
  static ɵprov: i0.ɵɵInjectableDeclaration<InputSanitizerService>;
317
320
  }
318
321
 
319
- interface PasswordStrengthResult {
320
- score: 0 | 1 | 2 | 3 | 4;
321
- label: 'very-weak' | 'weak' | 'fair' | 'strong' | 'very-strong';
322
+ /**
323
+ * Internal validator helpers shared by both Reactive Forms validators
324
+ * (`SecurityValidators`) and Signal Forms validators (`@angular-helpers/security/signal-forms`).
325
+ *
326
+ * All helpers in this module are pure and side-effect free. Browser-only helpers
327
+ * (those using DOMParser) are clearly marked and throw when called outside a browser.
328
+ *
329
+ * This module is INTERNAL — not part of the public API surface.
330
+ */
331
+ type PasswordScore = 0 | 1 | 2 | 3 | 4;
332
+ type PasswordLabel = 'very-weak' | 'weak' | 'fair' | 'strong' | 'very-strong';
333
+ interface PasswordAssessment {
334
+ score: PasswordScore;
335
+ label: PasswordLabel;
322
336
  entropy: number;
323
337
  feedback: string[];
324
338
  }
339
+ /**
340
+ * Entropy-based password assessment. Pure function — safe to call outside Angular context.
341
+ *
342
+ * Thresholds (bits of entropy):
343
+ * - 0 (very-weak): < 28
344
+ * - 1 (weak): 28–35
345
+ * - 2 (fair): 36–49
346
+ * - 3 (strong): 50–69
347
+ * - 4 (very-strong): ≥ 70
348
+ */
349
+ declare function assessPasswordStrength(password: string): PasswordAssessment;
350
+ /**
351
+ * URL safety check. Returns the normalized URL when the scheme is allowed, `null` otherwise.
352
+ * Malformed URLs, relative URLs, and blocked schemes all return `null`.
353
+ */
354
+ declare function sanitizeUrlString(input: string, allowedSchemes?: readonly string[]): string | null;
355
+ /**
356
+ * Boolean helper around `sanitizeUrlString`. `true` when the URL is well-formed and allowed.
357
+ */
358
+ declare function isUrlSafe(input: string, allowedSchemes?: readonly string[]): boolean;
359
+ /**
360
+ * Lightweight check for common script-injection sentinels. Complements (does NOT replace)
361
+ * a full HTML sanitizer or Content Security Policy.
362
+ */
363
+ declare function containsScriptInjection(input: string): boolean;
364
+ /**
365
+ * Heuristic check for SQL-injection sentinel strings.
366
+ * Intended as defense-in-depth for client-side form inputs; never a substitute for parameterized queries.
367
+ */
368
+ declare function containsSqlInjectionHints(input: string): boolean;
369
+ declare const DEFAULT_ALLOWED_TAGS: readonly string[];
370
+ declare const DEFAULT_ALLOWED_ATTRIBUTES: Readonly<Record<string, readonly string[]>>;
371
+ interface HtmlSanitizerOptions {
372
+ allowedTags?: readonly string[];
373
+ allowedAttributes?: Readonly<Record<string, readonly string[]>>;
374
+ }
375
+ /**
376
+ * Sanitizes an HTML string by allowlist. Browser-only: requires DOMParser.
377
+ *
378
+ * @throws {Error} When called in a non-browser environment.
379
+ */
380
+ declare function sanitizeHtmlString(input: string, options?: HtmlSanitizerOptions): string;
381
+ /**
382
+ * Returns `true` when sanitizing `input` produces the same string (i.e. nothing was stripped).
383
+ * Empty strings are considered safe.
384
+ *
385
+ * @throws {Error} When called in a non-browser environment.
386
+ */
387
+ declare function isHtmlSafe(input: string, options?: HtmlSanitizerOptions): boolean;
388
+
389
+ /**
390
+ * Backwards-compatible alias for the shared {@link PasswordAssessment} type.
391
+ * Kept to preserve the `21.2.0` public API surface.
392
+ */
393
+ type PasswordStrengthResult = PasswordAssessment;
325
394
  /**
326
395
  * Service for entropy-based password strength evaluation.
327
396
  * All methods are synchronous and side-effect free — safely wrappable in Angular `computed()`.
328
397
  *
398
+ * Delegates to the shared {@link assessPasswordStrength} helper so Reactive Forms validators,
399
+ * Signal Forms validators, and direct service consumers all share identical logic.
400
+ *
329
401
  * Score thresholds (bits of entropy):
330
402
  * - 0 (very-weak): < 28 bits
331
403
  * - 1 (weak): 28–35 bits
@@ -345,18 +417,427 @@ declare class PasswordStrengthService {
345
417
  * Never throws — returns score 0 for empty or null-like input.
346
418
  */
347
419
  assess(password: string): PasswordStrengthResult;
348
- private entropyToScore;
349
- private containsSequence;
350
420
  static ɵfac: i0.ɵɵFactoryDeclaration<PasswordStrengthService, never>;
351
421
  static ɵprov: i0.ɵɵInjectableDeclaration<PasswordStrengthService>;
352
422
  }
353
423
 
424
+ /**
425
+ * Thrown when a string is not a well-formed JWT (wrong number of segments,
426
+ * malformed base64url payload, or non-JSON payload).
427
+ */
428
+ declare class InvalidJwtError extends Error {
429
+ constructor(message: string);
430
+ }
431
+ /**
432
+ * Standard JWT registered claims. See RFC 7519.
433
+ */
434
+ interface JwtStandardClaims {
435
+ iss?: string;
436
+ sub?: string;
437
+ aud?: string | string[];
438
+ exp?: number;
439
+ nbf?: number;
440
+ iat?: number;
441
+ jti?: string;
442
+ }
443
+ /**
444
+ * Client-side JWT inspection utilities.
445
+ *
446
+ * **This service decodes JWT payloads for client-side inspection only. Signature verification
447
+ * MUST happen server-side** — this service never validates signatures, issuer, audience,
448
+ * or any trust-related property.
449
+ *
450
+ * Use cases:
451
+ * - Reading the expiration to schedule refresh
452
+ * - Extracting user-facing claims (e.g. `name`, `email`) for UX
453
+ * - Detecting expired tokens to redirect to login
454
+ *
455
+ * @example
456
+ * const token = localStorage.getItem('access_token');
457
+ * if (!token || jwt.isExpired(token, 30)) {
458
+ * router.navigate(['/login']);
459
+ * }
460
+ * const userId = jwt.claim<string>(token, 'sub');
461
+ */
462
+ declare class JwtService {
463
+ /**
464
+ * Decodes the payload segment of a JWT and returns it typed.
465
+ *
466
+ * @throws {InvalidJwtError} When the token is not three dot-separated segments,
467
+ * or when the payload cannot be base64url-decoded and parsed as JSON.
468
+ */
469
+ decode<T extends JwtStandardClaims = JwtStandardClaims>(token: string): T;
470
+ /**
471
+ * Returns `true` when the token is expired relative to `Date.now()`.
472
+ * Missing or non-numeric `exp` counts as expired (fail-secure).
473
+ *
474
+ * @param leewaySeconds Optional clock-skew tolerance in seconds. Default: `0`.
475
+ */
476
+ isExpired(token: string, leewaySeconds?: number): boolean;
477
+ /**
478
+ * Returns milliseconds until the token expires.
479
+ * Negative when already expired. `0` when `exp` is missing.
480
+ */
481
+ expiresIn(token: string): number;
482
+ /**
483
+ * Extracts a single claim from the payload. Returns `null` when the claim is absent
484
+ * or the token is malformed.
485
+ */
486
+ claim<T = unknown>(token: string, name: string): T | null;
487
+ static ɵfac: i0.ɵɵFactoryDeclaration<JwtService, never>;
488
+ static ɵprov: i0.ɵɵInjectableDeclaration<JwtService>;
489
+ }
490
+
491
+ declare class ClipboardUnsupportedError extends Error {
492
+ constructor();
493
+ }
494
+ interface SensitiveCopyOptions {
495
+ /**
496
+ * Milliseconds before the clipboard is automatically cleared.
497
+ * Set to `0` to disable auto-clear. Default: `15000` (15 seconds).
498
+ */
499
+ clearAfterMs?: number;
500
+ }
501
+ type CopyStatus = 'copied' | 'cleared' | 'read-denied' | 'error';
502
+ /**
503
+ * Copies sensitive strings to the clipboard with automatic, verified clearing.
504
+ *
505
+ * Mirrors the behaviour of password managers (1Password, Bitwarden): the clipboard is
506
+ * cleared only when its current content still matches what we wrote, preventing clobbering
507
+ * of unrelated user copies.
508
+ *
509
+ * Requires a secure context and `navigator.clipboard`. The auto-clear step additionally
510
+ * requires `navigator.clipboard.readText()` permission; when denied, the clear is skipped
511
+ * and the status emits `'read-denied'`.
512
+ *
513
+ * Any pending clear timer is cancelled automatically when the owning injector is destroyed.
514
+ *
515
+ * @example
516
+ * await sensitiveClipboard.copy(password, { clearAfterMs: 15_000 });
517
+ */
518
+ declare class SensitiveClipboardService {
519
+ private readonly platformId;
520
+ private readonly destroyRef;
521
+ private pendingTimer;
522
+ constructor();
523
+ isSupported(): boolean;
524
+ /**
525
+ * Writes `text` to the clipboard and schedules an auto-clear.
526
+ *
527
+ * @throws {ClipboardUnsupportedError} When the Clipboard API is unavailable.
528
+ */
529
+ copy(text: string, options?: SensitiveCopyOptions): Promise<void>;
530
+ /**
531
+ * Reactive variant of {@link copy}. Emits `'copied'` immediately after writing, then
532
+ * `'cleared'` | `'read-denied'` | `'error'` once the auto-clear completes (or is skipped).
533
+ */
534
+ copy$(text: string, options?: SensitiveCopyOptions): Observable<CopyStatus>;
535
+ /**
536
+ * Cancels any pending auto-clear timer. The clipboard content is not modified.
537
+ */
538
+ cancelPendingClear(): void;
539
+ private safeClear;
540
+ /**
541
+ * Forcefully clears the clipboard unconditionally.
542
+ */
543
+ clear(): Promise<void>;
544
+ static ɵfac: i0.ɵɵFactoryDeclaration<SensitiveClipboardService, never>;
545
+ static ɵprov: i0.ɵɵInjectableDeclaration<SensitiveClipboardService>;
546
+ }
547
+
548
+ interface HibpConfig {
549
+ /**
550
+ * Base URL for the HIBP Pwned Passwords range API.
551
+ * Default: `https://api.pwnedpasswords.com/range/`.
552
+ * Override when routing through an enterprise proxy or test fixture.
553
+ */
554
+ endpoint?: string;
555
+ }
556
+ declare const HIBP_CONFIG: InjectionToken<HibpConfig>;
557
+ /**
558
+ * Result of a leaked-password lookup.
559
+ *
560
+ * - `leaked: true` — the password hash was found in the HIBP breach corpus
561
+ * - `leaked: false` — password is not known to be leaked (either truly safe, or the lookup failed)
562
+ * - `error: 'network'` — HIBP endpoint unreachable; defaults to `leaked: false` (fail-open)
563
+ * - `error: 'unsupported'` — running outside a secure browser context
564
+ */
565
+ interface HibpResult {
566
+ leaked: boolean;
567
+ count: number;
568
+ error?: 'network' | 'unsupported';
569
+ }
570
+ /**
571
+ * Checks whether a password appears in the Have I Been Pwned breach corpus using the
572
+ * k-anonymity API. Only the first 5 hex characters of the SHA-1 hash leave the browser;
573
+ * the full password is never transmitted.
574
+ *
575
+ * The service is fail-open: network errors return `{ leaked: false, error: 'network' }`
576
+ * to avoid blocking form submissions when HIBP is unreachable. Use this signal to
577
+ * *complement* entropy-based checks, never as the sole gate.
578
+ *
579
+ * @example
580
+ * const { leaked, count } = await hibp.isPasswordLeaked(password);
581
+ * if (leaked) alert(`This password has appeared in ${count} breaches`);
582
+ */
583
+ declare class HibpService {
584
+ private readonly platformId;
585
+ private readonly webCrypto;
586
+ private readonly endpoint;
587
+ constructor();
588
+ isSupported(): boolean;
589
+ /**
590
+ * Returns whether the given password is present in the HIBP breach corpus.
591
+ * Never throws: network failures return `{ leaked: false, error: 'network' }`,
592
+ * unsupported environments return `{ leaked: false, error: 'unsupported' }`.
593
+ */
594
+ isPasswordLeaked(password: string): Promise<HibpResult>;
595
+ static ɵfac: i0.ɵɵFactoryDeclaration<HibpService, never>;
596
+ static ɵprov: i0.ɵɵInjectableDeclaration<HibpService>;
597
+ }
598
+
599
+ type RateLimitPolicy = {
600
+ type: 'token-bucket';
601
+ capacity: number;
602
+ refillPerSecond: number;
603
+ } | {
604
+ type: 'sliding-window';
605
+ max: number;
606
+ windowMs: number;
607
+ };
608
+ interface RateLimiterConfig {
609
+ /**
610
+ * Policies registered at bootstrap. Can also be set at runtime via
611
+ * {@link RateLimiterService.configure}.
612
+ */
613
+ defaults?: Record<string, RateLimitPolicy>;
614
+ }
615
+ declare const RATE_LIMITER_CONFIG: InjectionToken<RateLimiterConfig>;
616
+ /**
617
+ * Thrown by {@link RateLimiterService.consume} when the configured capacity is exhausted.
618
+ */
619
+ declare class RateLimitExceededError extends Error {
620
+ readonly key: string;
621
+ readonly retryAfterMs: number;
622
+ constructor(key: string, retryAfterMs: number);
623
+ }
624
+ /**
625
+ * Client-side rate limiter with per-key policies. Use to protect the user's own backend
626
+ * from accidental bursts (search-as-you-type, button mashing, automated retries) or to
627
+ * pace client-side operations.
628
+ *
629
+ * Two policies are supported:
630
+ * - **Token bucket**: smooth rate limiting with burst capacity.
631
+ * - **Sliding window**: strict max operations per time window.
632
+ *
633
+ * Unknown keys are fail-open: `canExecute` returns `true`, `consume` is a no-op. Register
634
+ * policies explicitly with {@link configure} or via the `RATE_LIMITER_CONFIG` token.
635
+ *
636
+ * All state is kept in memory for the lifetime of the service instance — cross-tab
637
+ * synchronization is out of scope for v1.
638
+ *
639
+ * @example
640
+ * rateLimiter.configure('search', { type: 'token-bucket', capacity: 5, refillPerSecond: 1 });
641
+ *
642
+ * async search(query: string) {
643
+ * await rateLimiter.consume('search'); // throws RateLimitExceededError when exhausted
644
+ * return this.api.search(query);
645
+ * }
646
+ */
647
+ declare class RateLimiterService {
648
+ private readonly destroyRef;
649
+ private readonly buckets;
650
+ constructor();
651
+ /**
652
+ * Registers or updates the policy for `key`. Re-configuring an existing key resets its state.
653
+ */
654
+ configure(key: string, policy: RateLimitPolicy): void;
655
+ /**
656
+ * Attempts to consume `tokens` units from the bucket. Resolves on success; rejects with
657
+ * {@link RateLimitExceededError} when the bucket is exhausted.
658
+ *
659
+ * For undeclared keys, this method resolves immediately without consuming anything
660
+ * (fail-open behaviour — intentional to avoid silent failures when a policy is missing).
661
+ */
662
+ consume(key: string, tokens?: number): Promise<void>;
663
+ /**
664
+ * Reactive signal indicating whether a single unit can be consumed from `key` right now.
665
+ * For undeclared keys, returns `signal(true)`.
666
+ */
667
+ canExecute(key: string): Signal<boolean>;
668
+ /**
669
+ * Reactive signal holding the remaining capacity for `key`.
670
+ * For undeclared keys, returns `signal(Infinity)`.
671
+ */
672
+ remaining(key: string): Signal<number>;
673
+ /**
674
+ * Resets the counter for `key` to its maximum. No-op for undeclared keys.
675
+ */
676
+ reset(key: string): void;
677
+ private refillTokenBucket;
678
+ static ɵfac: i0.ɵɵFactoryDeclaration<RateLimiterService, never>;
679
+ static ɵprov: i0.ɵɵInjectableDeclaration<RateLimiterService>;
680
+ }
681
+
682
+ type CsrfStorageTarget = 'local' | 'session';
683
+ type HttpMethod = 'POST' | 'PUT' | 'PATCH' | 'DELETE';
684
+ interface CsrfConfig {
685
+ /** Storage used to persist the token. Default: `'session'`. */
686
+ storage?: CsrfStorageTarget;
687
+ /** Storage key. Default: `'__csrf_token__'`. */
688
+ storageKey?: string;
689
+ }
690
+ declare const CSRF_CONFIG: InjectionToken<CsrfConfig>;
691
+ /**
692
+ * CSRF token helper using the double-submit cookie / header pattern.
693
+ *
694
+ * The service stores a cryptographically secure token in the configured storage and exposes
695
+ * it to HTTP interceptors ({@link withCsrfHeader}). Token lifecycle (creation, rotation,
696
+ * clearing) is the application's responsibility — typically the token is issued by the
697
+ * backend at login and stored via {@link storeToken}.
698
+ *
699
+ * Use a different header name than Angular's built-in XSRF ({@link `X-XSRF-TOKEN`}) to avoid
700
+ * interaction with `HttpClientXsrfModule`. Default: {@link `X-CSRF-Token`}.
701
+ */
702
+ declare class CsrfService {
703
+ private readonly platformId;
704
+ private readonly webCrypto;
705
+ private readonly storageKey;
706
+ private readonly storageTarget;
707
+ constructor();
708
+ isSupported(): boolean;
709
+ /**
710
+ * Generates a new CSRF token as a 32-byte hex string. The token is NOT persisted
711
+ * automatically — call {@link storeToken} to save it.
712
+ */
713
+ generateToken(): string;
714
+ /**
715
+ * Persists the token to the configured storage.
716
+ */
717
+ storeToken(token: string): void;
718
+ /**
719
+ * Returns the stored token, or `null` when unset or outside a browser environment.
720
+ */
721
+ getToken(): string | null;
722
+ /**
723
+ * Removes the stored token.
724
+ */
725
+ clearToken(): void;
726
+ private get nativeStorage();
727
+ static ɵfac: i0.ɵɵFactoryDeclaration<CsrfService, never>;
728
+ static ɵprov: i0.ɵɵInjectableDeclaration<CsrfService>;
729
+ }
730
+ interface CsrfHeaderOptions {
731
+ /** Header name to inject. Default: `'X-CSRF-Token'`. */
732
+ headerName?: string;
733
+ /** HTTP methods on which the header is injected. Default: `['POST','PUT','PATCH','DELETE']`. */
734
+ methods?: readonly HttpMethod[];
735
+ }
736
+ /**
737
+ * Functional HTTP interceptor that injects the current CSRF token as a request header on
738
+ * state-changing methods. When the token is absent, the header is omitted silently.
739
+ *
740
+ * Register via `provideHttpClient(withInterceptors([withCsrfHeader()]))`.
741
+ *
742
+ * @example
743
+ * bootstrapApplication(App, {
744
+ * providers: [
745
+ * provideSecurity({ enableCsrf: true }),
746
+ * provideHttpClient(withInterceptors([withCsrfHeader()])),
747
+ * ],
748
+ * });
749
+ */
750
+ declare function withCsrfHeader(options?: CsrfHeaderOptions): HttpInterceptorFn;
751
+
752
+ interface SessionIdleConfig {
753
+ timeoutMs: number;
754
+ warningThresholdMs?: number;
755
+ autoClearStorage?: boolean;
756
+ autoClearClipboard?: boolean;
757
+ events?: string[];
758
+ }
759
+ declare class SessionIdleService {
760
+ private ngZone;
761
+ private document;
762
+ private injector;
763
+ private destroyRef;
764
+ private _isIdle;
765
+ private _isWarning;
766
+ private _timeRemaining;
767
+ private _timeoutSubject;
768
+ readonly isIdle: Signal<boolean>;
769
+ readonly isWarning: Signal<boolean>;
770
+ readonly timeRemaining: Signal<number | null>;
771
+ readonly onTimeout: Observable<void>;
772
+ private config;
773
+ private lastActivityTime;
774
+ private timerInterval;
775
+ private eventSubscription?;
776
+ constructor();
777
+ start(config: SessionIdleConfig): void;
778
+ stop(): void;
779
+ reset(): void;
780
+ private checkIdle;
781
+ private triggerTimeout;
782
+ static ɵfac: i0.ɵɵFactoryDeclaration<SessionIdleService, never>;
783
+ static ɵprov: i0.ɵɵInjectableDeclaration<SessionIdleService>;
784
+ }
785
+
786
+ interface SecureMessageConfig {
787
+ allowedOrigins: string[];
788
+ signingKey: CryptoKey;
789
+ }
790
+ interface SecureMessage<T = unknown> {
791
+ data: T;
792
+ origin: string;
793
+ timestamp: number;
794
+ }
795
+ declare class SecureMessageService {
796
+ private readonly ngZone;
797
+ private readonly platformId;
798
+ private readonly document;
799
+ private readonly crypto;
800
+ private config;
801
+ private _lastMessage;
802
+ private _messages$;
803
+ private messageHandler;
804
+ private get targetWindow();
805
+ /** Returns a new HMAC-SHA-256 CryptoKey ready to use in `configure()`. */
806
+ generateChannelKey(): Promise<CryptoKey>;
807
+ /**
808
+ * Configures the service with a signing key and allowed origins.
809
+ * Starts listening for incoming messages.
810
+ */
811
+ configure(config: SecureMessageConfig): void;
812
+ /**
813
+ * Signs and sends a payload to a target window.
814
+ * @throws if `targetOrigin` is `'*'`
815
+ */
816
+ send<T>(target: Window, payload: T, targetOrigin: string): Promise<void>;
817
+ /** Observable of verified incoming messages. */
818
+ messages$<T = unknown>(): Observable<SecureMessage<T>>;
819
+ /** Signal with the last verified incoming message (null before first message). */
820
+ lastMessage<T = unknown>(): Signal<SecureMessage<T> | null>;
821
+ /** Removes the window listener and completes the internal Subject. */
822
+ destroy(): void;
823
+ private handleMessage;
824
+ static ɵfac: i0.ɵɵFactoryDeclaration<SecureMessageService, never>;
825
+ static ɵprov: i0.ɵɵInjectableDeclaration<SecureMessageService>;
826
+ }
827
+
354
828
  interface SecurityConfig {
355
829
  enableRegexSecurity?: boolean;
356
830
  enableWebCrypto?: boolean;
357
831
  enableSecureStorage?: boolean;
358
832
  enableInputSanitizer?: boolean;
359
833
  enablePasswordStrength?: boolean;
834
+ enableJwt?: boolean;
835
+ enableSensitiveClipboard?: boolean;
836
+ enableHibp?: boolean;
837
+ enableRateLimiter?: boolean;
838
+ enableCsrf?: boolean;
839
+ enableSessionIdle?: boolean;
840
+ enableSecureMessage?: boolean;
360
841
  defaultTimeout?: number;
361
842
  safeMode?: boolean;
362
843
  }
@@ -367,6 +848,13 @@ declare function provideWebCrypto(): EnvironmentProviders;
367
848
  declare function provideSecureStorage(config?: SecureStorageConfig): EnvironmentProviders;
368
849
  declare function provideInputSanitizer(config?: SanitizerConfig): EnvironmentProviders;
369
850
  declare function providePasswordStrength(): EnvironmentProviders;
851
+ declare function provideJwt(): EnvironmentProviders;
852
+ declare function provideSensitiveClipboard(): EnvironmentProviders;
853
+ declare function provideHibp(config?: HibpConfig): EnvironmentProviders;
854
+ declare function provideRateLimiter(config?: RateLimiterConfig): EnvironmentProviders;
855
+ declare function provideCsrf(config?: CsrfConfig): EnvironmentProviders;
856
+ declare function provideSessionIdle(): EnvironmentProviders;
857
+ declare function provideSecureMessage(): EnvironmentProviders;
370
858
 
371
- export { InputSanitizerService, PasswordStrengthService, RegexSecurityBuilder, RegexSecurityService, SANITIZER_CONFIG, SECURE_STORAGE_CONFIG, SecureStorageService, WebCryptoService, defaultSecurityConfig, provideInputSanitizer, providePasswordStrength, provideRegexSecurity, provideSecureStorage, provideSecurity, provideWebCrypto };
372
- export type { AesEncryptResult, AesKeyLength, HashAlgorithm, HmacAlgorithm, PasswordStrengthResult, RegexBuilderOptions, RegexSecurityConfig, RegexSecurityResult, RegexTestResult, SanitizerConfig, SecureStorageConfig, SecurityConfig, StorageTarget };
859
+ export { CSRF_CONFIG, ClipboardUnsupportedError, CsrfService, DEFAULT_ALLOWED_ATTRIBUTES, DEFAULT_ALLOWED_TAGS, HIBP_CONFIG, HibpService, InputSanitizerService, InvalidJwtError, JwtService, PasswordStrengthService, RATE_LIMITER_CONFIG, RateLimitExceededError, RateLimiterService, RegexSecurityBuilder, RegexSecurityService, SANITIZER_CONFIG, SECURE_STORAGE_CONFIG, SecureMessageService, SecureStorageService, SensitiveClipboardService, SessionIdleService, WebCryptoService, assessPasswordStrength, containsScriptInjection, containsSqlInjectionHints, defaultSecurityConfig, isHtmlSafe, isUrlSafe, provideCsrf, provideHibp, provideInputSanitizer, provideJwt, providePasswordStrength, provideRateLimiter, provideRegexSecurity, provideSecureMessage, provideSecureStorage, provideSecurity, provideSensitiveClipboard, provideSessionIdle, provideWebCrypto, sanitizeHtmlString, sanitizeUrlString, withCsrfHeader };
860
+ export type { AesEncryptResult, AesKeyLength, CopyStatus, CsrfConfig, CsrfHeaderOptions, CsrfStorageTarget, HashAlgorithm, HibpConfig, HibpResult, HmacAlgorithm, HtmlSanitizerOptions, HttpMethod, JwtStandardClaims, PasswordAssessment, PasswordLabel, PasswordScore, PasswordStrengthResult, RateLimitPolicy, RateLimiterConfig, RegexBuilderOptions, RegexSecurityConfig, RegexSecurityResult, RegexTestResult, SanitizerConfig, SecureMessage, SecureMessageConfig, SecureStorageConfig, SecurityConfig, SensitiveCopyOptions, SessionIdleConfig, StorageTarget };