@denodeio/seshat 0.0.32 → 0.0.33
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/build/cjs/dist/mjs/src/index.d.ts +3 -3
- package/build/cjs/index.d.ts +4 -3
- package/build/cjs/index.js +3 -0
- package/build/cjs/index.js.map +1 -1
- package/build/mjs/dist/mjs/src/index.d.ts +3 -3
- package/build/mjs/index.d.ts +4 -3
- package/build/mjs/index.js +3 -0
- package/build/mjs/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { PublicKey, Secret } from "jsonwebtoken";
|
|
2
2
|
type JwsSignature = {
|
|
3
3
|
protected: string;
|
|
4
4
|
header: {
|
|
@@ -10,9 +10,9 @@ type JwsPayload = {
|
|
|
10
10
|
payload: string;
|
|
11
11
|
signatures: JwsSignature[];
|
|
12
12
|
};
|
|
13
|
-
type Keychain = {
|
|
13
|
+
export type Keychain = {
|
|
14
14
|
algorithm: string;
|
|
15
|
-
value:
|
|
15
|
+
value: Secret | PublicKey;
|
|
16
16
|
};
|
|
17
17
|
type JwtPayload<T> = {
|
|
18
18
|
iss: string;
|
package/build/mjs/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { Secret, PublicKey } from 'jsonwebtoken';
|
|
2
|
+
|
|
2
3
|
type SignJwsResponse = {
|
|
3
4
|
payload: string;
|
|
4
5
|
signatures: {
|
|
@@ -26,7 +27,7 @@ type JwsPayload = {
|
|
|
26
27
|
};
|
|
27
28
|
type Keychain = {
|
|
28
29
|
algorithm: string;
|
|
29
|
-
value:
|
|
30
|
+
value: Secret | PublicKey;
|
|
30
31
|
};
|
|
31
32
|
type JwtPayload<T> = {
|
|
32
33
|
iss: string;
|
|
@@ -49,4 +50,4 @@ declare const sessionVerifier: (options: OptionsInput) => (req: any, res: any, n
|
|
|
49
50
|
declare const managementSigner: (options: any) => (req: any, res: any, next: any) => void;
|
|
50
51
|
declare const validateJws: <T>(key: Keychain, input: JwsPayload) => JwtPayload<T> | undefined;
|
|
51
52
|
|
|
52
|
-
export { managementSigner, sessionVerifier, signData, signJws, signPayload, validateJws };
|
|
53
|
+
export { type Keychain, managementSigner, sessionVerifier, signData, signJws, signPayload, validateJws };
|
package/build/mjs/index.js
CHANGED
|
@@ -6528,6 +6528,9 @@ const sessionVerifier = function (options) {
|
|
|
6528
6528
|
res.send("Signature verification raised: Authorization header is missing or malformed");
|
|
6529
6529
|
return;
|
|
6530
6530
|
}
|
|
6531
|
+
if (!jwtPublicKey) {
|
|
6532
|
+
throw new Error("JWT Public key should be set");
|
|
6533
|
+
}
|
|
6531
6534
|
try {
|
|
6532
6535
|
req[fieldName] = jwt.verify(authHeader, jwtPublicKey, verificationOptions);
|
|
6533
6536
|
}
|