@carecard/auth-util 3.1.15 → 3.2.0

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.
@@ -1,24 +0,0 @@
1
- export const privateKey =
2
- '-----BEGIN RSA PRIVATE KEY-----\n' +
3
- 'MIICWgIBAAKBgF/34KV8D2pL57AiOSBYaNeCdVZEbXTOjR2J/UEH/F240gTxVT2K' +
4
- 'nXOP4W6OdFkSEsdDWLqhLO2OP68oakh3dm0Yzb8U+4Eos5Z3ZS+hgZCiutmm4Ef2' +
5
- 'krUshS8BI8MJvI4YPn4meJzaDz3SccQ2O9V6YpaYX1VqHO48qNGpg/LdAgMBAAEC' +
6
- 'gYBGlYAK9uY3nkB4EZPGsH/cEj3PB2EiClFMKpO0YvVA0ZDWxdGWA/+uYWLC98+n' +
7
- 'O13IZUY7bhQnXPqGD8msJwFYcCJahMtDlr0UvYVgTlYj7pVUjZEdj975vbSeVpu+' +
8
- 'MNK5KwQEel5phrpajpvX0feWjAKZQ7rt+xbAQ66azP4RwQJBALD8zJavNcSCUcKX' +
9
- 'Ll3gjgUOCeNxWGmy4Pj9QQV/SCUF0OPYl1tfS5+8hrDJRhElLaFon8TqAvZI+CxP' +
10
- 'cSBDrpkCQQCKz7Ys/O+NyNYC9eQuyUmLqgMQD9z3nJKbZrmhpGQNnTmkdBhdME3F' +
11
- 'Bn71GM6g5roDZPv8jbue1Rnma2vXDWTlAkBoiVh55BEY+XQ7QDplvn2D5M/YZBk5' +
12
- 'jSsuRb+C9LPzEiVYfpSfpoCvX5YakzdsZw41mOtNTn7jYyQaX+3Mhc15AkAQAzX4' +
13
- 'qpTXvjsxzDuuSfn56nq/95R928nts0PmqZgBGgn0NpA478GI4N70VxA+71611Yhb' +
14
- '8d2azOpX8jxWam0hAkBeLsgPso9MiFXtRnl4jLt7X5CT673EY3oFSRq+ZJNE1pGQ' +
15
- '7Z/g7Yg/WeznAvpqYx3b6m3DpPzrPU6KWQ/Gfs+L\n' +
16
- '-----END RSA PRIVATE KEY-----';
17
-
18
- export const publicKey =
19
- '-----BEGIN PUBLIC KEY-----\n' +
20
- 'MIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgF/34KV8D2pL57AiOSBYaNeCdVZE' +
21
- 'bXTOjR2J/UEH/F240gTxVT2KnXOP4W6OdFkSEsdDWLqhLO2OP68oakh3dm0Yzb8U' +
22
- '+4Eos5Z3ZS+hgZCiutmm4Ef2krUshS8BI8MJvI4YPn4meJzaDz3SccQ2O9V6YpaY' +
23
- 'X1VqHO48qNGpg/LdAgMBAAE=\n' +
24
- '-----END PUBLIC KEY-----';
@@ -1,40 +0,0 @@
1
- import * as assert from 'assert';
2
- import * as pwdUtilAuth from '../src/pwdUtilAuth';
3
-
4
- describe('PwdUtilAuth test', function () {
5
- it('assemblePasswordHash called with algorithmBase64, hashBase64, saltBase64 returns password hash', function () {
6
- const algorithmBase64 = 'c2hhMjU2';
7
- const hashBase64 = 'c2hhMjU2';
8
- const saltBase64 = 'c2hhMjU2';
9
- const expectedHash = '$1$c2hhMjU2$c2hhMjU2$c2hhMjU2$';
10
-
11
- const returnedHash = pwdUtilAuth._assemblePasswordHash(algorithmBase64, hashBase64, saltBase64);
12
-
13
- assert.deepStrictEqual(returnedHash, expectedHash);
14
- });
15
-
16
- it('disassemblePasswordHash called with save hash', function () {
17
- const savedHash = '$1$c2hhMjU2$c2hhMjU$c2hhMjU2$';
18
- const hashBase64 = 'c2hhMjU';
19
- const saltBase64 = 'c2hhMjU2';
20
-
21
- const { version, alg, hash, salt } = pwdUtilAuth._disassemblePasswordHash(savedHash);
22
-
23
- assert.deepStrictEqual(salt, saltBase64);
24
- assert.deepStrictEqual(hash, hashBase64);
25
- assert.deepStrictEqual(version, '1');
26
- assert.deepStrictEqual(alg, 'c2hhMjU2');
27
- });
28
-
29
- it('createPasswordHash called with save hash', function () {
30
- const password = 'bigSecret*2';
31
- const secret = '240gTxVT2KnXOP4W6OdFkSEsdDWLqhLO2OP68o';
32
- const algorithm = 'sha512';
33
- const salt = '6h29BnpUkqfrmtnY1xUrAGZcpcAl5cUEJ4Qjj+BGXbo=';
34
- const expectedHash =
35
- '$1$c2hhNTEy$rNPXY0aVOYsdenIAWdfxDL6d6247s+ScI9kcDvEBkipNo7S9QDy6utTqTcQLY3+tufc0f7AvmdocotW7bDIyYA==$6h29BnpUkqfrmtnY1xUrAGZcpcAl5cUEJ4Qjj+BGXbo=$';
36
- const hash = pwdUtilAuth._createPasswordHash(password, secret, salt, algorithm);
37
-
38
- assert.deepStrictEqual(hash, expectedHash);
39
- });
40
- });
@@ -1,14 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "lib": ["ES2020", "ES2021", "dom"],
5
- "declaration": true,
6
- "strict": true,
7
- "moduleResolution": "Node",
8
- "esModuleInterop": true,
9
- "skipLibCheck": true,
10
- "isolatedModules": true
11
- },
12
- "include": ["src"],
13
- "exclude": ["node_modules", "dist", "tests"]
14
- }
package/tsconfig.cjs.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "./tsconfig.base.json",
3
- "compilerOptions": {
4
- "module": "CommonJS",
5
- "outDir": "dist/cjs"
6
- }
7
- }
package/tsconfig.esm.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "./tsconfig.base.json",
3
- "compilerOptions": {
4
- "module": "ESNext",
5
- "outDir": "dist/esm"
6
- }
7
- }