@sphereon/oid4vc-common 0.17.0 → 0.17.1-feature.esm.cjs.24
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.cjs +485 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +297 -0
- package/dist/index.d.ts +296 -8
- package/dist/index.js +425 -26
- package/dist/index.js.map +1 -1
- package/package.json +22 -13
- package/dist/dpop/DPoP.d.ts +0 -60
- package/dist/dpop/DPoP.d.ts.map +0 -1
- package/dist/dpop/DPoP.js +0 -184
- package/dist/dpop/DPoP.js.map +0 -1
- package/dist/dpop/index.d.ts +0 -2
- package/dist/dpop/index.d.ts.map +0 -1
- package/dist/dpop/index.js +0 -18
- package/dist/dpop/index.js.map +0 -1
- package/dist/hasher.d.ts +0 -3
- package/dist/hasher.d.ts.map +0 -1
- package/dist/hasher.js +0 -19
- package/dist/hasher.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/jwt/Jwk.types.d.ts +0 -36
- package/dist/jwt/Jwk.types.d.ts.map +0 -1
- package/dist/jwt/Jwk.types.js +0 -3
- package/dist/jwt/Jwk.types.js.map +0 -1
- package/dist/jwt/JwkThumbprint.d.ts +0 -6
- package/dist/jwt/JwkThumbprint.d.ts.map +0 -1
- package/dist/jwt/JwkThumbprint.js +0 -102
- package/dist/jwt/JwkThumbprint.js.map +0 -1
- package/dist/jwt/Jwt.types.d.ts +0 -23
- package/dist/jwt/Jwt.types.d.ts.map +0 -1
- package/dist/jwt/Jwt.types.js +0 -12
- package/dist/jwt/Jwt.types.js.map +0 -1
- package/dist/jwt/JwtIssuer.d.ts +0 -51
- package/dist/jwt/JwtIssuer.d.ts.map +0 -1
- package/dist/jwt/JwtIssuer.js +0 -3
- package/dist/jwt/JwtIssuer.js.map +0 -1
- package/dist/jwt/JwtVerifier.d.ts +0 -72
- package/dist/jwt/JwtVerifier.d.ts.map +0 -1
- package/dist/jwt/JwtVerifier.js +0 -80
- package/dist/jwt/JwtVerifier.js.map +0 -1
- package/dist/jwt/index.d.ts +0 -7
- package/dist/jwt/index.d.ts.map +0 -1
- package/dist/jwt/index.js +0 -23
- package/dist/jwt/index.js.map +0 -1
- package/dist/jwt/jwtUtils.d.ts +0 -26
- package/dist/jwt/jwtUtils.d.ts.map +0 -1
- package/dist/jwt/jwtUtils.js +0 -62
- package/dist/jwt/jwtUtils.js.map +0 -1
- package/dist/oauth/DynamicClientRegistration.types.d.ts +0 -19
- package/dist/oauth/DynamicClientRegistration.types.d.ts.map +0 -1
- package/dist/oauth/DynamicClientRegistration.types.js +0 -3
- package/dist/oauth/DynamicClientRegistration.types.js.map +0 -1
- package/dist/oauth/index.d.ts +0 -2
- package/dist/oauth/index.d.ts.map +0 -1
- package/dist/oauth/index.js +0 -18
- package/dist/oauth/index.js.map +0 -1
- package/dist/types/digest.types.d.ts +0 -2
- package/dist/types/digest.types.d.ts.map +0 -1
- package/dist/types/digest.types.js +0 -3
- package/dist/types/digest.types.js.map +0 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -18
- package/dist/types/index.js.map +0 -1
- package/lib/__tests__/dpop.spec.ts +0 -124
- package/lib/dpop/DPoP.ts +0 -242
- package/lib/dpop/index.ts +0 -1
- package/lib/hasher.ts +0 -18
- package/lib/index.ts +0 -11
- package/lib/jwt/Jwk.types.ts +0 -38
- package/lib/jwt/JwkThumbprint.ts +0 -65
- package/lib/jwt/Jwt.types.ts +0 -26
- package/lib/jwt/JwtIssuer.ts +0 -60
- package/lib/jwt/JwtVerifier.ts +0 -130
- package/lib/jwt/__tests__/JwkThumbprint.spec.ts +0 -16
- package/lib/jwt/index.ts +0 -6
- package/lib/jwt/jwtUtils.ts +0 -71
- package/lib/oauth/DynamicClientRegistration.types.ts +0 -20
- package/lib/oauth/index.ts +0 -1
- package/lib/types/digest.types.ts +0 -1
- package/lib/types/index.ts +0 -1
package/dist/dpop/DPoP.js
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.verifyResourceDPoP = exports.verifyDPoP = exports.createDPoP = exports.getCreateDPoPOptions = exports.dpopTokenRequestNonceError = void 0;
|
|
36
|
-
const jwt_decode_1 = require("jwt-decode");
|
|
37
|
-
const u8a = __importStar(require("uint8arrays"));
|
|
38
|
-
const uuid_1 = require("uuid");
|
|
39
|
-
const hasher_1 = require("../hasher");
|
|
40
|
-
const jwt_1 = require("./../jwt");
|
|
41
|
-
exports.dpopTokenRequestNonceError = 'use_dpop_nonce';
|
|
42
|
-
function getCreateDPoPOptions(createDPoPClientOpts, endPointUrl, resourceRequestOpts) {
|
|
43
|
-
const htu = endPointUrl.split('?')[0].split('#')[0];
|
|
44
|
-
return Object.assign(Object.assign({}, createDPoPClientOpts), { jwtPayloadProps: Object.assign(Object.assign(Object.assign({}, createDPoPClientOpts.jwtPayloadProps), { htu, htm: 'POST' }), (resourceRequestOpts && { accessToken: resourceRequestOpts.accessToken })) });
|
|
45
|
-
}
|
|
46
|
-
exports.getCreateDPoPOptions = getCreateDPoPOptions;
|
|
47
|
-
function createDPoP(options) {
|
|
48
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
var _a, _b;
|
|
50
|
-
const { createJwtCallback, jwtIssuer, jwtPayloadProps, dPoPSigningAlgValuesSupported } = options;
|
|
51
|
-
if (jwtPayloadProps.accessToken && (((_a = jwtPayloadProps.accessToken) === null || _a === void 0 ? void 0 : _a.startsWith('DPoP ')) || ((_b = jwtPayloadProps.accessToken) === null || _b === void 0 ? void 0 : _b.startsWith('Bearer ')))) {
|
|
52
|
-
throw new Error('expected access token without scheme');
|
|
53
|
-
}
|
|
54
|
-
const ath = jwtPayloadProps.accessToken ? u8a.toString((0, hasher_1.defaultHasher)(jwtPayloadProps.accessToken, 'sha256'), 'base64url') : undefined;
|
|
55
|
-
return createJwtCallback({ method: 'jwk', type: 'dpop', alg: jwtIssuer.alg, jwk: jwtIssuer.jwk, dPoPSigningAlgValuesSupported }, {
|
|
56
|
-
header: Object.assign(Object.assign({}, jwtIssuer), { typ: 'dpop+jwt', alg: jwtIssuer.alg, jwk: jwtIssuer.jwk }),
|
|
57
|
-
payload: Object.assign(Object.assign(Object.assign({}, jwtPayloadProps), { iat: (0, jwt_1.epochTime)(), jti: (0, uuid_1.v4)() }), (ath && { ath })),
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
exports.createDPoP = createDPoP;
|
|
62
|
-
function verifyDPoP(request, options) {
|
|
63
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
-
var _a, _b, _c, _d;
|
|
65
|
-
// There is not more than one DPoP HTTP request header field.
|
|
66
|
-
const dpop = request.headers['dpop'];
|
|
67
|
-
if (!dpop || typeof dpop !== 'string') {
|
|
68
|
-
throw new Error('missing or invalid dpop header. Expected compact JWT');
|
|
69
|
-
}
|
|
70
|
-
// The DPoP HTTP request header field value is a single and well-formed JWT.
|
|
71
|
-
const { header: dPoPHeader, payload: dPoPPayload } = (0, jwt_1.parseJWT)(dpop);
|
|
72
|
-
// Ensure all required header claims are present
|
|
73
|
-
if (dPoPHeader.typ !== 'dpop+jwt' || !dPoPHeader.alg || !dPoPHeader.jwk || typeof dPoPHeader.jwk !== 'object' || dPoPHeader.jwk.d) {
|
|
74
|
-
throw new Error('invalid_dpop_proof. Invalid header claims');
|
|
75
|
-
}
|
|
76
|
-
// Ensure all required payload claims are present
|
|
77
|
-
if (!dPoPPayload.htm || !dPoPPayload.htu || !dPoPPayload.iat || !dPoPPayload.jti) {
|
|
78
|
-
throw new Error('invalid_dpop_proof. Missing required claims');
|
|
79
|
-
}
|
|
80
|
-
// Validate alg is supported
|
|
81
|
-
if ((options === null || options === void 0 ? void 0 : options.acceptedAlgorithms) && !options.acceptedAlgorithms.includes(dPoPHeader.alg)) {
|
|
82
|
-
throw new Error(`invalid_dpop_proof. Invalid 'alg' claim '${dPoPHeader.alg}'. Only ${options.acceptedAlgorithms.join(', ')} are supported.`);
|
|
83
|
-
}
|
|
84
|
-
// Validate nonce if provided
|
|
85
|
-
if (((options === null || options === void 0 ? void 0 : options.expectedNonce) && !dPoPPayload.nonce) || dPoPPayload.nonce !== options.expectedNonce) {
|
|
86
|
-
throw new Error('invalid_dpop_proof. Nonce mismatch');
|
|
87
|
-
}
|
|
88
|
-
// Verify JWT signature
|
|
89
|
-
try {
|
|
90
|
-
const verificationResult = yield options.jwtVerifyCallback({
|
|
91
|
-
method: 'jwk',
|
|
92
|
-
type: 'dpop',
|
|
93
|
-
jwk: dPoPHeader.jwk,
|
|
94
|
-
alg: dPoPHeader.alg,
|
|
95
|
-
}, {
|
|
96
|
-
header: dPoPHeader,
|
|
97
|
-
payload: dPoPPayload,
|
|
98
|
-
raw: dpop,
|
|
99
|
-
});
|
|
100
|
-
if (!verificationResult) {
|
|
101
|
-
throw new Error('invalid_dpop_proof. Invalid JWT signature');
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
catch (error) {
|
|
105
|
-
throw new Error('invalid_dpop_proof. Invalid JWT signature. ' + (error instanceof Error ? error.message : 'Unknown error'));
|
|
106
|
-
}
|
|
107
|
-
// Validate htm claim
|
|
108
|
-
if (dPoPPayload.htm !== request.method) {
|
|
109
|
-
throw new Error(`invalid_dpop_proof. Invalid htm claim. Must match request method '${request.method}'`);
|
|
110
|
-
}
|
|
111
|
-
// The htu claim matches the HTTP URI value for the HTTP request in which the JWT was received, ignoring any query and fragment parts.
|
|
112
|
-
const currentUri = request.fullUrl.split('?')[0].split('#')[0];
|
|
113
|
-
if (dPoPPayload.htu !== currentUri) {
|
|
114
|
-
throw new Error('invalid_dpop_proof. Invalid htu claim');
|
|
115
|
-
}
|
|
116
|
-
// Validate nonce if provided
|
|
117
|
-
if ((options.expectedNonce && dPoPPayload.nonce !== options.expectedNonce) || (!options.expectedNonce && dPoPPayload.nonce)) {
|
|
118
|
-
throw new Error('invalid_dpop_proof. Nonce mismatch');
|
|
119
|
-
}
|
|
120
|
-
// Validate iat claim
|
|
121
|
-
const { nowSkewedPast, nowSkewedFuture } = (0, jwt_1.getNowSkewed)(options.now);
|
|
122
|
-
if (
|
|
123
|
-
// iat claim is too far in the future
|
|
124
|
-
nowSkewedPast - ((_a = options.maxIatAgeInSeconds) !== null && _a !== void 0 ? _a : 60) > dPoPPayload.iat ||
|
|
125
|
-
// iat claim is too old
|
|
126
|
-
nowSkewedFuture + ((_b = options.maxIatAgeInSeconds) !== null && _b !== void 0 ? _b : 60) < dPoPPayload.iat) {
|
|
127
|
-
// 5 minute window
|
|
128
|
-
throw new Error('invalid_dpop_proof. Invalid iat claim');
|
|
129
|
-
}
|
|
130
|
-
// If access token is present, validate ath claim
|
|
131
|
-
const authorizationHeader = request.headers.authorization;
|
|
132
|
-
if (!options.expectAccessToken && authorizationHeader) {
|
|
133
|
-
throw new Error('invalid_dpop_proof. Received an unexpected authorization header.');
|
|
134
|
-
}
|
|
135
|
-
if (options.expectAccessToken) {
|
|
136
|
-
if (!dPoPPayload.ath) {
|
|
137
|
-
throw new Error('invalid_dpop_proof. Missing expected ath claim.');
|
|
138
|
-
}
|
|
139
|
-
// validate that the DPOP proof is made for the provided access token
|
|
140
|
-
if (!authorizationHeader || typeof authorizationHeader !== 'string' || !authorizationHeader.startsWith('DPoP ')) {
|
|
141
|
-
throw new Error('invalid_dpop_proof. Invalid authorization header.');
|
|
142
|
-
}
|
|
143
|
-
const accessToken = authorizationHeader.replace('DPoP ', '');
|
|
144
|
-
const expectedAth = u8a.toString((0, hasher_1.defaultHasher)(accessToken, 'sha256'), 'base64url');
|
|
145
|
-
if (dPoPPayload.ath !== expectedAth) {
|
|
146
|
-
throw new Error('invalid_dpop_proof. Invalid ath claim');
|
|
147
|
-
}
|
|
148
|
-
// validate that the access token is signed with the same key as the DPOP proof
|
|
149
|
-
const accessTokenPayload = (0, jwt_decode_1.jwtDecode)(accessToken, { header: false });
|
|
150
|
-
if (!((_c = accessTokenPayload.cnf) === null || _c === void 0 ? void 0 : _c.jkt)) {
|
|
151
|
-
throw new Error('invalid_dpop_proof. Access token is missing the jkt claim');
|
|
152
|
-
}
|
|
153
|
-
const thumprint = yield (0, jwt_1.calculateJwkThumbprint)(dPoPHeader.jwk, 'sha256');
|
|
154
|
-
if (((_d = accessTokenPayload.cnf) === null || _d === void 0 ? void 0 : _d.jkt) !== thumprint) {
|
|
155
|
-
throw new Error('invalid_dpop_proof. JwkThumbprint mismatch');
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
// If all validations pass, return the dpop jwk
|
|
159
|
-
return dPoPHeader.jwk;
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
exports.verifyDPoP = verifyDPoP;
|
|
163
|
-
/**
|
|
164
|
-
* DPoP verifications for resource requests
|
|
165
|
-
* For Bearer token compatibility jwt's must have a token_type claim
|
|
166
|
-
* The access token itself must be validated before using this method
|
|
167
|
-
* If the token_type is not DPoP, then the request is not a DPoP request
|
|
168
|
-
* and we don't need to verify the DPoP proof
|
|
169
|
-
*/
|
|
170
|
-
function verifyResourceDPoP(request, options) {
|
|
171
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
172
|
-
if (!request.headers.authorization || typeof request.headers.authorization !== 'string') {
|
|
173
|
-
throw new Error('Received an invalid resource request. Missing authorization header.');
|
|
174
|
-
}
|
|
175
|
-
const tokenPayload = (0, jwt_decode_1.jwtDecode)(request.headers.authorization, { header: false });
|
|
176
|
-
const tokenType = tokenPayload.token_type;
|
|
177
|
-
if (tokenType !== 'DPoP') {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
return verifyDPoP(request, Object.assign(Object.assign({}, options), { expectAccessToken: true }));
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
exports.verifyResourceDPoP = verifyResourceDPoP;
|
|
184
|
-
//# sourceMappingURL=DPoP.js.map
|
package/dist/dpop/DPoP.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|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SAAS,EAAE,CAAC;gBAC9C,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;YAChE,CAAC;QACH,CAAC;QAED,+CAA+C;QAC/C,OAAO,UAAU,CAAC,GAAG,CAAC;IACxB,CAAC;CAAA;AAxHD,gCAwHC;AAED;;;;;;GAMG;AACH,SAAsB,kBAAkB,CACtC,OAA8G,EAC9G,OAAqD;;QAErD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,IAAI,OAAO,OAAO,CAAC,OAAO,CAAC,aAAa,KAAK,QAAQ,EAAE,CAAC;YACxF,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;QACzF,CAAC;QACD,MAAM,YAAY,GAAG,IAAA,sBAAS,EAAuC,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QACvH,MAAM,SAAS,GAAG,YAAY,CAAC,UAAU,CAAC;QAE1C,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;YACzB,OAAO;QACT,CAAC;QAED,OAAO,UAAU,CAAC,OAAO,kCAAO,OAAO,KAAE,iBAAiB,EAAE,IAAI,IAAG,CAAC;IACtE,CAAC;CAAA;AAfD,gDAeC"}
|
package/dist/dpop/index.d.ts
DELETED
package/dist/dpop/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/dpop/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
package/dist/dpop/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./DPoP"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
package/dist/dpop/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/dpop/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB"}
|
package/dist/hasher.d.ts
DELETED
package/dist/hasher.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hasher.d.ts","sourceRoot":"","sources":["../lib/hasher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAM7C,eAAO,MAAM,aAAa,EAAE,MAW3B,CAAC"}
|
package/dist/hasher.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.defaultHasher = void 0;
|
|
7
|
-
const sha_js_1 = __importDefault(require("sha.js"));
|
|
8
|
-
const supportedAlgorithms = ['sha256', 'sha384', 'sha512'];
|
|
9
|
-
const defaultHasher = (data, algorithm) => {
|
|
10
|
-
const sanitizedAlgorithm = algorithm.toLowerCase().replace(/[-_]/g, '');
|
|
11
|
-
if (!supportedAlgorithms.includes(sanitizedAlgorithm)) {
|
|
12
|
-
throw new Error(`Unsupported hashing algorithm ${algorithm}`);
|
|
13
|
-
}
|
|
14
|
-
return new Uint8Array((0, sha_js_1.default)(sanitizedAlgorithm)
|
|
15
|
-
.update(data)
|
|
16
|
-
.digest());
|
|
17
|
-
};
|
|
18
|
-
exports.defaultHasher = defaultHasher;
|
|
19
|
-
//# sourceMappingURL=hasher.js.map
|
package/dist/hasher.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hasher.js","sourceRoot":"","sources":["../lib/hasher.ts"],"names":[],"mappings":";;;;;;AACA,oDAAyB;AAEzB,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAG7D,MAAM,aAAa,GAAW,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;IACvD,MAAM,kBAAkB,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACxE,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,kBAAyC,CAAC,EAAE,CAAC;QAC7E,MAAM,IAAI,KAAK,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,IAAI,UAAU,CACnB,IAAA,gBAAG,EAAC,kBAAyC,CAAC;SAC3C,MAAM,CAAC,IAAI,CAAC;SACZ,MAAM,EAAE,CACZ,CAAC;AACJ,CAAC,CAAC;AAXW,QAAA,aAAa,iBAWxB"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,eAAO,MAAM,WAAW,SAAkB,CAAC;AAC3C,eAAO,MAAM,cAAc,sDAA6C,CAAC;AAEzE,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AAExB,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/jwt/Jwk.types.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export interface BaseJWK {
|
|
2
|
-
kty?: string;
|
|
3
|
-
crv?: string;
|
|
4
|
-
x?: string;
|
|
5
|
-
y?: string;
|
|
6
|
-
e?: string;
|
|
7
|
-
n?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface JWK extends BaseJWK {
|
|
10
|
-
alg?: string;
|
|
11
|
-
d?: string;
|
|
12
|
-
dp?: string;
|
|
13
|
-
dq?: string;
|
|
14
|
-
ext?: boolean;
|
|
15
|
-
k?: string;
|
|
16
|
-
key_ops?: string[];
|
|
17
|
-
kid?: string;
|
|
18
|
-
oth?: Array<{
|
|
19
|
-
d?: string;
|
|
20
|
-
r?: string;
|
|
21
|
-
t?: string;
|
|
22
|
-
}>;
|
|
23
|
-
p?: string;
|
|
24
|
-
q?: string;
|
|
25
|
-
qi?: string;
|
|
26
|
-
use?: string;
|
|
27
|
-
x5c?: string[];
|
|
28
|
-
x5t?: string;
|
|
29
|
-
'x5t#S256'?: string;
|
|
30
|
-
x5u?: string;
|
|
31
|
-
[propName: string]: unknown;
|
|
32
|
-
}
|
|
33
|
-
export type JWKS = {
|
|
34
|
-
keys: JWK[];
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=Jwk.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Jwk.types.d.ts","sourceRoot":"","sources":["../../lib/jwt/Jwk.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAA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|
|
|
1
|
-
import { DigestAlgorithm } from '../types';
|
|
2
|
-
import { JWK } from '.';
|
|
3
|
-
export declare function calculateJwkThumbprint(jwk: JWK, digestAlgorithm?: DigestAlgorithm): Promise<string>;
|
|
4
|
-
export declare function getDigestAlgorithmFromJwkThumbprintUri(uri: string): Promise<DigestAlgorithm>;
|
|
5
|
-
export declare function calculateJwkThumbprintUri(jwk: JWK, digestAlgorithm?: DigestAlgorithm): Promise<string>;
|
|
6
|
-
//# sourceMappingURL=JwkThumbprint.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JwkThumbprint.d.ts","sourceRoot":"","sources":["../../lib/jwt/JwkThumbprint.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;AAQxB,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,eAAe,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAkCzG;AAED,wBAAsB,sCAAsC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAUlG;AAED,wBAAsB,yBAAyB,CAAC,GAAG,EAAE,GAAG,EAAE,eAAe,GAAE,eAA0B,GAAG,OAAO,CAAC,MAAM,CAAC,CAGtH"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.calculateJwkThumbprintUri = exports.getDigestAlgorithmFromJwkThumbprintUri = exports.calculateJwkThumbprint = void 0;
|
|
36
|
-
const u8a = __importStar(require("uint8arrays"));
|
|
37
|
-
const hasher_1 = require("../hasher");
|
|
38
|
-
const check = (value, description) => {
|
|
39
|
-
if (typeof value !== 'string' || !value) {
|
|
40
|
-
throw Error(`${description} missing or invalid`);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
function calculateJwkThumbprint(jwk, digestAlgorithm) {
|
|
44
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
if (!jwk || typeof jwk !== 'object') {
|
|
46
|
-
throw new TypeError('JWK must be an object');
|
|
47
|
-
}
|
|
48
|
-
const algorithm = digestAlgorithm !== null && digestAlgorithm !== void 0 ? digestAlgorithm : 'sha256';
|
|
49
|
-
if (algorithm !== 'sha256' && algorithm !== 'sha384' && algorithm !== 'sha512') {
|
|
50
|
-
throw new TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');
|
|
51
|
-
}
|
|
52
|
-
let components;
|
|
53
|
-
switch (jwk.kty) {
|
|
54
|
-
case 'EC':
|
|
55
|
-
check(jwk.crv, '"crv" (Curve) Parameter');
|
|
56
|
-
check(jwk.x, '"x" (X Coordinate) Parameter');
|
|
57
|
-
check(jwk.y, '"y" (Y Coordinate) Parameter');
|
|
58
|
-
components = { crv: jwk.crv, kty: jwk.kty, x: jwk.x, y: jwk.y };
|
|
59
|
-
break;
|
|
60
|
-
case 'OKP':
|
|
61
|
-
check(jwk.crv, '"crv" (Subtype of Key Pair) Parameter');
|
|
62
|
-
check(jwk.x, '"x" (Public Key) Parameter');
|
|
63
|
-
components = { crv: jwk.crv, kty: jwk.kty, x: jwk.x };
|
|
64
|
-
break;
|
|
65
|
-
case 'RSA':
|
|
66
|
-
check(jwk.e, '"e" (Exponent) Parameter');
|
|
67
|
-
check(jwk.n, '"n" (Modulus) Parameter');
|
|
68
|
-
components = { e: jwk.e, kty: jwk.kty, n: jwk.n };
|
|
69
|
-
break;
|
|
70
|
-
case 'oct':
|
|
71
|
-
check(jwk.k, '"k" (Key Value) Parameter');
|
|
72
|
-
components = { k: jwk.k, kty: jwk.kty };
|
|
73
|
-
break;
|
|
74
|
-
default:
|
|
75
|
-
throw Error('"kty" (Key Type) Parameter missing or unsupported');
|
|
76
|
-
}
|
|
77
|
-
return u8a.toString((0, hasher_1.defaultHasher)(JSON.stringify(components), algorithm), 'base64url');
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
exports.calculateJwkThumbprint = calculateJwkThumbprint;
|
|
81
|
-
function getDigestAlgorithmFromJwkThumbprintUri(uri) {
|
|
82
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
-
const match = uri.match(/^urn:ietf:params:oauth:jwk-thumbprint:sha-(\w+):/);
|
|
84
|
-
if (!match) {
|
|
85
|
-
throw new Error(`Invalid JWK thumbprint URI structure ${uri}`);
|
|
86
|
-
}
|
|
87
|
-
const algorithm = `sha${match[1]}`;
|
|
88
|
-
if (algorithm !== 'sha256' && algorithm !== 'sha384' && algorithm !== 'sha512') {
|
|
89
|
-
throw new Error(`Invalid JWK thumbprint URI digest algorithm ${uri}`);
|
|
90
|
-
}
|
|
91
|
-
return algorithm;
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
exports.getDigestAlgorithmFromJwkThumbprintUri = getDigestAlgorithmFromJwkThumbprintUri;
|
|
95
|
-
function calculateJwkThumbprintUri(jwk_1) {
|
|
96
|
-
return __awaiter(this, arguments, void 0, function* (jwk, digestAlgorithm = 'sha256') {
|
|
97
|
-
const thumbprint = yield calculateJwkThumbprint(jwk, digestAlgorithm);
|
|
98
|
-
return `urn:ietf:params:oauth:jwk-thumbprint:sha-${digestAlgorithm.slice(-3)}:${thumbprint}`;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
exports.calculateJwkThumbprintUri = calculateJwkThumbprintUri;
|
|
102
|
-
//# sourceMappingURL=JwkThumbprint.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JwkThumbprint.js","sourceRoot":"","sources":["../../lib/jwt/JwkThumbprint.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AAEnC,sCAA0C;AAK1C,MAAM,KAAK,GAAG,CAAC,KAAc,EAAE,WAAmB,EAAE,EAAE;IACpD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,K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CAAC;IACnB,CAAC;CAAA;AAVD,wFAUC;AAED,SAAsB,yBAAyB;yDAAC,GAAQ,EAAE,kBAAmC,QAAQ;QACnG,MAAM,UAAU,GAAG,MAAM,sBAAsB,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;QACtE,OAAO,4CAA4C,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC;IAC/F,CAAC;CAAA;AAHD,8DAGC"}
|
package/dist/jwt/Jwt.types.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { JwtHeader as jwtDecodeJwtHeader, JwtPayload as jwtDecodePayload } from 'jwt-decode';
|
|
2
|
-
import { JWK } from '.';
|
|
3
|
-
export type JwtHeader = jwtDecodeJwtHeader & {
|
|
4
|
-
alg?: string;
|
|
5
|
-
x5c?: string[];
|
|
6
|
-
kid?: string;
|
|
7
|
-
jwk?: JWK;
|
|
8
|
-
jwt?: string;
|
|
9
|
-
} & Record<string, unknown>;
|
|
10
|
-
export type JwtPayload = jwtDecodePayload & {
|
|
11
|
-
client_id?: string;
|
|
12
|
-
nonce?: string;
|
|
13
|
-
request_uri?: string;
|
|
14
|
-
client_id_scheme?: string;
|
|
15
|
-
} & Record<string, unknown>;
|
|
16
|
-
export declare enum SigningAlgo {
|
|
17
|
-
EDDSA = "EdDSA",
|
|
18
|
-
RS256 = "RS256",
|
|
19
|
-
PS256 = "PS256",
|
|
20
|
-
ES256 = "ES256",
|
|
21
|
-
ES256K = "ES256K"
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=Jwt.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Jwt.types.d.ts","sourceRoot":"","sources":["../../lib/jwt/Jwt.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE7F,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;AAExB,MAAM,MAAM,SAAS,GAAG,kBAAkB,GAAG;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5B,MAAM,MAAM,UAAU,GAAG,gBAAgB,GAAG;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5B,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;IACf,MAAM,WAAW;CAClB"}
|
package/dist/jwt/Jwt.types.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SigningAlgo = void 0;
|
|
4
|
-
var SigningAlgo;
|
|
5
|
-
(function (SigningAlgo) {
|
|
6
|
-
SigningAlgo["EDDSA"] = "EdDSA";
|
|
7
|
-
SigningAlgo["RS256"] = "RS256";
|
|
8
|
-
SigningAlgo["PS256"] = "PS256";
|
|
9
|
-
SigningAlgo["ES256"] = "ES256";
|
|
10
|
-
SigningAlgo["ES256K"] = "ES256K";
|
|
11
|
-
})(SigningAlgo || (exports.SigningAlgo = SigningAlgo = {}));
|
|
12
|
-
//# sourceMappingURL=Jwt.types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Jwt.types.js","sourceRoot":"","sources":["../../lib/jwt/Jwt.types.ts"],"names":[],"mappings":";;;AAmBA,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,gCAAiB,CAAA;AACnB,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB"}
|
package/dist/jwt/JwtIssuer.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { JWK, JwtHeader, JwtPayload, JwtProtectionMethod, SigningAlgo } from '..';
|
|
2
|
-
export interface JwtIssuerBase {
|
|
3
|
-
method: JwtProtectionMethod;
|
|
4
|
-
/**
|
|
5
|
-
* Additional options for the issuance context
|
|
6
|
-
*/
|
|
7
|
-
options?: Record<string, unknown>;
|
|
8
|
-
}
|
|
9
|
-
export interface JwtIssuerDid extends JwtIssuerBase {
|
|
10
|
-
method: 'did';
|
|
11
|
-
didUrl: string;
|
|
12
|
-
alg: SigningAlgo | string;
|
|
13
|
-
}
|
|
14
|
-
export interface JwtIssuerX5c extends JwtIssuerBase {
|
|
15
|
-
method: 'x5c';
|
|
16
|
-
alg: SigningAlgo | string;
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* Array of base64-encoded certificate strings in the DER-format.
|
|
20
|
-
*
|
|
21
|
-
* The certificate containing the public key corresponding to the key used to digitally sign the JWS MUST be the first certificate.
|
|
22
|
-
*/
|
|
23
|
-
x5c: Array<string>;
|
|
24
|
-
/**
|
|
25
|
-
* The issuer jwt
|
|
26
|
-
*
|
|
27
|
-
* This value will be used as the iss value of the issue jwt.
|
|
28
|
-
* It is also used as the client_id.
|
|
29
|
-
* And will also be set as the redirect_uri
|
|
30
|
-
*
|
|
31
|
-
* It must match an entry in the x5c certificate leaf entry dnsName / uriName
|
|
32
|
-
*/
|
|
33
|
-
issuer: string;
|
|
34
|
-
}
|
|
35
|
-
export interface JwtIssuerJwk extends JwtIssuerBase {
|
|
36
|
-
method: 'jwk';
|
|
37
|
-
alg: SigningAlgo | string;
|
|
38
|
-
jwk: JWK;
|
|
39
|
-
}
|
|
40
|
-
export interface JwtIssuerCustom extends JwtIssuerBase {
|
|
41
|
-
method: 'custom';
|
|
42
|
-
}
|
|
43
|
-
export type JwtIssuer = JwtIssuerDid | JwtIssuerX5c | JwtIssuerJwk | JwtIssuerCustom;
|
|
44
|
-
export interface JwtIssuanceContextBase {
|
|
45
|
-
type: string;
|
|
46
|
-
}
|
|
47
|
-
export type CreateJwtCallback<T extends JwtIssuer & JwtIssuanceContextBase> = (jwtIssuer: T, jwt: {
|
|
48
|
-
header: JwtHeader;
|
|
49
|
-
payload: JwtPayload;
|
|
50
|
-
}) => Promise<string>;
|
|
51
|
-
//# sourceMappingURL=JwtIssuer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JwtIssuer.d.ts","sourceRoot":"","sources":["../../lib/jwt/JwtIssuer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAElF,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,mBAAmB,CAAC;IAC5B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,MAAM,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,WAAW,GAAG,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,MAAM,EAAE,KAAK,CAAC;IACd,GAAG,EAAE,WAAW,GAAG,MAAM,CAAC;IAE1B;;;;;OAKG;IACH,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEnB;;;;;;;;OAQG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,MAAM,EAAE,KAAK,CAAC;IACd,GAAG,EAAE,WAAW,GAAG,MAAM,CAAC;IAC1B,GAAG,EAAE,GAAG,CAAC;CACV;AAED,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD,MAAM,EAAE,QAAQ,CAAC;CAClB;AAED,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,eAAe,CAAC;AAErF,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,SAAS,GAAG,sBAAsB,IAAI,CAC5E,SAAS,EAAE,CAAC,EACZ,GAAG,EAAE;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,UAAU,CAAA;CAAE,KAC5C,OAAO,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/jwt/JwtIssuer.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JwtIssuer.js","sourceRoot":"","sources":["../../lib/jwt/JwtIssuer.ts"],"names":[],"mappings":""}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { JWK, JwtHeader, JwtPayload, SigningAlgo } from '..';
|
|
2
|
-
import { JwtProtectionMethod, JwtType } from './jwtUtils';
|
|
3
|
-
export interface JwtVerifierBase {
|
|
4
|
-
type: JwtType;
|
|
5
|
-
method: JwtProtectionMethod;
|
|
6
|
-
}
|
|
7
|
-
export interface DidJwtVerifier extends JwtVerifierBase {
|
|
8
|
-
method: 'did';
|
|
9
|
-
alg: SigningAlgo | string;
|
|
10
|
-
didUrl: string;
|
|
11
|
-
}
|
|
12
|
-
export interface X5cJwtVerifier extends JwtVerifierBase {
|
|
13
|
-
method: 'x5c';
|
|
14
|
-
alg: SigningAlgo | string;
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* Array of base64-encoded certificate strings in the DER-format.
|
|
18
|
-
*
|
|
19
|
-
* The certificate containing the public key corresponding to the key used to digitally sign the JWS MUST be the first certificate.
|
|
20
|
-
*/
|
|
21
|
-
x5c: Array<string>;
|
|
22
|
-
/**
|
|
23
|
-
* The jwt issuer
|
|
24
|
-
*/
|
|
25
|
-
issuer: string;
|
|
26
|
-
}
|
|
27
|
-
export interface OpenIdFederationJwtVerifier extends JwtVerifierBase {
|
|
28
|
-
method: 'openid-federation';
|
|
29
|
-
/**
|
|
30
|
-
* The OpenId federation Entity
|
|
31
|
-
*/
|
|
32
|
-
entityId: string;
|
|
33
|
-
}
|
|
34
|
-
export interface JwkJwtVerifier extends JwtVerifierBase {
|
|
35
|
-
method: 'jwk';
|
|
36
|
-
alg: SigningAlgo | string;
|
|
37
|
-
jwk: JWK;
|
|
38
|
-
}
|
|
39
|
-
export interface CustomJwtVerifier extends JwtVerifierBase {
|
|
40
|
-
method: 'custom';
|
|
41
|
-
}
|
|
42
|
-
export type JwtVerifier = DidJwtVerifier | X5cJwtVerifier | CustomJwtVerifier | JwkJwtVerifier | OpenIdFederationJwtVerifier;
|
|
43
|
-
export declare const getDidJwtVerifier: (jwt: {
|
|
44
|
-
header: JwtHeader;
|
|
45
|
-
payload: JwtPayload;
|
|
46
|
-
}, options: {
|
|
47
|
-
type: JwtType;
|
|
48
|
-
}) => DidJwtVerifier;
|
|
49
|
-
export declare const getX5cVerifier: (jwt: {
|
|
50
|
-
header: JwtHeader;
|
|
51
|
-
payload: JwtPayload;
|
|
52
|
-
}, options: {
|
|
53
|
-
type: JwtType;
|
|
54
|
-
}) => X5cJwtVerifier;
|
|
55
|
-
export declare const getJwkVerifier: (jwt: {
|
|
56
|
-
header: JwtHeader;
|
|
57
|
-
payload: JwtPayload;
|
|
58
|
-
}, options: {
|
|
59
|
-
type: JwtType;
|
|
60
|
-
}) => Promise<JwkJwtVerifier>;
|
|
61
|
-
export declare const getJwtVerifierWithContext: (jwt: {
|
|
62
|
-
header: JwtHeader;
|
|
63
|
-
payload: JwtPayload;
|
|
64
|
-
}, options: {
|
|
65
|
-
type: JwtType;
|
|
66
|
-
}) => Promise<JwtVerifier>;
|
|
67
|
-
export type VerifyJwtCallbackBase<T extends JwtVerifier> = (jwtVerifier: T, jwt: {
|
|
68
|
-
header: JwtHeader;
|
|
69
|
-
payload: JwtPayload;
|
|
70
|
-
raw: string;
|
|
71
|
-
}) => Promise<boolean>;
|
|
72
|
-
//# sourceMappingURL=JwtVerifier.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JwtVerifier.d.ts","sourceRoot":"","sources":["../../lib/jwt/JwtVerifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,mBAAmB,CAAC;CAC7B;AAED,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,MAAM,EAAE,KAAK,CAAC;IAEd,GAAG,EAAE,WAAW,GAAG,MAAM,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,MAAM,EAAE,KAAK,CAAC;IAEd,GAAG,EAAE,WAAW,GAAG,MAAM,CAAC;IAE1B;;;;;OAKG;IACH,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEnB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,2BAA4B,SAAQ,eAAe;IAClE,MAAM,EAAE,mBAAmB,CAAC;IAE5B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,MAAM,EAAE,KAAK,CAAC;IACd,GAAG,EAAE,WAAW,GAAG,MAAM,CAAC;IAE1B,GAAG,EAAE,GAA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