vortez 5.0.0-dev.15 → 5.0.0-dev.16
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/.gitignore +0 -0
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/build/Template.d.ts +1 -1
- package/build/Template.js +1 -1
- package/build/Template.js.map +0 -0
- package/build/Vortez.d.ts +1 -1
- package/build/Vortez.js +1 -1
- package/build/Vortez.js.map +0 -0
- package/build/beta/Beta.d.ts +2 -2
- package/build/beta/Beta.js +2 -2
- package/build/beta/Beta.js.map +1 -1
- package/build/beta/JwtManager/Jwt.d.ts +32 -0
- package/build/beta/JwtManager/Jwt.js +33 -0
- package/build/beta/JwtManager/Jwt.js.map +1 -0
- package/build/beta/JwtManager/JwtManager.d.ts +49 -0
- package/build/beta/JwtManager/JwtManager.js +74 -0
- package/build/beta/JwtManager/JwtManager.js.map +1 -0
- package/build/beta/JwtManager/JwtUtils.d.ts +32 -0
- package/build/beta/JwtManager/JwtUtils.js +50 -0
- package/build/beta/JwtManager/JwtUtils.js.map +1 -0
- package/build/beta/JwtManager/KeyGenerator.d.ts +47 -0
- package/build/beta/JwtManager/KeyGenerator.js +92 -0
- package/build/beta/JwtManager/KeyGenerator.js.map +1 -0
- package/build/beta/JwtManager/algorithm/Algorithm.d.ts +68 -0
- package/build/beta/JwtManager/algorithm/Algorithm.js +82 -0
- package/build/beta/JwtManager/algorithm/Algorithm.js.map +1 -0
- package/build/beta/JwtManager/algorithm/ECDSA.d.ts +18 -0
- package/build/beta/JwtManager/algorithm/ECDSA.js +46 -0
- package/build/beta/JwtManager/algorithm/ECDSA.js.map +1 -0
- package/build/beta/JwtManager/algorithm/HMAC.d.ts +24 -0
- package/build/beta/JwtManager/algorithm/HMAC.js +38 -0
- package/build/beta/JwtManager/algorithm/HMAC.js.map +1 -0
- package/build/beta/JwtManager/algorithm/RSA.d.ts +24 -0
- package/build/beta/JwtManager/algorithm/RSA.js +52 -0
- package/build/beta/JwtManager/algorithm/RSA.js.map +1 -0
- package/build/beta/JwtManager/algorithm/RSAPSS.d.ts +24 -0
- package/build/beta/JwtManager/algorithm/RSAPSS.js +55 -0
- package/build/beta/JwtManager/algorithm/RSAPSS.js.map +1 -0
- package/build/beta/Mail.d.ts +1 -1
- package/build/beta/Mail.js +1 -1
- package/build/beta/Mail.js.map +0 -0
- package/build/logger/Debug.d.ts +1 -1
- package/build/logger/Debug.js +1 -1
- package/build/logger/Debug.js.map +0 -0
- package/build/logger/Logger.d.ts +1 -1
- package/build/logger/Logger.js +1 -1
- package/build/logger/Logger.js.map +0 -0
- package/build/server/BodyParser.d.ts +1 -1
- package/build/server/BodyParser.js +1 -1
- package/build/server/BodyParser.js.map +0 -0
- package/build/server/Cookie.d.ts +1 -1
- package/build/server/Cookie.js +1 -1
- package/build/server/Cookie.js.map +0 -0
- package/build/server/LoggerManager.d.ts +1 -1
- package/build/server/LoggerManager.js +1 -1
- package/build/server/LoggerManager.js.map +0 -0
- package/build/server/Request.d.ts +1 -1
- package/build/server/Request.js +1 -1
- package/build/server/Request.js.map +0 -0
- package/build/server/Response.d.ts +1 -1
- package/build/server/Response.js +1 -1
- package/build/server/Response.js.map +0 -0
- package/build/server/Server.d.ts +1 -1
- package/build/server/Server.js +1 -1
- package/build/server/Server.js.map +0 -0
- package/build/server/ServerDebug.d.ts +1 -1
- package/build/server/ServerDebug.js +1 -1
- package/build/server/ServerDebug.js.map +0 -0
- package/build/server/ServerError.d.ts +0 -0
- package/build/server/ServerError.js +0 -0
- package/build/server/ServerError.js.map +0 -0
- package/build/server/Session.d.ts +1 -1
- package/build/server/Session.js +1 -1
- package/build/server/Session.js.map +0 -0
- package/build/server/config/Config.d.ts +1 -1
- package/build/server/config/Config.js +1 -1
- package/build/server/config/Config.js.map +0 -0
- package/build/server/config/ConfigLoader.d.ts +1 -1
- package/build/server/config/ConfigLoader.js +1 -1
- package/build/server/config/ConfigLoader.js.map +0 -0
- package/build/server/config/ConfigValidator.d.ts +1 -1
- package/build/server/config/ConfigValidator.js +1 -1
- package/build/server/config/ConfigValidator.js.map +0 -0
- package/build/server/router/HttpRule.d.ts +0 -0
- package/build/server/router/HttpRule.js +0 -0
- package/build/server/router/HttpRule.js.map +0 -0
- package/build/server/router/Router.d.ts +1 -1
- package/build/server/router/Router.js +1 -1
- package/build/server/router/Router.js.map +0 -0
- package/build/server/router/Rule.d.ts +1 -1
- package/build/server/router/Rule.js +1 -1
- package/build/server/router/Rule.js.map +0 -0
- package/build/server/router/WsRule.d.ts +0 -0
- package/build/server/router/WsRule.js +0 -0
- package/build/server/router/WsRule.js.map +0 -0
- package/build/server/router/middleware/HttpMiddleware.d.ts +1 -1
- package/build/server/router/middleware/HttpMiddleware.js +1 -1
- package/build/server/router/middleware/HttpMiddleware.js.map +0 -0
- package/build/server/router/middleware/Middleware.d.ts +1 -1
- package/build/server/router/middleware/Middleware.js +1 -1
- package/build/server/router/middleware/Middleware.js.map +0 -0
- package/build/server/router/middleware/WsMiddleware.d.ts +1 -1
- package/build/server/router/middleware/WsMiddleware.js +1 -1
- package/build/server/router/middleware/WsMiddleware.js.map +0 -0
- package/build/server/websocket/Chunk.d.ts +1 -1
- package/build/server/websocket/Chunk.js +1 -1
- package/build/server/websocket/Chunk.js.map +0 -0
- package/build/server/websocket/Websocket.d.ts +1 -1
- package/build/server/websocket/Websocket.js +1 -1
- package/build/server/websocket/Websocket.js.map +0 -0
- package/build/utilities/ConsoleUI.d.ts +1 -1
- package/build/utilities/ConsoleUI.js +1 -1
- package/build/utilities/ConsoleUI.js.map +0 -0
- package/build/utilities/DebugUI.d.ts +1 -1
- package/build/utilities/DebugUI.js +1 -1
- package/build/utilities/DebugUI.js.map +0 -0
- package/build/utilities/Env.d.ts +0 -0
- package/build/utilities/Env.js +0 -0
- package/build/utilities/Env.js.map +0 -0
- package/build/utilities/Path.d.ts +0 -0
- package/build/utilities/Path.js +0 -0
- package/build/utilities/Path.js.map +0 -0
- package/build/utilities/Utilities.d.ts +1 -1
- package/build/utilities/Utilities.js +1 -1
- package/build/utilities/Utilities.js.map +0 -0
- package/changes.md +0 -0
- package/examples/in-docs.js +0 -0
- package/global/Source/Logo_960.png +0 -0
- package/global/Source/Logo_SM_960.png +0 -0
- package/global/Style/Template/Error.css +0 -0
- package/global/Style/Template/Folder.css +0 -0
- package/global/Style/Template/Template.css +0 -0
- package/global/Template/Error.vhtml +0 -0
- package/global/Template/Folder.vhtml +0 -0
- package/package.json +13 -9
- package/tests/Template/template.js +0 -0
- package/tests/Template/template.txt +0 -0
- package/tests/Template/template.vhtml +0 -0
- package/tests/debug.js +0 -0
- package/tests/jwtManager/jwtManager.js +46 -78
- package/tests/test.js +0 -0
- package/tests/test.vhtml +0 -0
- package/tests/utilities.js +0 -0
- package/tests/websocket.vhtml +0 -0
- package/build/beta/JwtManager.d.ts +0 -114
- package/build/beta/JwtManager.js +0 -249
- package/build/beta/JwtManager.js.map +0 -1
- package/tests/test.env +0 -0
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/build/utilities/Env.d.ts
CHANGED
|
File without changes
|
package/build/utilities/Env.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/build/utilities/Path.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/changes.md
CHANGED
|
File without changes
|
package/examples/in-docs.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vortez",
|
|
3
|
-
"version": "5.0.0-dev.
|
|
3
|
+
"version": "5.0.0-dev.16",
|
|
4
4
|
"description": "a module for web server creation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/Vortez.js",
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"test": "bash scripts/test.sh",
|
|
10
10
|
"publish": "bash scripts/publish.sh",
|
|
11
11
|
"dev": "bash scripts/dev.sh",
|
|
12
|
-
"dev.publish": "bash scripts/publish.sh"
|
|
12
|
+
"dev.publish": "bash scripts/publish.sh --dev"
|
|
13
13
|
},
|
|
14
14
|
"author": {
|
|
15
15
|
"name": "NetFeez",
|
|
16
|
-
"email": "
|
|
16
|
+
"email": "netfeez.dev@gmail.com",
|
|
17
17
|
"url": "https://NetFeez.github.io"
|
|
18
18
|
},
|
|
19
19
|
"license": "Apache-2.0",
|
|
@@ -33,12 +33,16 @@
|
|
|
33
33
|
"README.md"
|
|
34
34
|
],
|
|
35
35
|
"keywords": [
|
|
36
|
-
"web",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
36
|
+
"web",
|
|
37
|
+
"server",
|
|
38
|
+
"http",
|
|
39
|
+
"https",
|
|
40
|
+
"ws",
|
|
41
|
+
"wss",
|
|
42
|
+
"websocket"
|
|
39
43
|
],
|
|
40
44
|
"devDependencies": {
|
|
41
|
-
"@types/node": "^
|
|
42
|
-
"typescript": "^
|
|
45
|
+
"@types/node": "^25.5.0",
|
|
46
|
+
"typescript": "^6.0.2"
|
|
43
47
|
}
|
|
44
|
-
}
|
|
48
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/tests/debug.js
CHANGED
|
File without changes
|
|
@@ -1,108 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import Utilities from "../../build/Utilities.js";
|
|
1
|
+
// @ts-check
|
|
2
|
+
import JwtManager from "../../build/beta/JwtManager/JwtManager.js";
|
|
4
3
|
import { strict as assert } from 'assert';
|
|
5
4
|
|
|
5
|
+
/** @type { JwtManager.Algorithm.HashLength[] } */
|
|
6
6
|
const MASKS = ['256', '384', '512'];
|
|
7
|
-
const SECRET = 'secret';
|
|
8
7
|
|
|
9
|
-
const {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
format: 'pem'
|
|
14
|
-
},
|
|
15
|
-
privateKeyEncoding: {
|
|
16
|
-
type: 'pkcs8',
|
|
17
|
-
format: 'pem'
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const { publicKey: PSS_PUB_KEY, privateKey: PSS_PRIV_KEY } = CRYPTO.generateKeyPairSync('rsa-pss', {
|
|
22
|
-
modulusLength: 2048,
|
|
23
|
-
publicKeyEncoding: {
|
|
24
|
-
type: 'spki',
|
|
25
|
-
format: 'pem'
|
|
26
|
-
},
|
|
27
|
-
privateKeyEncoding: {
|
|
28
|
-
type: 'pkcs8',
|
|
29
|
-
format: 'pem'
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
const { publicKey: EC_PUB_KEY, privateKey: EC_PRIV_KEY } = CRYPTO.generateKeyPairSync('ec', {
|
|
34
|
-
namedCurve: 'secp256k1',
|
|
35
|
-
publicKeyEncoding: {
|
|
36
|
-
type: 'spki',
|
|
37
|
-
format: 'pem'
|
|
38
|
-
},
|
|
39
|
-
privateKeyEncoding: {
|
|
40
|
-
type: 'pkcs8',
|
|
41
|
-
format: 'pem'
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
const body = {
|
|
46
|
-
test: 'test',
|
|
47
|
-
XD: "xd"
|
|
48
|
-
};
|
|
8
|
+
const { pub: HMAC_PUB_KEY, key: SECRET } = JwtManager.KeyGenerator.generate('secret');
|
|
9
|
+
const { pub: RSA_PUB_KEY, key: RSA_PRIV_KEY } = JwtManager.KeyGenerator.generate('rsa');
|
|
10
|
+
const { pub: PSS_PUB_KEY, key: PSS_PRIV_KEY } = JwtManager.KeyGenerator.generate('rsa-pss');
|
|
11
|
+
const { pub: EC_PUB_KEY, key: EC_PRIV_KEY } = JwtManager.KeyGenerator.generate('ec');
|
|
49
12
|
|
|
50
|
-
const
|
|
51
|
-
|
|
13
|
+
const payload = {
|
|
14
|
+
uuid: '00000000-0000-0000-0000-000000000000',
|
|
15
|
+
name: 'NetFeez',
|
|
16
|
+
email: 'netfeez.dev@gmail.com'
|
|
52
17
|
};
|
|
53
18
|
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
console.log('Utilities.base64UrlEncode passed');
|
|
19
|
+
const header = {
|
|
20
|
+
exp: Math.floor((Date.now() + 10000) / 1000)
|
|
57
21
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const testJwtManagerSignVerify = (algorithm, key, pubKey) => {
|
|
65
|
-
const jwt = new JwtManager(algorithm,
|
|
22
|
+
/**
|
|
23
|
+
* Tests the signing and verification of JWTs using the specified algorithm and key.
|
|
24
|
+
* @param { JwtManager.AlgorithmName } algorithm The name of the algorithm to be tested (e.g., 'HS256', 'RS256', etc.).
|
|
25
|
+
* @param { string } key The secret key or private key to be used for signing and verifying JWTs.
|
|
26
|
+
* @param { string | null } pubKey The public key to be used for verifying JWTs (required for asymmetric algorithms).
|
|
27
|
+
*/
|
|
28
|
+
const testJwtManagerSignVerify = (algorithm, key, pubKey = null) => {
|
|
29
|
+
const jwt = new JwtManager(algorithm, {
|
|
30
|
+
key: key,
|
|
31
|
+
pub: pubKey || null
|
|
32
|
+
});
|
|
66
33
|
console.log('--------------------------')
|
|
67
|
-
const
|
|
68
|
-
console.log('jwt:',
|
|
69
|
-
if (algorithm.startsWith('HS'))
|
|
70
|
-
|
|
71
|
-
} else {
|
|
34
|
+
const token = jwt.sign(payload, header);
|
|
35
|
+
console.log('jwt:', token);
|
|
36
|
+
/* if (algorithm.startsWith('HS')) console.log('secret:', key);
|
|
37
|
+
else {
|
|
72
38
|
console.log('Private Key:', key);
|
|
73
|
-
if (pubKey)
|
|
74
|
-
|
|
75
|
-
|
|
39
|
+
if (pubKey) console.log('Public Key:', pubKey);
|
|
40
|
+
} */
|
|
41
|
+
try {
|
|
42
|
+
const parsed = jwt.parse(token);
|
|
43
|
+
console.log(parsed, '\n');
|
|
44
|
+
assert.deepEqual(parsed.payload, payload);
|
|
45
|
+
console.log(`${algorithm} test passed`);
|
|
46
|
+
} catch (error) {
|
|
47
|
+
console.error(`${algorithm} test failed:`, error);
|
|
76
48
|
}
|
|
77
|
-
const verificationResult = jwt.verify(JWTObject);
|
|
78
|
-
console.log(verificationResult, '\n');
|
|
79
|
-
assert.equal(verificationResult.verify, true);
|
|
80
|
-
assert.deepEqual(verificationResult.body, body);
|
|
81
|
-
console.log(`${algorithm} test passed`);
|
|
82
49
|
};
|
|
83
50
|
|
|
84
51
|
const runTests = () => {
|
|
85
52
|
try {
|
|
86
|
-
testBase64UrlEncode();
|
|
87
|
-
testBase64UrlDecode();
|
|
88
|
-
|
|
89
53
|
for (let index = 0; index < MASKS.length; index++) {
|
|
90
|
-
|
|
54
|
+
/** @type { JwtManager.AlgorithmName } */
|
|
55
|
+
const algorithm = `HS${MASKS[index]}`;
|
|
91
56
|
testJwtManagerSignVerify(algorithm, SECRET);
|
|
92
57
|
|
|
93
|
-
|
|
58
|
+
/** @type { JwtManager.AlgorithmName } */
|
|
59
|
+
const algorithmRS = `RS${MASKS[index]}`;
|
|
94
60
|
testJwtManagerSignVerify(algorithmRS, RSA_PRIV_KEY, RSA_PUB_KEY);
|
|
95
61
|
|
|
96
|
-
|
|
62
|
+
/** @type { JwtManager.AlgorithmName } */
|
|
63
|
+
const algorithmPS = `PS${MASKS[index]}`;
|
|
97
64
|
testJwtManagerSignVerify(algorithmPS, PSS_PRIV_KEY, PSS_PUB_KEY);
|
|
98
65
|
|
|
99
|
-
|
|
66
|
+
/** @type { JwtManager.AlgorithmName } */
|
|
67
|
+
const algorithmES = `ES${MASKS[index]}`;
|
|
100
68
|
testJwtManagerSignVerify(algorithmES, EC_PRIV_KEY, EC_PUB_KEY);
|
|
101
69
|
}
|
|
102
70
|
|
|
103
71
|
console.log('All tests passed');
|
|
104
72
|
} catch (error) {
|
|
105
|
-
console.error('Test failed:', error
|
|
73
|
+
console.error('Test failed:', error);
|
|
106
74
|
}
|
|
107
75
|
};
|
|
108
76
|
|
package/tests/test.js
CHANGED
|
File without changes
|
package/tests/test.vhtml
CHANGED
|
File without changes
|
package/tests/utilities.js
CHANGED
|
File without changes
|
package/tests/websocket.vhtml
CHANGED
|
File without changes
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author NetFeez <codefeez.dev@gmail.com>
|
|
3
|
-
* @description add the json web token manager to the Vortez.
|
|
4
|
-
* @license Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
export declare class JwtManager {
|
|
7
|
-
private static validSignMethods;
|
|
8
|
-
private static validMaskMethods;
|
|
9
|
-
private static signMethodMap;
|
|
10
|
-
private static maskMethodMap;
|
|
11
|
-
private algorithm;
|
|
12
|
-
private signMethod;
|
|
13
|
-
private maskMethod;
|
|
14
|
-
private privKey;
|
|
15
|
-
private pubKey;
|
|
16
|
-
/**
|
|
17
|
-
* create a new jwt manager
|
|
18
|
-
* @param algorithm the algorithm to use
|
|
19
|
-
* @param key the private key or secret to use
|
|
20
|
-
* @throws an error if the algorithm is not valid
|
|
21
|
-
* @throws an error if the key/secret is not valid
|
|
22
|
-
*/
|
|
23
|
-
constructor(algorithm: JwtManager.jwtAlgorithms, key: string);
|
|
24
|
-
/**
|
|
25
|
-
* sign a jwt
|
|
26
|
-
* @param body the body of the jwt
|
|
27
|
-
* @param options the options to sign the jwt
|
|
28
|
-
* @returns the signed jwt
|
|
29
|
-
*/
|
|
30
|
-
sign(body: JwtManager.body, options?: JwtManager.signOptions): string;
|
|
31
|
-
/**
|
|
32
|
-
* verify a jwt
|
|
33
|
-
* @param jwt the jwt to verify
|
|
34
|
-
* @param options the options to verify the jwt
|
|
35
|
-
* @returns the verified jwt
|
|
36
|
-
*/
|
|
37
|
-
parse(jwt: string, options?: JwtManager.verifyOptions): JwtManager.jwtObject;
|
|
38
|
-
/**
|
|
39
|
-
* sign a jwt
|
|
40
|
-
* @param body the body of the jwt
|
|
41
|
-
* @param options the options to sign the jwt
|
|
42
|
-
* @returns the signed jwt
|
|
43
|
-
* @throws an error if the algorithm is not valid
|
|
44
|
-
* @throws an error if the key/secret is not valid
|
|
45
|
-
*/
|
|
46
|
-
static sign(body: JwtManager.body, algorithm: JwtManager.jwtAlgorithms, privKey: string, options: JwtManager.signOptions): string;
|
|
47
|
-
/**
|
|
48
|
-
* verify a jwt
|
|
49
|
-
* @param jwt the jwt to verify
|
|
50
|
-
* @param options the options to verify the jwt
|
|
51
|
-
* @returns the verified jwt
|
|
52
|
-
* @throws an error if the algorithm is not valid
|
|
53
|
-
* @throws an error if the key/secret is not valid
|
|
54
|
-
*/
|
|
55
|
-
static parse(jwt: string, pubKey: string, options?: JwtManager.verifyOptions): JwtManager.jwtObject;
|
|
56
|
-
/**
|
|
57
|
-
* validate an private key
|
|
58
|
-
* @param signMethod the sign method
|
|
59
|
-
* @param key the private key
|
|
60
|
-
* @param sendThrows whether to throw an error if the private key is invalid
|
|
61
|
-
* @returns true if the private key is valid
|
|
62
|
-
* @throws an error if the private key is invalid
|
|
63
|
-
*/
|
|
64
|
-
private static validateKey;
|
|
65
|
-
private static getPubKey;
|
|
66
|
-
private static getAlgorithmInfo;
|
|
67
|
-
}
|
|
68
|
-
export declare namespace JwtManager {
|
|
69
|
-
type signMethods = 'HMAC' | 'RSA' | 'ECDSA' | 'RSA-PSS';
|
|
70
|
-
type maskMethods = 'SHA256' | 'SHA384' | 'SHA512';
|
|
71
|
-
type jwtSignMethods = 'HS' | 'RS' | 'PS' | 'ES';
|
|
72
|
-
type jwtMaskMethods = '256' | '384' | '512';
|
|
73
|
-
type jwtAlgorithms = `${jwtSignMethods}${jwtMaskMethods}`;
|
|
74
|
-
interface signMethodMap {
|
|
75
|
-
HS: 'HMAC';
|
|
76
|
-
RS: 'RSA';
|
|
77
|
-
PS: 'RSA-PSS';
|
|
78
|
-
ES: 'ECDSA';
|
|
79
|
-
}
|
|
80
|
-
interface maskMethodMap {
|
|
81
|
-
'256': 'SHA256';
|
|
82
|
-
'384': 'SHA384';
|
|
83
|
-
'512': 'SHA512';
|
|
84
|
-
}
|
|
85
|
-
interface algorithmInfo {
|
|
86
|
-
signMethod?: signMethods;
|
|
87
|
-
maskMethod?: maskMethods;
|
|
88
|
-
}
|
|
89
|
-
interface headers {
|
|
90
|
-
exp?: number;
|
|
91
|
-
[key: string]: any | undefined;
|
|
92
|
-
}
|
|
93
|
-
interface head extends headers {
|
|
94
|
-
alg: jwtAlgorithms;
|
|
95
|
-
typ: 'JWT';
|
|
96
|
-
}
|
|
97
|
-
interface body {
|
|
98
|
-
[key: string]: any | undefined;
|
|
99
|
-
}
|
|
100
|
-
interface jwtObject {
|
|
101
|
-
body: body;
|
|
102
|
-
head: head;
|
|
103
|
-
signature: string;
|
|
104
|
-
verify: boolean;
|
|
105
|
-
}
|
|
106
|
-
interface verifyOptions {
|
|
107
|
-
expire?: boolean;
|
|
108
|
-
}
|
|
109
|
-
interface signOptions {
|
|
110
|
-
expire?: Date;
|
|
111
|
-
[key: string]: any | undefined;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
export default JwtManager;
|