@stackwright-pro/auth 0.2.0-alpha.4 → 0.2.0-alpha.5
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/LICENSE +21 -0
- package/dist/index.d.mts +131 -3
- package/dist/index.d.ts +131 -3
- package/dist/index.js +409 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +403 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
PROPRIETARY SOFTWARE LICENSE
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2026 Per Aspera LLC. All Rights Reserved.
|
|
4
|
+
|
|
5
|
+
This software and associated documentation files (the "Software") are the
|
|
6
|
+
proprietary and confidential property of Per Aspera LLC ("Company").
|
|
7
|
+
|
|
8
|
+
RESTRICTIONS: You may not use, copy, modify, merge, publish, distribute,
|
|
9
|
+
sublicense, sell, or otherwise exploit this Software or any portion thereof
|
|
10
|
+
without the express prior written consent of the Company.
|
|
11
|
+
|
|
12
|
+
GOVERNMENT USE: Use, duplication, or disclosure by the U.S. Government is
|
|
13
|
+
subject to restrictions as set forth in FAR 52.227-19 (Commercial Computer
|
|
14
|
+
Software - Restricted Rights) and DFARS 252.227-7013 (Rights in Technical
|
|
15
|
+
Data and Computer Software), as applicable.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED. IN NO EVENT SHALL THE COMPANY BE LIABLE FOR ANY CLAIM, DAMAGES, OR
|
|
19
|
+
OTHER LIABILITY ARISING FROM THE USE OF THE SOFTWARE.
|
|
20
|
+
|
|
21
|
+
For licensing inquiries: legal@peraspera.com
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AuthProvider as AuthProvider$1, PKIConfig, AuthContext as AuthContext$1, AuthUser, AuthSession, OIDCConfig, RBACConfig, ComponentAuthConfig } from '@stackwright-pro/types';
|
|
2
|
-
export { AuthConfig, AuthSession, AuthUser, ComponentAuthConfig, OIDCConfig, PKIConfig, RBACConfig, authConfigSchema, authSessionSchema, authUserSchema, componentAuthSchema, oidcConfigSchema, pkiConfigSchema, rbacConfigSchema } from '@stackwright-pro/types';
|
|
1
|
+
import { AuthProvider as AuthProvider$1, PKIConfig, AuthContext as AuthContext$1, AuthUser, AuthSession, OIDCConfig, RBACConfig, ComponentAuthConfig, CertRevocationConfig } from '@stackwright-pro/types';
|
|
2
|
+
export { AuthConfig, AuthSession, AuthUser, CertRevocationConfig, ComponentAuthConfig, OIDCConfig, PKIConfig, RBACConfig, authConfigSchema, authSessionSchema, authUserSchema, componentAuthSchema, oidcConfigSchema, pkiConfigSchema, rbacConfigSchema } from '@stackwright-pro/types';
|
|
3
3
|
import { X509Certificate } from '@peculiar/x509';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import React__default, { ReactNode, ReactElement } from 'react';
|
|
@@ -32,6 +32,8 @@ declare enum AuditEventType {
|
|
|
32
32
|
PKI_CERT_VALIDATED = "pki.cert.validated",
|
|
33
33
|
PKI_CERT_REJECTED = "pki.cert.rejected",
|
|
34
34
|
PKI_HEADER_SIG_FAILED = "pki.header_sig.failed",
|
|
35
|
+
PKI_CERT_REVOKED = "pki.cert.revoked",
|
|
36
|
+
PKI_REVOCATION_CHECK_FAILED = "pki.revocation_check.failed",
|
|
35
37
|
OIDC_STATE_MISMATCH = "oidc.state_mismatch",
|
|
36
38
|
OIDC_TOKEN_EXCHANGE = "oidc.token_exchange",
|
|
37
39
|
OIDC_NONCE_MISMATCH = "oidc.nonce_mismatch"
|
|
@@ -108,6 +110,7 @@ declare function createAuditEvent(type: AuditEventType, outcome: 'success' | 'fa
|
|
|
108
110
|
declare class PKIProvider implements AuthProvider$1 {
|
|
109
111
|
private config;
|
|
110
112
|
private auditLogger?;
|
|
113
|
+
private revocationChecker;
|
|
111
114
|
constructor(config: PKIConfig, auditLogger?: AuditLogger);
|
|
112
115
|
authenticate(context: AuthContext$1): Promise<AuthUser | null>;
|
|
113
116
|
validate(session: AuthSession): Promise<boolean>;
|
|
@@ -903,6 +906,131 @@ declare function verifyCertHeaders(headers: Record<string, string | undefined>,
|
|
|
903
906
|
reason?: string;
|
|
904
907
|
};
|
|
905
908
|
|
|
909
|
+
/**
|
|
910
|
+
* Certificate Revocation Checking
|
|
911
|
+
*
|
|
912
|
+
* Pluggable OCSP and CRL revocation checking for X.509 certificates.
|
|
913
|
+
* Designed for government/DoD deployments requiring IL-4 compliance.
|
|
914
|
+
*
|
|
915
|
+
* Architecture:
|
|
916
|
+
* - CertRevocationChecker interface — all strategies implement this
|
|
917
|
+
* - OCSPRevocationChecker — queries an OCSP responder via HTTP GET
|
|
918
|
+
* - CRLRevocationChecker — fetches and parses a CRL distribution point
|
|
919
|
+
* - CompositeRevocationChecker — OCSP with CRL fallback
|
|
920
|
+
* - SkipRevocationChecker — passthrough (document that gateway handles it)
|
|
921
|
+
* - RevocationCache — simple TTL cache keyed by serial number
|
|
922
|
+
*
|
|
923
|
+
* Note on gateway_headers source:
|
|
924
|
+
* When PKI source is 'gateway_headers', the application only receives parsed
|
|
925
|
+
* certificate fields — not the raw PEM. OCSP CertID construction requires
|
|
926
|
+
* the issuer's public key hash (issuerKeyHash), which is not available from
|
|
927
|
+
* headers alone. For OCSP with gateway_headers, you MUST configure
|
|
928
|
+
* ocspResponderUrl AND the checker will construct a simplified GET request
|
|
929
|
+
* using the serial number. For full RFC-6960 compliance with direct_tls,
|
|
930
|
+
* the certPem is used to extract AIA and construct the proper CertID.
|
|
931
|
+
*/
|
|
932
|
+
|
|
933
|
+
interface RevocationInput {
|
|
934
|
+
/** Certificate serial number (hex string, e.g. '1234ABCDEF') */
|
|
935
|
+
serialNumber: string;
|
|
936
|
+
/** Issuer common name if known (from parsed cert) */
|
|
937
|
+
issuerName?: string;
|
|
938
|
+
/** Full certificate PEM — available for direct_tls source only */
|
|
939
|
+
certPem?: string;
|
|
940
|
+
}
|
|
941
|
+
type RevocationStatus = {
|
|
942
|
+
revoked: false;
|
|
943
|
+
} | {
|
|
944
|
+
revoked: true;
|
|
945
|
+
reason?: string;
|
|
946
|
+
revokedAt?: Date;
|
|
947
|
+
} | {
|
|
948
|
+
revoked: false;
|
|
949
|
+
skipped: true;
|
|
950
|
+
reason: string;
|
|
951
|
+
};
|
|
952
|
+
interface CertRevocationChecker {
|
|
953
|
+
/**
|
|
954
|
+
* Check whether a certificate has been revoked.
|
|
955
|
+
* @returns RevocationStatus — { revoked: true } means reject the cert.
|
|
956
|
+
* @throws May throw if hardFail is true and the check cannot be completed.
|
|
957
|
+
*/
|
|
958
|
+
check(input: RevocationInput): Promise<RevocationStatus>;
|
|
959
|
+
}
|
|
960
|
+
declare class RevocationCache {
|
|
961
|
+
private readonly store;
|
|
962
|
+
private readonly maxAgeMs;
|
|
963
|
+
constructor(cacheMaxAgeSecs?: number);
|
|
964
|
+
get(serialNumber: string): RevocationStatus | null;
|
|
965
|
+
set(serialNumber: string, status: RevocationStatus): void;
|
|
966
|
+
/** Invalidate a single entry (e.g. after a forced re-check) */
|
|
967
|
+
invalidate(serialNumber: string): void;
|
|
968
|
+
/** Number of cached entries (for testing/monitoring) */
|
|
969
|
+
get size(): number;
|
|
970
|
+
}
|
|
971
|
+
declare class SkipRevocationChecker implements CertRevocationChecker {
|
|
972
|
+
private readonly reason;
|
|
973
|
+
constructor(reason?: string);
|
|
974
|
+
check(_input: RevocationInput): Promise<RevocationStatus>;
|
|
975
|
+
}
|
|
976
|
+
/**
|
|
977
|
+
* CRL revocation checker.
|
|
978
|
+
*
|
|
979
|
+
* Fetches a Certificate Revocation List from a distribution point URL
|
|
980
|
+
* and checks whether the certificate serial number appears in it.
|
|
981
|
+
*
|
|
982
|
+
* CRL format: DER-encoded X.509 CRL (RFC 5280). The revoked certificate
|
|
983
|
+
* list is an ASN.1 SEQUENCE of TBSCertList entries, each containing a
|
|
984
|
+
* serial number as an ASN.1 INTEGER.
|
|
985
|
+
*
|
|
986
|
+
* This implementation parses just the serial numbers from the DER blob
|
|
987
|
+
* using manual ASN.1 traversal — no additional dependencies needed.
|
|
988
|
+
*/
|
|
989
|
+
declare class CRLRevocationChecker implements CertRevocationChecker {
|
|
990
|
+
private readonly cache;
|
|
991
|
+
private readonly config;
|
|
992
|
+
constructor(config: CertRevocationConfig);
|
|
993
|
+
check(input: RevocationInput): Promise<RevocationStatus>;
|
|
994
|
+
/** Exposed for testing */
|
|
995
|
+
get _cache(): RevocationCache;
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* OCSP revocation checker (RFC 6960).
|
|
999
|
+
*
|
|
1000
|
+
* Constructs and sends an OCSP GET request to the configured responder.
|
|
1001
|
+
* Uses SHA-1 for CertID hashing (per RFC 6960 — SHA-1 is mandated for
|
|
1002
|
+
* CertID even though it's deprecated for other uses).
|
|
1003
|
+
*
|
|
1004
|
+
* For gateway_headers source: requires ocspResponderUrl in config.
|
|
1005
|
+
* The serial number is included in the request; issuerNameHash and
|
|
1006
|
+
* issuerKeyHash are derived from the CA chain if provided, or zeroed
|
|
1007
|
+
* (some OCSP responders accept this for simple serial lookups).
|
|
1008
|
+
*
|
|
1009
|
+
* For direct_tls source: certPem in RevocationInput enables full
|
|
1010
|
+
* CertID construction per RFC 6960.
|
|
1011
|
+
*/
|
|
1012
|
+
declare class OCSPRevocationChecker implements CertRevocationChecker {
|
|
1013
|
+
private readonly cache;
|
|
1014
|
+
private readonly config;
|
|
1015
|
+
constructor(config: CertRevocationConfig);
|
|
1016
|
+
check(input: RevocationInput): Promise<RevocationStatus>;
|
|
1017
|
+
/** Exposed for testing */
|
|
1018
|
+
get _cache(): RevocationCache;
|
|
1019
|
+
}
|
|
1020
|
+
declare class CompositeRevocationChecker implements CertRevocationChecker {
|
|
1021
|
+
private readonly ocsp;
|
|
1022
|
+
private readonly crl;
|
|
1023
|
+
constructor(config: CertRevocationConfig);
|
|
1024
|
+
check(input: RevocationInput): Promise<RevocationStatus>;
|
|
1025
|
+
}
|
|
1026
|
+
declare function createRevocationChecker(config: CertRevocationConfig): CertRevocationChecker;
|
|
1027
|
+
/**
|
|
1028
|
+
* Normalize a certificate serial number to uppercase hex without leading zeros
|
|
1029
|
+
* for consistent comparison.
|
|
1030
|
+
* Handles formats: '1234abcd', '12:34:ab:cd', '0x1234abcd'
|
|
1031
|
+
*/
|
|
1032
|
+
declare function normalizeSerial(serial: string): string;
|
|
1033
|
+
|
|
906
1034
|
/**
|
|
907
1035
|
* DoD CAC Profile Configuration
|
|
908
1036
|
*
|
|
@@ -1050,4 +1178,4 @@ declare function hasAuthConfig(item: any): item is {
|
|
|
1050
1178
|
auth: ComponentAuthConfig;
|
|
1051
1179
|
};
|
|
1052
1180
|
|
|
1053
|
-
export { type AuditEvent, AuditEventType, type AuditLogger, AuthContext, type AuthContextValue, AuthProvider, type AuthProviderProps, type AuthorizationRequest, type BuildAuthorizationUrlOptions, type ComponentProps, CompositeAuditLogger, ConsoleAuditLogger, type CookieOptions, DOD_CAC_PROFILE, type HeaderSigningConfig, InMemoryRevocationStore, KeycloakAdapter, NoopAuditLogger, type OIDCMetadata, OIDCProvider, PKIProvider, type ParsedCertificate, RBACEngine, type RevocationStore, SessionManager, type SessionManagerConfig, type TokenSet, buildAuthorizationUrl, clearCookie, createAuditEvent, createDoDCACConfig, createDoDCACDevConfig, decryptToken, deriveEncryptionKey, discoverOIDC, encryptToken, exchangeCodeForTokens, extractEDIPI, generateCodeChallenge, generateCodeVerifier, generateJti, generateNonce, generateState, getAuthDecorator, hasAuthConfig, maybeWrapWithAuth, parseCertFromHeaders, parseCertificate, parseCookies, refreshAccessToken, registerAuthDecorator, serializeCookie, signCertHeaders, useAuth, useRequireAuth, validateDoDCAC, validateIdToken, verifyCertHeaders, verifyState, withAuth, withAuthFallback };
|
|
1181
|
+
export { type AuditEvent, AuditEventType, type AuditLogger, AuthContext, type AuthContextValue, AuthProvider, type AuthProviderProps, type AuthorizationRequest, type BuildAuthorizationUrlOptions, CRLRevocationChecker, type CertRevocationChecker, type ComponentProps, CompositeAuditLogger, CompositeRevocationChecker, ConsoleAuditLogger, type CookieOptions, DOD_CAC_PROFILE, type HeaderSigningConfig, InMemoryRevocationStore, KeycloakAdapter, NoopAuditLogger, OCSPRevocationChecker, type OIDCMetadata, OIDCProvider, PKIProvider, type ParsedCertificate, RBACEngine, RevocationCache, type RevocationInput, type RevocationStatus, type RevocationStore, SessionManager, type SessionManagerConfig, SkipRevocationChecker, type TokenSet, buildAuthorizationUrl, clearCookie, createAuditEvent, createDoDCACConfig, createDoDCACDevConfig, createRevocationChecker, decryptToken, deriveEncryptionKey, discoverOIDC, encryptToken, exchangeCodeForTokens, extractEDIPI, generateCodeChallenge, generateCodeVerifier, generateJti, generateNonce, generateState, getAuthDecorator, hasAuthConfig, maybeWrapWithAuth, normalizeSerial, parseCertFromHeaders, parseCertificate, parseCookies, refreshAccessToken, registerAuthDecorator, serializeCookie, signCertHeaders, useAuth, useRequireAuth, validateDoDCAC, validateIdToken, verifyCertHeaders, verifyState, withAuth, withAuthFallback };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AuthProvider as AuthProvider$1, PKIConfig, AuthContext as AuthContext$1, AuthUser, AuthSession, OIDCConfig, RBACConfig, ComponentAuthConfig } from '@stackwright-pro/types';
|
|
2
|
-
export { AuthConfig, AuthSession, AuthUser, ComponentAuthConfig, OIDCConfig, PKIConfig, RBACConfig, authConfigSchema, authSessionSchema, authUserSchema, componentAuthSchema, oidcConfigSchema, pkiConfigSchema, rbacConfigSchema } from '@stackwright-pro/types';
|
|
1
|
+
import { AuthProvider as AuthProvider$1, PKIConfig, AuthContext as AuthContext$1, AuthUser, AuthSession, OIDCConfig, RBACConfig, ComponentAuthConfig, CertRevocationConfig } from '@stackwright-pro/types';
|
|
2
|
+
export { AuthConfig, AuthSession, AuthUser, CertRevocationConfig, ComponentAuthConfig, OIDCConfig, PKIConfig, RBACConfig, authConfigSchema, authSessionSchema, authUserSchema, componentAuthSchema, oidcConfigSchema, pkiConfigSchema, rbacConfigSchema } from '@stackwright-pro/types';
|
|
3
3
|
import { X509Certificate } from '@peculiar/x509';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import React__default, { ReactNode, ReactElement } from 'react';
|
|
@@ -32,6 +32,8 @@ declare enum AuditEventType {
|
|
|
32
32
|
PKI_CERT_VALIDATED = "pki.cert.validated",
|
|
33
33
|
PKI_CERT_REJECTED = "pki.cert.rejected",
|
|
34
34
|
PKI_HEADER_SIG_FAILED = "pki.header_sig.failed",
|
|
35
|
+
PKI_CERT_REVOKED = "pki.cert.revoked",
|
|
36
|
+
PKI_REVOCATION_CHECK_FAILED = "pki.revocation_check.failed",
|
|
35
37
|
OIDC_STATE_MISMATCH = "oidc.state_mismatch",
|
|
36
38
|
OIDC_TOKEN_EXCHANGE = "oidc.token_exchange",
|
|
37
39
|
OIDC_NONCE_MISMATCH = "oidc.nonce_mismatch"
|
|
@@ -108,6 +110,7 @@ declare function createAuditEvent(type: AuditEventType, outcome: 'success' | 'fa
|
|
|
108
110
|
declare class PKIProvider implements AuthProvider$1 {
|
|
109
111
|
private config;
|
|
110
112
|
private auditLogger?;
|
|
113
|
+
private revocationChecker;
|
|
111
114
|
constructor(config: PKIConfig, auditLogger?: AuditLogger);
|
|
112
115
|
authenticate(context: AuthContext$1): Promise<AuthUser | null>;
|
|
113
116
|
validate(session: AuthSession): Promise<boolean>;
|
|
@@ -903,6 +906,131 @@ declare function verifyCertHeaders(headers: Record<string, string | undefined>,
|
|
|
903
906
|
reason?: string;
|
|
904
907
|
};
|
|
905
908
|
|
|
909
|
+
/**
|
|
910
|
+
* Certificate Revocation Checking
|
|
911
|
+
*
|
|
912
|
+
* Pluggable OCSP and CRL revocation checking for X.509 certificates.
|
|
913
|
+
* Designed for government/DoD deployments requiring IL-4 compliance.
|
|
914
|
+
*
|
|
915
|
+
* Architecture:
|
|
916
|
+
* - CertRevocationChecker interface — all strategies implement this
|
|
917
|
+
* - OCSPRevocationChecker — queries an OCSP responder via HTTP GET
|
|
918
|
+
* - CRLRevocationChecker — fetches and parses a CRL distribution point
|
|
919
|
+
* - CompositeRevocationChecker — OCSP with CRL fallback
|
|
920
|
+
* - SkipRevocationChecker — passthrough (document that gateway handles it)
|
|
921
|
+
* - RevocationCache — simple TTL cache keyed by serial number
|
|
922
|
+
*
|
|
923
|
+
* Note on gateway_headers source:
|
|
924
|
+
* When PKI source is 'gateway_headers', the application only receives parsed
|
|
925
|
+
* certificate fields — not the raw PEM. OCSP CertID construction requires
|
|
926
|
+
* the issuer's public key hash (issuerKeyHash), which is not available from
|
|
927
|
+
* headers alone. For OCSP with gateway_headers, you MUST configure
|
|
928
|
+
* ocspResponderUrl AND the checker will construct a simplified GET request
|
|
929
|
+
* using the serial number. For full RFC-6960 compliance with direct_tls,
|
|
930
|
+
* the certPem is used to extract AIA and construct the proper CertID.
|
|
931
|
+
*/
|
|
932
|
+
|
|
933
|
+
interface RevocationInput {
|
|
934
|
+
/** Certificate serial number (hex string, e.g. '1234ABCDEF') */
|
|
935
|
+
serialNumber: string;
|
|
936
|
+
/** Issuer common name if known (from parsed cert) */
|
|
937
|
+
issuerName?: string;
|
|
938
|
+
/** Full certificate PEM — available for direct_tls source only */
|
|
939
|
+
certPem?: string;
|
|
940
|
+
}
|
|
941
|
+
type RevocationStatus = {
|
|
942
|
+
revoked: false;
|
|
943
|
+
} | {
|
|
944
|
+
revoked: true;
|
|
945
|
+
reason?: string;
|
|
946
|
+
revokedAt?: Date;
|
|
947
|
+
} | {
|
|
948
|
+
revoked: false;
|
|
949
|
+
skipped: true;
|
|
950
|
+
reason: string;
|
|
951
|
+
};
|
|
952
|
+
interface CertRevocationChecker {
|
|
953
|
+
/**
|
|
954
|
+
* Check whether a certificate has been revoked.
|
|
955
|
+
* @returns RevocationStatus — { revoked: true } means reject the cert.
|
|
956
|
+
* @throws May throw if hardFail is true and the check cannot be completed.
|
|
957
|
+
*/
|
|
958
|
+
check(input: RevocationInput): Promise<RevocationStatus>;
|
|
959
|
+
}
|
|
960
|
+
declare class RevocationCache {
|
|
961
|
+
private readonly store;
|
|
962
|
+
private readonly maxAgeMs;
|
|
963
|
+
constructor(cacheMaxAgeSecs?: number);
|
|
964
|
+
get(serialNumber: string): RevocationStatus | null;
|
|
965
|
+
set(serialNumber: string, status: RevocationStatus): void;
|
|
966
|
+
/** Invalidate a single entry (e.g. after a forced re-check) */
|
|
967
|
+
invalidate(serialNumber: string): void;
|
|
968
|
+
/** Number of cached entries (for testing/monitoring) */
|
|
969
|
+
get size(): number;
|
|
970
|
+
}
|
|
971
|
+
declare class SkipRevocationChecker implements CertRevocationChecker {
|
|
972
|
+
private readonly reason;
|
|
973
|
+
constructor(reason?: string);
|
|
974
|
+
check(_input: RevocationInput): Promise<RevocationStatus>;
|
|
975
|
+
}
|
|
976
|
+
/**
|
|
977
|
+
* CRL revocation checker.
|
|
978
|
+
*
|
|
979
|
+
* Fetches a Certificate Revocation List from a distribution point URL
|
|
980
|
+
* and checks whether the certificate serial number appears in it.
|
|
981
|
+
*
|
|
982
|
+
* CRL format: DER-encoded X.509 CRL (RFC 5280). The revoked certificate
|
|
983
|
+
* list is an ASN.1 SEQUENCE of TBSCertList entries, each containing a
|
|
984
|
+
* serial number as an ASN.1 INTEGER.
|
|
985
|
+
*
|
|
986
|
+
* This implementation parses just the serial numbers from the DER blob
|
|
987
|
+
* using manual ASN.1 traversal — no additional dependencies needed.
|
|
988
|
+
*/
|
|
989
|
+
declare class CRLRevocationChecker implements CertRevocationChecker {
|
|
990
|
+
private readonly cache;
|
|
991
|
+
private readonly config;
|
|
992
|
+
constructor(config: CertRevocationConfig);
|
|
993
|
+
check(input: RevocationInput): Promise<RevocationStatus>;
|
|
994
|
+
/** Exposed for testing */
|
|
995
|
+
get _cache(): RevocationCache;
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* OCSP revocation checker (RFC 6960).
|
|
999
|
+
*
|
|
1000
|
+
* Constructs and sends an OCSP GET request to the configured responder.
|
|
1001
|
+
* Uses SHA-1 for CertID hashing (per RFC 6960 — SHA-1 is mandated for
|
|
1002
|
+
* CertID even though it's deprecated for other uses).
|
|
1003
|
+
*
|
|
1004
|
+
* For gateway_headers source: requires ocspResponderUrl in config.
|
|
1005
|
+
* The serial number is included in the request; issuerNameHash and
|
|
1006
|
+
* issuerKeyHash are derived from the CA chain if provided, or zeroed
|
|
1007
|
+
* (some OCSP responders accept this for simple serial lookups).
|
|
1008
|
+
*
|
|
1009
|
+
* For direct_tls source: certPem in RevocationInput enables full
|
|
1010
|
+
* CertID construction per RFC 6960.
|
|
1011
|
+
*/
|
|
1012
|
+
declare class OCSPRevocationChecker implements CertRevocationChecker {
|
|
1013
|
+
private readonly cache;
|
|
1014
|
+
private readonly config;
|
|
1015
|
+
constructor(config: CertRevocationConfig);
|
|
1016
|
+
check(input: RevocationInput): Promise<RevocationStatus>;
|
|
1017
|
+
/** Exposed for testing */
|
|
1018
|
+
get _cache(): RevocationCache;
|
|
1019
|
+
}
|
|
1020
|
+
declare class CompositeRevocationChecker implements CertRevocationChecker {
|
|
1021
|
+
private readonly ocsp;
|
|
1022
|
+
private readonly crl;
|
|
1023
|
+
constructor(config: CertRevocationConfig);
|
|
1024
|
+
check(input: RevocationInput): Promise<RevocationStatus>;
|
|
1025
|
+
}
|
|
1026
|
+
declare function createRevocationChecker(config: CertRevocationConfig): CertRevocationChecker;
|
|
1027
|
+
/**
|
|
1028
|
+
* Normalize a certificate serial number to uppercase hex without leading zeros
|
|
1029
|
+
* for consistent comparison.
|
|
1030
|
+
* Handles formats: '1234abcd', '12:34:ab:cd', '0x1234abcd'
|
|
1031
|
+
*/
|
|
1032
|
+
declare function normalizeSerial(serial: string): string;
|
|
1033
|
+
|
|
906
1034
|
/**
|
|
907
1035
|
* DoD CAC Profile Configuration
|
|
908
1036
|
*
|
|
@@ -1050,4 +1178,4 @@ declare function hasAuthConfig(item: any): item is {
|
|
|
1050
1178
|
auth: ComponentAuthConfig;
|
|
1051
1179
|
};
|
|
1052
1180
|
|
|
1053
|
-
export { type AuditEvent, AuditEventType, type AuditLogger, AuthContext, type AuthContextValue, AuthProvider, type AuthProviderProps, type AuthorizationRequest, type BuildAuthorizationUrlOptions, type ComponentProps, CompositeAuditLogger, ConsoleAuditLogger, type CookieOptions, DOD_CAC_PROFILE, type HeaderSigningConfig, InMemoryRevocationStore, KeycloakAdapter, NoopAuditLogger, type OIDCMetadata, OIDCProvider, PKIProvider, type ParsedCertificate, RBACEngine, type RevocationStore, SessionManager, type SessionManagerConfig, type TokenSet, buildAuthorizationUrl, clearCookie, createAuditEvent, createDoDCACConfig, createDoDCACDevConfig, decryptToken, deriveEncryptionKey, discoverOIDC, encryptToken, exchangeCodeForTokens, extractEDIPI, generateCodeChallenge, generateCodeVerifier, generateJti, generateNonce, generateState, getAuthDecorator, hasAuthConfig, maybeWrapWithAuth, parseCertFromHeaders, parseCertificate, parseCookies, refreshAccessToken, registerAuthDecorator, serializeCookie, signCertHeaders, useAuth, useRequireAuth, validateDoDCAC, validateIdToken, verifyCertHeaders, verifyState, withAuth, withAuthFallback };
|
|
1181
|
+
export { type AuditEvent, AuditEventType, type AuditLogger, AuthContext, type AuthContextValue, AuthProvider, type AuthProviderProps, type AuthorizationRequest, type BuildAuthorizationUrlOptions, CRLRevocationChecker, type CertRevocationChecker, type ComponentProps, CompositeAuditLogger, CompositeRevocationChecker, ConsoleAuditLogger, type CookieOptions, DOD_CAC_PROFILE, type HeaderSigningConfig, InMemoryRevocationStore, KeycloakAdapter, NoopAuditLogger, OCSPRevocationChecker, type OIDCMetadata, OIDCProvider, PKIProvider, type ParsedCertificate, RBACEngine, RevocationCache, type RevocationInput, type RevocationStatus, type RevocationStore, SessionManager, type SessionManagerConfig, SkipRevocationChecker, type TokenSet, buildAuthorizationUrl, clearCookie, createAuditEvent, createDoDCACConfig, createDoDCACDevConfig, createRevocationChecker, decryptToken, deriveEncryptionKey, discoverOIDC, encryptToken, exchangeCodeForTokens, extractEDIPI, generateCodeChallenge, generateCodeVerifier, generateJti, generateNonce, generateState, getAuthDecorator, hasAuthConfig, maybeWrapWithAuth, normalizeSerial, parseCertFromHeaders, parseCertificate, parseCookies, refreshAccessToken, registerAuthDecorator, serializeCookie, signCertHeaders, useAuth, useRequireAuth, validateDoDCAC, validateIdToken, verifyCertHeaders, verifyState, withAuth, withAuthFallback };
|