client-certificate-auth 2.1.1 → 2.1.2
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/README.md +8 -2
- package/lib/fetch.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# client-certificate-auth
|
|
2
2
|
|
|
3
|
-
Comprehensive toolkit for client SSL certificate authentication (mTLS) in Node.js. Includes Express/Connect middleware, framework-agnostic certificate extraction for reverse proxies (AWS ALB, Envoy, Cloudflare, Traefik, and more), and pre-built authorization helpers.
|
|
3
|
+
Comprehensive zero-dependency toolkit for client SSL certificate authentication (mTLS) in Node.js. Includes Express/Connect middleware, framework-agnostic certificate extraction for reverse proxies (AWS ALB, Envoy, Cloudflare, Traefik, and more), and pre-built authorization helpers.
|
|
4
|
+
|
|
5
|
+
This library lets you make additional auth decisions based on specific information within a client certificate after the client certificate is accepted at the socket level (i.e. by Node's `https` or a reverse proxy). This allows for fine-grained access control on top of the all-or-nothing allow/deny access control afforded by basic mTLS.
|
|
4
6
|
|
|
5
7
|
[](https://github.com/tgies/client-certificate-auth/actions/workflows/ci.yml)
|
|
6
8
|
[](https://www.npmjs.com/package/client-certificate-auth)
|
|
@@ -15,9 +17,13 @@ Comprehensive toolkit for client SSL certificate authentication (mTLS) in Node.j
|
|
|
15
17
|
|
|
16
18
|
**Fanatically Tested** - 100% line/branch/function/statement coverage, plus mutation testing and E2E tests against real nginx/Envoy/Traefik containers. ~6,207 lines of test code for ~937 lines of source (measured by [cloc](https://github.com/AlDanial/cloc)).
|
|
17
19
|
|
|
20
|
+
**Maintained since 2013** - Originally released for Node 0.10!
|
|
21
|
+
|
|
22
|
+
**Zero runtime dependencies** - Entirely self-contained, with straightforward, readable logic, no behavior hidden inside dependencies, no bloat, and no transitive-dependency security headaches.
|
|
23
|
+
|
|
18
24
|
## What Is This?
|
|
19
25
|
|
|
20
|
-
This library authenticates HTTP clients by their TLS client certificates, a scheme usually called mutual TLS (mTLS). Instead of presenting a password, API key, or bearer token, the client presents an X.509 certificate during the TLS handshake and proves possession of its private key; the server checks that the certificate was issued by a CA it trusts. The certificate is the credential.
|
|
26
|
+
This library authenticates HTTP clients by their TLS client certificates, a scheme usually called mutual TLS (mTLS). Instead of presenting a password, API key, or bearer token, the client presents an X.509 certificate during the TLS handshake and proves possession of its private key; the server checks that the certificate was issued by a CA it trusts. The certificate is the credential. The certificate signature verification is typically accomplished at the socket level by Node's `https` or a reverse proxy; this library's purpose is to allow you to easily inspect the properties of a verified certificate and make fine-grained access control decisions based on them.
|
|
21
27
|
|
|
22
28
|
Typical uses:
|
|
23
29
|
|
package/lib/fetch.js
CHANGED
|
@@ -48,7 +48,7 @@ import { extractClientCertificate } from './extractor.js';
|
|
|
48
48
|
export function extractClientCertificateFromRequest(request, options = {}) {
|
|
49
49
|
// Web Headers normalizes to lowercase, but Map and other iterables
|
|
50
50
|
// preserve casing. Normalize here for the core extractor's lowercase lookup.
|
|
51
|
-
const headers =
|
|
51
|
+
const headers = Object.create(null);
|
|
52
52
|
for (const [name, value] of request.headers) {
|
|
53
53
|
headers[name.toLowerCase()] = value;
|
|
54
54
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "client-certificate-auth",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Express/Connect middleware for mTLS client certificate authentication with reverse proxy support (AWS ALB, Envoy, Cloudflare, Traefik)",
|
|
5
5
|
"homepage": "https://github.com/tgies/client-certificate-auth",
|
|
6
6
|
"bugs": {
|