@oathmesh/sdk 1.0.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 +238 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/middleware.d.ts +39 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/middleware.js +58 -0
- package/dist/middleware.js.map +1 -0
- package/dist/next.d.ts +117 -0
- package/dist/next.d.ts.map +1 -0
- package/dist/next.js +183 -0
- package/dist/next.js.map +1 -0
- package/dist/types.d.ts +174 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +98 -0
- package/dist/types.js.map +1 -0
- package/dist/verify.d.ts +31 -0
- package/dist/verify.d.ts.map +1 -0
- package/dist/verify.js +176 -0
- package/dist/verify.js.map +1 -0
- package/package.json +81 -0
package/dist/verify.js
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Core OathMesh token verification — framework-agnostic.
|
|
4
|
+
*
|
|
5
|
+
* This module contains the pure verification logic shared by all framework
|
|
6
|
+
* adapters (Express, Next.js App Router, Next.js Pages Router, Edge Middleware).
|
|
7
|
+
* It has no dependency on any HTTP framework.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.extractToken = extractToken;
|
|
11
|
+
exports.verifyOathToken = verifyOathToken;
|
|
12
|
+
const jose_1 = require("jose");
|
|
13
|
+
const types_1 = require("./types");
|
|
14
|
+
/**
|
|
15
|
+
* Module-level JWKS cache. Keys are issuer URLs, values are jose JWKS functions.
|
|
16
|
+
* Shared across all verifier instances within the same process to avoid
|
|
17
|
+
* redundant JWKS fetches in serverless (Next.js) environments where
|
|
18
|
+
* module scope persists across requests.
|
|
19
|
+
*/
|
|
20
|
+
const globalJWKSCache = new Map();
|
|
21
|
+
function getJWKS(issuer) {
|
|
22
|
+
let jwks = globalJWKSCache.get(issuer);
|
|
23
|
+
if (!jwks) {
|
|
24
|
+
const url = new URL('/.well-known/jwks.json', issuer);
|
|
25
|
+
jwks = (0, jose_1.createRemoteJWKSet)(url, { cacheMaxAge: 300000 });
|
|
26
|
+
globalJWKSCache.set(issuer, jwks);
|
|
27
|
+
}
|
|
28
|
+
return jwks;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Extract the raw token string from an Authorization header value.
|
|
32
|
+
*
|
|
33
|
+
* Accepts:
|
|
34
|
+
* - `OathMesh <token>` (canonical)
|
|
35
|
+
* - `Bearer <token>` (compatibility — only when the token contains om+jwt typ)
|
|
36
|
+
*
|
|
37
|
+
* @returns The raw token string, or null if the header is missing/invalid.
|
|
38
|
+
*/
|
|
39
|
+
function extractToken(authHeader) {
|
|
40
|
+
if (!authHeader)
|
|
41
|
+
return null;
|
|
42
|
+
if (authHeader.startsWith('OathMesh '))
|
|
43
|
+
return authHeader.slice(9);
|
|
44
|
+
if (authHeader.startsWith('Bearer '))
|
|
45
|
+
return authHeader.slice(7);
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Verify an OathMesh token string and return the verified caller context.
|
|
50
|
+
*
|
|
51
|
+
* This is the core verification function. Framework adapters call this
|
|
52
|
+
* and handle HTTP responses themselves.
|
|
53
|
+
*
|
|
54
|
+
* @param token - Raw token string (without "OathMesh " prefix)
|
|
55
|
+
* @param config - Verifier configuration
|
|
56
|
+
* @returns Verified caller context on success
|
|
57
|
+
* @throws OathMeshError on any verification failure
|
|
58
|
+
*/
|
|
59
|
+
async function verifyOathToken(token, config) {
|
|
60
|
+
const { audience, trustedIssuers } = config;
|
|
61
|
+
// Step 02: Decode and validate header
|
|
62
|
+
let header;
|
|
63
|
+
try {
|
|
64
|
+
header = (0, jose_1.decodeProtectedHeader)(token);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
throw new types_1.OathMeshError('verification_failed', 'malformed token header', 'check token format');
|
|
68
|
+
}
|
|
69
|
+
if (header.typ !== 'om+jwt') {
|
|
70
|
+
throw new types_1.OathMeshError('algorithm_not_allowed', `invalid token type "${header.typ}"`, 'token typ must be om+jwt');
|
|
71
|
+
}
|
|
72
|
+
if (header.alg === 'none') {
|
|
73
|
+
throw new types_1.OathMeshError('algorithm_not_allowed', 'algorithm "none" is rejected — this is a security redline', 'use EdDSA or ES256');
|
|
74
|
+
}
|
|
75
|
+
if (!['EdDSA', 'ES256'].includes(header.alg)) {
|
|
76
|
+
throw new types_1.OathMeshError('algorithm_not_allowed', `algorithm "${header.alg}" is not allowed`, 'use EdDSA (preferred) or ES256');
|
|
77
|
+
}
|
|
78
|
+
// Step 03–04: Extract issuer and check trust
|
|
79
|
+
let claims;
|
|
80
|
+
try {
|
|
81
|
+
claims = (0, jose_1.decodeJwt)(token);
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
throw new types_1.OathMeshError('verification_failed', 'malformed token payload', 'check token format');
|
|
85
|
+
}
|
|
86
|
+
const iss = claims.iss;
|
|
87
|
+
if (!iss) {
|
|
88
|
+
throw new types_1.OathMeshError('claim_missing:iss', 'missing iss claim', 'include iss when minting');
|
|
89
|
+
}
|
|
90
|
+
if (!trustedIssuers.includes(iss)) {
|
|
91
|
+
throw new types_1.OathMeshError('issuer_untrusted', `issuer "${iss}" is not in the trusted issuers list`, 'add the issuer URL to your trustedIssuers configuration');
|
|
92
|
+
}
|
|
93
|
+
// Step 05–06: Load JWKS and verify signature
|
|
94
|
+
const jwks = getJWKS(iss);
|
|
95
|
+
let payload;
|
|
96
|
+
try {
|
|
97
|
+
const result = await (0, jose_1.jwtVerify)(token, jwks, {
|
|
98
|
+
audience,
|
|
99
|
+
issuer: iss,
|
|
100
|
+
clockTolerance: 10,
|
|
101
|
+
});
|
|
102
|
+
payload = result.payload;
|
|
103
|
+
}
|
|
104
|
+
catch (err) {
|
|
105
|
+
throw mapJoseError(err, audience);
|
|
106
|
+
}
|
|
107
|
+
// Step 11: Verify required claims
|
|
108
|
+
if (!payload.sub)
|
|
109
|
+
throw new types_1.OathMeshError('claim_missing:sub', 'missing sub claim', 'include sub when minting');
|
|
110
|
+
if (!payload.act)
|
|
111
|
+
throw new types_1.OathMeshError('claim_missing:act', 'missing act claim', 'include act when minting');
|
|
112
|
+
if (!payload.jti)
|
|
113
|
+
throw new types_1.OathMeshError('claim_missing:jti', 'missing jti claim', 'jti is auto-generated by the issuer');
|
|
114
|
+
// Step 12b: Enforce rqh if RequireRequestBinding is set
|
|
115
|
+
if (config.requireRequestBinding && !payload.rqh) {
|
|
116
|
+
throw new types_1.OathMeshError('binding_required', 'token missing rqh (request hash) claim', 'mint a token with rqh= sha256:<canonical-request> for write/mutate operations');
|
|
117
|
+
}
|
|
118
|
+
// Step 13: Check replay cache (if configured)
|
|
119
|
+
if (config.replayCache) {
|
|
120
|
+
const jti = payload.jti;
|
|
121
|
+
if (config.replayCache.check(jti)) {
|
|
122
|
+
throw new types_1.OathMeshError('replay_detected', `token ${jti} has already been used`, 'each Oath Token can only be used once — mint a new token');
|
|
123
|
+
}
|
|
124
|
+
config.replayCache.add(jti);
|
|
125
|
+
}
|
|
126
|
+
// Step 14: Evaluate policy (if configured)
|
|
127
|
+
if (config.policyEvaluator) {
|
|
128
|
+
const policyInput = {
|
|
129
|
+
iss,
|
|
130
|
+
sub: payload.sub,
|
|
131
|
+
aud: payload.aud,
|
|
132
|
+
act: payload.act,
|
|
133
|
+
scope: payload.scope,
|
|
134
|
+
env: payload.env,
|
|
135
|
+
};
|
|
136
|
+
const decision = await config.policyEvaluator.evaluate(policyInput);
|
|
137
|
+
if (decision.outcome === 'deny') {
|
|
138
|
+
throw new types_1.OathMeshError('policy_denied', decision.denyReason || 'policy evaluation denied', 'check policy rules for this request');
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
// Build verified context
|
|
142
|
+
return {
|
|
143
|
+
principal: {
|
|
144
|
+
issuer: iss,
|
|
145
|
+
subject: payload.sub,
|
|
146
|
+
},
|
|
147
|
+
action: payload.act,
|
|
148
|
+
tokenId: payload.jti,
|
|
149
|
+
environment: payload.env || '',
|
|
150
|
+
scope: payload.scope,
|
|
151
|
+
reason: payload.reason,
|
|
152
|
+
source: payload.src,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Map a jose library error to the OathMesh error taxonomy.
|
|
157
|
+
*/
|
|
158
|
+
function mapJoseError(err, audience) {
|
|
159
|
+
const msg = err.message || '';
|
|
160
|
+
if (msg.includes('expired') || err.name === 'JWTExpired') {
|
|
161
|
+
return new types_1.OathMeshError('token_expired', 'token has expired', 'mint a new token — Oath Tokens are short-lived');
|
|
162
|
+
}
|
|
163
|
+
if (msg.includes('audience') || err.name === 'JWTClaimValidationFailed') {
|
|
164
|
+
if (msg.includes('audience')) {
|
|
165
|
+
return new types_1.OathMeshError('audience_mismatch', 'token audience does not match', `mint with --aud ${audience}`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (msg.includes('signature') || err.name === 'JWSSignatureVerificationFailed') {
|
|
169
|
+
return new types_1.OathMeshError('signature_invalid', 'JWS signature verification failed', 'check that the token was signed by a trusted issuer');
|
|
170
|
+
}
|
|
171
|
+
if (msg.includes('issuer')) {
|
|
172
|
+
return new types_1.OathMeshError('issuer_untrusted', 'issuer verification failed', 'check trustedIssuers configuration');
|
|
173
|
+
}
|
|
174
|
+
return new types_1.OathMeshError('verification_failed', msg || 'token verification failed', 'check token format and issuer availability');
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=verify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../src/verify.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAgCH,oCAKC;AAaD,0CAmIC;AAnLD,+BAAuF;AACvF,mCAA2G;AAE3G;;;;;GAKG;AACH,MAAM,eAAe,GAAG,IAAI,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AAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YAC7B,OAAO,IAAI,qBAAa,CAAC,mBAAmB,EAAE,+BAA+B,EAAE,mBAAmB,QAAQ,EAAE,CAAC,CAAC;QAChH,CAAC;IACH,CAAC;IACD,IAAI,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,gCAAgC,EAAE,CAAC;QAC/E,OAAO,IAAI,qBAAa,CAAC,mBAAmB,EAAE,mCAAmC,EAAE,qDAAqD,CAAC,CAAC;IAC5I,CAAC;IACD,IAAI,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3B,OAAO,IAAI,qBAAa,CAAC,kBAAkB,EAAE,4BAA4B,EAAE,oCAAoC,CAAC,CAAC;IACnH,CAAC;IACD,OAAO,IAAI,qBAAa,CAAC,qBAAqB,EAAE,GAAG,IAAI,2BAA2B,EAAE,4CAA4C,CAAC,CAAC;AACpI,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oathmesh/sdk",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/oathmesh/oathmesh.git",
|
|
7
|
+
"directory": "sdk/node"
|
|
8
|
+
},
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"description": "OathMesh verification SDK for Express.js and Next.js — TypeScript-first",
|
|
13
|
+
"main": "dist/index.js",
|
|
14
|
+
"types": "dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"require": "./dist/index.js",
|
|
19
|
+
"import": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./next": {
|
|
22
|
+
"types": "./dist/next.d.ts",
|
|
23
|
+
"require": "./dist/next.js",
|
|
24
|
+
"import": "./dist/next.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"typesVersions": {
|
|
28
|
+
"*": {
|
|
29
|
+
"next": [
|
|
30
|
+
"dist/next.d.ts"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"prepublishOnly": "npm run build"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"oathmesh",
|
|
44
|
+
"auth",
|
|
45
|
+
"middleware",
|
|
46
|
+
"express",
|
|
47
|
+
"nextjs",
|
|
48
|
+
"jwt",
|
|
49
|
+
"machine-identity",
|
|
50
|
+
"typescript"
|
|
51
|
+
],
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"jose": "^5.2.0"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@types/express": "^4.17.21",
|
|
58
|
+
"@types/node": "^20.11.0",
|
|
59
|
+
"@types/supertest": "^7.2.0",
|
|
60
|
+
"express": "^4.19.0",
|
|
61
|
+
"express-rate-limit": "^7.1.0",
|
|
62
|
+
"supertest": "^6.3.3",
|
|
63
|
+
"typescript": "^5.3.0",
|
|
64
|
+
"vitest": "^1.4.0"
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"express": ">=4.0.0",
|
|
68
|
+
"next": ">=13.0.0"
|
|
69
|
+
},
|
|
70
|
+
"peerDependenciesMeta": {
|
|
71
|
+
"express": {
|
|
72
|
+
"optional": true
|
|
73
|
+
},
|
|
74
|
+
"next": {
|
|
75
|
+
"optional": true
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"engines": {
|
|
79
|
+
"node": ">=18.0.0"
|
|
80
|
+
}
|
|
81
|
+
}
|