@carecard/jwt-read 2.0.1 → 3.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/index.js +1 -0
- package/lib/jwtLib.js +85 -38
- package/lib/jwtRoles.js +5 -5
- package/package.json +5 -5
- package/coverage/clover.xml +0 -206
- package/coverage/coverage-final.json +0 -4
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -146
- package/coverage/lcov-report/index.ts.html +0 -94
- package/coverage/lcov-report/jwtLib.ts.html +0 -1363
- package/coverage/lcov-report/jwtRoles.ts.html +0 -151
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov-report/types.d.ts.html +0 -175
- package/coverage/lcov.info +0 -428
- package/dist/cjs/index.d.ts +0 -3
- package/dist/cjs/index.js +0 -19
- package/dist/cjs/jwtLib.d.ts +0 -38
- package/dist/cjs/jwtLib.js +0 -393
- package/dist/cjs/jwtRoles.d.ts +0 -2
- package/dist/cjs/jwtRoles.js +0 -19
- package/dist/cjs/types.d.ts +0 -25
- package/dist/cjs/types.js +0 -2
- package/dist/esm/index.d.ts +0 -3
- package/dist/esm/index.js +0 -3
- package/dist/esm/jwtLib.d.ts +0 -38
- package/dist/esm/jwtLib.js +0 -325
- package/dist/esm/jwtRoles.d.ts +0 -2
- package/dist/esm/jwtRoles.js +0 -15
- package/dist/esm/types.d.ts +0 -25
- package/dist/esm/types.js +0 -1
package/index.js
CHANGED
|
@@ -11,6 +11,7 @@ module.exports = {
|
|
|
11
11
|
jwtClientId: jwtLib.jwtClientId,
|
|
12
12
|
visitorClientId: jwtLib.visitorClientId,
|
|
13
13
|
isJwtExpired: jwtLib.isJwtExpired,
|
|
14
|
+
jwtAgeInSeconds: jwtLib.jwtAgeInSeconds,
|
|
14
15
|
verifyJwtAndRole: jwtLib.verifyJwtAndRole,
|
|
15
16
|
throwUsedTokenError: jwtLib.throwUsedTokenError,
|
|
16
17
|
doesJwtUserHasRole: jwtLib.doesJwtUserHasRole,
|
package/lib/jwtLib.js
CHANGED
|
@@ -6,21 +6,26 @@ const {
|
|
|
6
6
|
} = require( "@carecard/common-util" ).error;
|
|
7
7
|
|
|
8
8
|
function jwtClientId( req ) {
|
|
9
|
-
|
|
10
|
-
return
|
|
11
|
-
|
|
9
|
+
const jwtObj = req?.jwt || this;
|
|
10
|
+
return jwtObj?.payload?.client_id;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
function visitorClientId( req ) {
|
|
15
|
-
|
|
16
|
-
return
|
|
17
|
-
|
|
14
|
+
const visitorObj = req?.visitor || this;
|
|
15
|
+
return visitorObj?.payload?.client_id;
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
function doesJwtUserHasRole( req, userRole ) {
|
|
19
|
+
// Check if called as req.jwt.doesJwtUserHasRole(userRole) or doesJwtUserHasRole(role)
|
|
20
|
+
if ( arguments.length === 1 && typeof req === 'string' ) {
|
|
21
|
+
userRole = req;
|
|
22
|
+
req = undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const jwtObj = req?.jwt || this;
|
|
21
26
|
|
|
22
27
|
if ( userRole && typeof userRole === "string" ) {
|
|
23
|
-
return
|
|
28
|
+
return jwtObj?.payload?.roles?.includes( userRole );
|
|
24
29
|
} else {
|
|
25
30
|
throwNotAuthorizedError();
|
|
26
31
|
}
|
|
@@ -33,38 +38,55 @@ function throwError( customErrorFunction ) {
|
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
function isJwtExpired( req, jwtValiditySeconds ) {
|
|
41
|
+
// Check if called as req.jwt.isJwtExpired(seconds) or isJwtExpired(seconds)
|
|
42
|
+
if ( arguments.length === 1 && typeof req === 'number' ) {
|
|
43
|
+
jwtValiditySeconds = req;
|
|
44
|
+
req = undefined;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const jwtObj = req?.jwt || this;
|
|
48
|
+
|
|
49
|
+
if ( jwtObj?.payload?.exp ) {
|
|
50
|
+
return ( Math.floor( Date.now() / 1000 ) ) >= jwtObj.payload.exp;
|
|
51
|
+
}
|
|
36
52
|
|
|
37
53
|
if ( jwtValiditySeconds && typeof jwtValiditySeconds === "number" ) {
|
|
38
|
-
return ( parseInt( jwtValiditySeconds )
|
|
54
|
+
return ( parseInt( jwtValiditySeconds ) ) < jwtAgeInSeconds.call( this, req );
|
|
39
55
|
} else {
|
|
40
56
|
return true;
|
|
41
57
|
}
|
|
42
58
|
|
|
43
59
|
}
|
|
44
60
|
|
|
45
|
-
function
|
|
61
|
+
function jwtAgeInSeconds( req ) {
|
|
62
|
+
const jwtObj = req?.jwt || this;
|
|
63
|
+
|
|
64
|
+
if ( jwtObj?.payload?.iat ) {
|
|
46
65
|
|
|
47
|
-
|
|
66
|
+
let iat = jwtObj.payload.iat;
|
|
67
|
+
if ( iat > 1000000000000 ) {
|
|
68
|
+
iat = Math.floor( iat / 1000 );
|
|
69
|
+
}
|
|
48
70
|
|
|
49
|
-
|
|
50
|
-
return
|
|
71
|
+
jwtObj[ "age" ] = Math.floor( Date.now() / 1000 ) - iat;
|
|
72
|
+
return jwtObj.age;
|
|
51
73
|
|
|
52
74
|
} else {
|
|
53
75
|
|
|
54
|
-
|
|
55
|
-
return
|
|
76
|
+
jwtObj[ "age" ] = Infinity
|
|
77
|
+
return jwtObj.age;
|
|
56
78
|
|
|
57
79
|
}
|
|
58
80
|
}
|
|
59
81
|
|
|
60
82
|
async function validateAndExtractJwtObject( req, publicKey, customErrorFunction ) {
|
|
61
83
|
|
|
62
|
-
const jwtString =
|
|
84
|
+
const jwtString = _validateJwt( req, customErrorFunction );
|
|
63
85
|
|
|
64
|
-
const isJwtSignatureValid =
|
|
86
|
+
const isJwtSignatureValid = jwtUtilAuth.verifyJwtSignature( jwtString, publicKey );
|
|
65
87
|
|
|
66
88
|
if ( jwtString && isJwtSignatureValid ) {
|
|
67
|
-
|
|
89
|
+
_extractJwtObject( req, jwtString, customErrorFunction );
|
|
68
90
|
} else {
|
|
69
91
|
req[ "jwt" ] = null;
|
|
70
92
|
throwError( customErrorFunction );
|
|
@@ -75,12 +97,12 @@ async function validateAndExtractJwtObject( req, publicKey, customErrorFunction
|
|
|
75
97
|
|
|
76
98
|
async function validateAndExtractWebToken( req, publicKey, headerName, customErrorFunction ) {
|
|
77
99
|
|
|
78
|
-
const webTokenString =
|
|
100
|
+
const webTokenString = _validateWebToken( req, headerName, customErrorFunction );
|
|
79
101
|
|
|
80
|
-
const isJwtSignatureValid =
|
|
102
|
+
const isJwtSignatureValid = jwtUtilAuth.verifyJwtSignature( webTokenString, publicKey );
|
|
81
103
|
|
|
82
104
|
if ( webTokenString && isJwtSignatureValid ) {
|
|
83
|
-
|
|
105
|
+
_extractJwtObject( req, webTokenString, customErrorFunction );
|
|
84
106
|
} else {
|
|
85
107
|
req[ "jwt" ] = null;
|
|
86
108
|
throwError( customErrorFunction );
|
|
@@ -93,12 +115,12 @@ async function validateAndExtractJwtObjectNoThrow( req, publicKey ) {
|
|
|
93
115
|
|
|
94
116
|
try {
|
|
95
117
|
|
|
96
|
-
const jwtString =
|
|
118
|
+
const jwtString = _validateJwtNoThrow( req );
|
|
97
119
|
|
|
98
|
-
const isJwtSignatureValid =
|
|
120
|
+
const isJwtSignatureValid = jwtUtilAuth.verifyJwtSignature( jwtString, publicKey );
|
|
99
121
|
|
|
100
122
|
if ( jwtString && isJwtSignatureValid ) {
|
|
101
|
-
|
|
123
|
+
_extractJwtObjectNoThrow( req, jwtString );
|
|
102
124
|
} else {
|
|
103
125
|
req[ "jwt" ] = null;
|
|
104
126
|
}
|
|
@@ -118,10 +140,10 @@ async function validateAndExtractWebTokenObjectNoThrow( req, publicKey, headerNa
|
|
|
118
140
|
|
|
119
141
|
const jwtString = _validateWebTokenNoThrow( req, headerName );
|
|
120
142
|
|
|
121
|
-
const isJwtSignatureValid =
|
|
143
|
+
const isJwtSignatureValid = jwtUtilAuth.verifyJwtSignature( jwtString, publicKey );
|
|
122
144
|
|
|
123
145
|
if ( jwtString && isJwtSignatureValid ) {
|
|
124
|
-
|
|
146
|
+
_extractJwtObjectNoThrow( req, jwtString );
|
|
125
147
|
} else {
|
|
126
148
|
req[ "jwt" ] = null;
|
|
127
149
|
}
|
|
@@ -139,12 +161,12 @@ async function validateAndExtractVisitorObjectNoThrow( req, publicKey ) {
|
|
|
139
161
|
|
|
140
162
|
try {
|
|
141
163
|
|
|
142
|
-
const jwtString =
|
|
164
|
+
const jwtString = _validateVisitorNoThrow( req );
|
|
143
165
|
|
|
144
|
-
const isJwtSignatureValid =
|
|
166
|
+
const isJwtSignatureValid = jwtUtilAuth.verifyJwtSignature( jwtString, publicKey );
|
|
145
167
|
|
|
146
168
|
if ( jwtString && isJwtSignatureValid ) {
|
|
147
|
-
|
|
169
|
+
_extractVisitorObjectNoThrow( req, jwtString );
|
|
148
170
|
} else {
|
|
149
171
|
req[ "visitor" ] = null;
|
|
150
172
|
}
|
|
@@ -163,7 +185,7 @@ function verifyJwtAndRole( role, publicKey, customErrorFunction ) {
|
|
|
163
185
|
await validateAndExtractJwtObject( req, publicKey, customErrorFunction )
|
|
164
186
|
.then( req => doesJwtUserHasRole( req, role ) )
|
|
165
187
|
.then( isRoleExist => _isLoginRequired( isRoleExist, customErrorFunction ) )
|
|
166
|
-
.then( next )
|
|
188
|
+
.then( () => next() )
|
|
167
189
|
.catch( next );
|
|
168
190
|
}
|
|
169
191
|
}
|
|
@@ -223,30 +245,55 @@ function _isLoginRequired( hasRequiredRole, customErrorFunction ) {
|
|
|
223
245
|
|
|
224
246
|
}
|
|
225
247
|
|
|
226
|
-
|
|
248
|
+
function _extractJwtObject( req, jwt, customErrorFunction ) {
|
|
227
249
|
if ( jwt && typeof jwt === "string" ) {
|
|
228
|
-
|
|
250
|
+
const jwtObj = jwtUtilAuth.getHeaderPayloadFromJwt( jwt );
|
|
251
|
+
_attachJwtMethods( jwtObj );
|
|
252
|
+
req[ "jwt" ] = jwtObj;
|
|
229
253
|
} else {
|
|
230
254
|
throwError( customErrorFunction );
|
|
231
255
|
}
|
|
232
256
|
}
|
|
233
257
|
|
|
234
|
-
|
|
258
|
+
function _extractJwtObjectNoThrow( req, jwt ) {
|
|
235
259
|
if ( jwt && typeof jwt === "string" ) {
|
|
236
|
-
|
|
260
|
+
const jwtObj = jwtUtilAuth.getHeaderPayloadFromJwt( jwt );
|
|
261
|
+
_attachJwtMethods( jwtObj );
|
|
262
|
+
req[ "jwt" ] = jwtObj;
|
|
237
263
|
} else {
|
|
238
264
|
req[ "jwt" ] = null;
|
|
239
265
|
}
|
|
240
266
|
}
|
|
241
267
|
|
|
242
|
-
|
|
268
|
+
function _extractVisitorObjectNoThrow( req, jwt ) {
|
|
243
269
|
if ( jwt && typeof jwt === "string" ) {
|
|
244
|
-
|
|
270
|
+
const visitorObj = jwtUtilAuth.getHeaderPayloadFromJwt( jwt );
|
|
271
|
+
_attachVisitorMethods( visitorObj );
|
|
272
|
+
req[ "visitor" ] = visitorObj;
|
|
245
273
|
} else {
|
|
246
274
|
req[ "visitor" ] = null;
|
|
247
275
|
}
|
|
248
276
|
}
|
|
249
277
|
|
|
278
|
+
function _attachJwtMethods( jwtObj ) {
|
|
279
|
+
if ( jwtObj ) {
|
|
280
|
+
Object.defineProperties( jwtObj, {
|
|
281
|
+
jwtClientId: { value: jwtClientId, enumerable: false },
|
|
282
|
+
doesJwtUserHasRole: { value: doesJwtUserHasRole, enumerable: false },
|
|
283
|
+
isJwtExpired: { value: isJwtExpired, enumerable: false },
|
|
284
|
+
jwtAgeInSeconds: { value: jwtAgeInSeconds, enumerable: false }
|
|
285
|
+
} );
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function _attachVisitorMethods( visitorObj ) {
|
|
290
|
+
if ( visitorObj ) {
|
|
291
|
+
Object.defineProperties( visitorObj, {
|
|
292
|
+
visitorClientId: { value: visitorClientId, enumerable: false }
|
|
293
|
+
} );
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
250
297
|
async function _isJwtSignatureValid( jwt, publicKey, customErrorFunction ) {
|
|
251
298
|
|
|
252
299
|
if ( jwt && typeof jwt === "string" ) {
|
|
@@ -265,7 +312,7 @@ async function _isJwtSignatureValidNoThrow( jwt, publicKey ) {
|
|
|
265
312
|
}
|
|
266
313
|
}
|
|
267
314
|
|
|
268
|
-
|
|
315
|
+
function _validateJwt( req, customErrorFunction ) {
|
|
269
316
|
|
|
270
317
|
// Get from http header.
|
|
271
318
|
let jwtRaw = req.get( "Authorization" );
|
|
@@ -281,7 +328,7 @@ async function _validateJwt( req, customErrorFunction ) {
|
|
|
281
328
|
}
|
|
282
329
|
}
|
|
283
330
|
|
|
284
|
-
|
|
331
|
+
function _validateWebToken( req, headerName, customErrorFunction ) {
|
|
285
332
|
|
|
286
333
|
// Get from http header.
|
|
287
334
|
let jwtRaw = req.get( headerName );
|
|
@@ -418,7 +465,7 @@ module.exports = {
|
|
|
418
465
|
_extractJwtObject,
|
|
419
466
|
_extractJwtObjectNoThrow,
|
|
420
467
|
validateAndExtractJwtObject,
|
|
421
|
-
|
|
468
|
+
jwtAgeInSeconds,
|
|
422
469
|
isJwtExpired,
|
|
423
470
|
doesJwtUserHasRole,
|
|
424
471
|
jwtClientId,
|
package/lib/jwtRoles.js
CHANGED
|
@@ -7,14 +7,14 @@ function getNameOfRoleFromCode( roleCode ) {
|
|
|
7
7
|
const codesToCategory = {
|
|
8
8
|
"ad": "admin",
|
|
9
9
|
"su": "super_admin",
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
11
|
return codesToCategory[ roleCode ] || "";
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
function getCodeFromNameOfRole(
|
|
15
|
-
const
|
|
14
|
+
function getCodeFromNameOfRole( roleName ) {
|
|
15
|
+
const namesToCode = {
|
|
16
16
|
"admin": "ad",
|
|
17
17
|
"super_admin": "su",
|
|
18
|
-
}
|
|
19
|
-
return
|
|
18
|
+
};
|
|
19
|
+
return namesToCode[ roleName ] || "";
|
|
20
20
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carecard/jwt-read",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/CareCard-ca/pkg-jwt-read.git"
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"author": "CareCard team",
|
|
19
19
|
"license": "ISC",
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"mocha": "11.7.
|
|
21
|
+
"mocha": "11.7.5"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@carecard/auth-util": "
|
|
25
|
-
"@carecard/common-util": "2.0.
|
|
26
|
-
"@carecard/validate": "2.
|
|
24
|
+
"@carecard/auth-util": "3.0.2",
|
|
25
|
+
"@carecard/common-util": "2.0.2",
|
|
26
|
+
"@carecard/validate": "2.2.12"
|
|
27
27
|
}
|
|
28
28
|
}
|
package/coverage/clover.xml
DELETED
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="1766557826816" clover="3.2.0">
|
|
3
|
-
<project timestamp="1766557826816" name="All files">
|
|
4
|
-
<metrics statements="191" coveredstatements="158" conditionals="114" coveredconditionals="84" methods="48" coveredmethods="47" elements="353" coveredelements="289" complexity="0" loc="191" ncloc="191" packages="1" files="3" classes="3"/>
|
|
5
|
-
<file name="index.ts" path="/Users/pankajpriscilla/SO_CareCardCa/pkg-jwt-read/src/index.ts">
|
|
6
|
-
<metrics statements="3" coveredstatements="3" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
|
|
7
|
-
<line num="1" count="2" type="stmt"/>
|
|
8
|
-
<line num="2" count="2" type="stmt"/>
|
|
9
|
-
<line num="3" count="2" type="stmt"/>
|
|
10
|
-
</file>
|
|
11
|
-
<file name="jwtLib.ts" path="/Users/pankajpriscilla/SO_CareCardCa/pkg-jwt-read/src/jwtLib.ts">
|
|
12
|
-
<metrics statements="182" coveredstatements="149" conditionals="110" coveredconditionals="80" methods="46" coveredmethods="45"/>
|
|
13
|
-
<line num="1" count="2" type="stmt"/>
|
|
14
|
-
<line num="2" count="2" type="stmt"/>
|
|
15
|
-
<line num="3" count="2" type="stmt"/>
|
|
16
|
-
<line num="7" count="2" type="stmt"/>
|
|
17
|
-
<line num="8" count="1" type="stmt"/>
|
|
18
|
-
<line num="11" count="2" type="stmt"/>
|
|
19
|
-
<line num="12" count="1" type="stmt"/>
|
|
20
|
-
<line num="15" count="2" type="stmt"/>
|
|
21
|
-
<line num="16" count="3" type="cond" truecount="3" falsecount="1"/>
|
|
22
|
-
<line num="17" count="3" type="stmt"/>
|
|
23
|
-
<line num="19" count="0" type="stmt"/>
|
|
24
|
-
<line num="23" count="2" type="stmt"/>
|
|
25
|
-
<line num="24" count="3" type="cond" truecount="2" falsecount="0"/>
|
|
26
|
-
<line num="27" count="2" type="stmt"/>
|
|
27
|
-
<line num="28" count="1" type="cond" truecount="3" falsecount="1"/>
|
|
28
|
-
<line num="29" count="1" type="stmt"/>
|
|
29
|
-
<line num="31" count="0" type="stmt"/>
|
|
30
|
-
<line num="35" count="2" type="stmt"/>
|
|
31
|
-
<line num="37" count="2" type="cond" truecount="1" falsecount="1"/>
|
|
32
|
-
<line num="43" count="2" type="stmt"/>
|
|
33
|
-
<line num="44" count="2" type="cond" truecount="3" falsecount="1"/>
|
|
34
|
-
<line num="46" count="2" type="stmt"/>
|
|
35
|
-
<line num="47" count="2" type="stmt"/>
|
|
36
|
-
<line num="50" count="2" type="stmt"/>
|
|
37
|
-
<line num="55" count="3" type="stmt"/>
|
|
38
|
-
<line num="57" count="3" type="stmt"/>
|
|
39
|
-
<line num="59" count="3" type="cond" truecount="3" falsecount="1"/>
|
|
40
|
-
<line num="60" count="3" type="stmt"/>
|
|
41
|
-
<line num="62" count="0" type="stmt"/>
|
|
42
|
-
<line num="63" count="0" type="stmt"/>
|
|
43
|
-
<line num="66" count="3" type="stmt"/>
|
|
44
|
-
<line num="69" count="2" type="stmt"/>
|
|
45
|
-
<line num="75" count="1" type="stmt"/>
|
|
46
|
-
<line num="77" count="1" type="stmt"/>
|
|
47
|
-
<line num="83" count="1" type="cond" truecount="3" falsecount="1"/>
|
|
48
|
-
<line num="84" count="1" type="stmt"/>
|
|
49
|
-
<line num="86" count="0" type="stmt"/>
|
|
50
|
-
<line num="87" count="0" type="stmt"/>
|
|
51
|
-
<line num="90" count="1" type="stmt"/>
|
|
52
|
-
<line num="93" count="2" type="stmt"/>
|
|
53
|
-
<line num="97" count="3" type="stmt"/>
|
|
54
|
-
<line num="98" count="3" type="stmt"/>
|
|
55
|
-
<line num="100" count="3" type="stmt"/>
|
|
56
|
-
<line num="102" count="3" type="cond" truecount="4" falsecount="0"/>
|
|
57
|
-
<line num="103" count="1" type="stmt"/>
|
|
58
|
-
<line num="105" count="2" type="stmt"/>
|
|
59
|
-
<line num="108" count="0" type="stmt"/>
|
|
60
|
-
<line num="111" count="3" type="stmt"/>
|
|
61
|
-
<line num="114" count="2" type="stmt"/>
|
|
62
|
-
<line num="119" count="1" type="stmt"/>
|
|
63
|
-
<line num="120" count="1" type="stmt"/>
|
|
64
|
-
<line num="122" count="1" type="stmt"/>
|
|
65
|
-
<line num="124" count="1" type="cond" truecount="3" falsecount="1"/>
|
|
66
|
-
<line num="125" count="1" type="stmt"/>
|
|
67
|
-
<line num="127" count="0" type="stmt"/>
|
|
68
|
-
<line num="130" count="0" type="stmt"/>
|
|
69
|
-
<line num="133" count="1" type="stmt"/>
|
|
70
|
-
<line num="136" count="2" type="stmt"/>
|
|
71
|
-
<line num="140" count="1" type="stmt"/>
|
|
72
|
-
<line num="141" count="1" type="stmt"/>
|
|
73
|
-
<line num="143" count="1" type="stmt"/>
|
|
74
|
-
<line num="145" count="1" type="cond" truecount="3" falsecount="1"/>
|
|
75
|
-
<line num="146" count="1" type="stmt"/>
|
|
76
|
-
<line num="148" count="0" type="stmt"/>
|
|
77
|
-
<line num="151" count="0" type="stmt"/>
|
|
78
|
-
<line num="154" count="1" type="stmt"/>
|
|
79
|
-
<line num="157" count="2" type="stmt"/>
|
|
80
|
-
<line num="158" count="1" type="stmt"/>
|
|
81
|
-
<line num="159" count="1" type="stmt"/>
|
|
82
|
-
<line num="160" count="1" type="stmt"/>
|
|
83
|
-
<line num="161" count="1" type="stmt"/>
|
|
84
|
-
<line num="167" count="2" type="stmt"/>
|
|
85
|
-
<line num="168" count="1" type="stmt"/>
|
|
86
|
-
<line num="169" count="1" type="stmt"/>
|
|
87
|
-
<line num="170" count="1" type="stmt"/>
|
|
88
|
-
<line num="175" count="2" type="stmt"/>
|
|
89
|
-
<line num="176" count="1" type="stmt"/>
|
|
90
|
-
<line num="177" count="1" type="stmt"/>
|
|
91
|
-
<line num="178" count="1" type="stmt"/>
|
|
92
|
-
<line num="183" count="2" type="stmt"/>
|
|
93
|
-
<line num="184" count="3" type="stmt"/>
|
|
94
|
-
<line num="185" count="3" type="stmt"/>
|
|
95
|
-
<line num="186" count="3" type="stmt"/>
|
|
96
|
-
<line num="191" count="2" type="stmt"/>
|
|
97
|
-
<line num="192" count="1" type="stmt"/>
|
|
98
|
-
<line num="193" count="1" type="stmt"/>
|
|
99
|
-
<line num="194" count="1" type="stmt"/>
|
|
100
|
-
<line num="199" count="2" type="stmt"/>
|
|
101
|
-
<line num="200" count="1" type="stmt"/>
|
|
102
|
-
<line num="201" count="1" type="stmt"/>
|
|
103
|
-
<line num="202" count="1" type="stmt"/>
|
|
104
|
-
<line num="207" count="2" type="stmt"/>
|
|
105
|
-
<line num="208" count="0" type="stmt"/>
|
|
106
|
-
<line num="214" count="2" type="stmt"/>
|
|
107
|
-
<line num="215" count="1" type="cond" truecount="1" falsecount="1"/>
|
|
108
|
-
<line num="216" count="0" type="stmt"/>
|
|
109
|
-
<line num="220" count="2" type="stmt"/>
|
|
110
|
-
<line num="225" count="5" type="cond" truecount="3" falsecount="1"/>
|
|
111
|
-
<line num="226" count="5" type="stmt"/>
|
|
112
|
-
<line num="228" count="0" type="stmt"/>
|
|
113
|
-
<line num="232" count="2" type="stmt"/>
|
|
114
|
-
<line num="233" count="4" type="cond" truecount="3" falsecount="1"/>
|
|
115
|
-
<line num="234" count="4" type="stmt"/>
|
|
116
|
-
<line num="236" count="0" type="stmt"/>
|
|
117
|
-
<line num="240" count="2" type="stmt"/>
|
|
118
|
-
<line num="244" count="1" type="cond" truecount="3" falsecount="1"/>
|
|
119
|
-
<line num="245" count="1" type="stmt"/>
|
|
120
|
-
<line num="247" count="0" type="stmt"/>
|
|
121
|
-
<line num="251" count="2" type="stmt"/>
|
|
122
|
-
<line num="256" count="5" type="cond" truecount="3" falsecount="1"/>
|
|
123
|
-
<line num="257" count="5" type="stmt"/>
|
|
124
|
-
<line num="259" count="0" type="stmt"/>
|
|
125
|
-
<line num="263" count="2" type="stmt"/>
|
|
126
|
-
<line num="267" count="7" type="cond" truecount="4" falsecount="0"/>
|
|
127
|
-
<line num="268" count="5" type="stmt"/>
|
|
128
|
-
<line num="270" count="2" type="stmt"/>
|
|
129
|
-
<line num="274" count="2" type="stmt"/>
|
|
130
|
-
<line num="279" count="4" type="stmt"/>
|
|
131
|
-
<line num="282" count="4" type="stmt"/>
|
|
132
|
-
<line num="285" count="4" type="cond" truecount="2" falsecount="2"/>
|
|
133
|
-
<line num="286" count="4" type="stmt"/>
|
|
134
|
-
<line num="288" count="0" type="stmt"/>
|
|
135
|
-
<line num="292" count="2" type="stmt"/>
|
|
136
|
-
<line num="298" count="1" type="stmt"/>
|
|
137
|
-
<line num="301" count="1" type="stmt"/>
|
|
138
|
-
<line num="304" count="1" type="cond" truecount="2" falsecount="2"/>
|
|
139
|
-
<line num="305" count="1" type="stmt"/>
|
|
140
|
-
<line num="307" count="0" type="stmt"/>
|
|
141
|
-
<line num="311" count="2" type="stmt"/>
|
|
142
|
-
<line num="313" count="6" type="stmt"/>
|
|
143
|
-
<line num="315" count="6" type="cond" truecount="2" falsecount="0"/>
|
|
144
|
-
<line num="316" count="2" type="stmt"/>
|
|
145
|
-
<line num="320" count="4" type="stmt"/>
|
|
146
|
-
<line num="323" count="4" type="cond" truecount="4" falsecount="0"/>
|
|
147
|
-
<line num="324" count="3" type="stmt"/>
|
|
148
|
-
<line num="327" count="1" type="stmt"/>
|
|
149
|
-
<line num="330" count="2" type="stmt"/>
|
|
150
|
-
<line num="332" count="1" type="stmt"/>
|
|
151
|
-
<line num="334" count="1" type="cond" truecount="1" falsecount="1"/>
|
|
152
|
-
<line num="335" count="0" type="stmt"/>
|
|
153
|
-
<line num="339" count="1" type="stmt"/>
|
|
154
|
-
<line num="342" count="1" type="cond" truecount="2" falsecount="2"/>
|
|
155
|
-
<line num="343" count="1" type="stmt"/>
|
|
156
|
-
<line num="346" count="0" type="stmt"/>
|
|
157
|
-
<line num="349" count="2" type="stmt"/>
|
|
158
|
-
<line num="351" count="1" type="stmt"/>
|
|
159
|
-
<line num="353" count="1" type="cond" truecount="1" falsecount="1"/>
|
|
160
|
-
<line num="354" count="0" type="stmt"/>
|
|
161
|
-
<line num="358" count="1" type="stmt"/>
|
|
162
|
-
<line num="361" count="1" type="cond" truecount="2" falsecount="2"/>
|
|
163
|
-
<line num="362" count="1" type="stmt"/>
|
|
164
|
-
<line num="365" count="0" type="stmt"/>
|
|
165
|
-
<line num="368" count="2" type="stmt"/>
|
|
166
|
-
<line num="372" count="4" type="stmt"/>
|
|
167
|
-
<line num="374" count="4" type="cond" truecount="3" falsecount="1"/>
|
|
168
|
-
<line num="375" count="4" type="stmt"/>
|
|
169
|
-
<line num="377" count="0" type="stmt"/>
|
|
170
|
-
<line num="378" count="0" type="stmt"/>
|
|
171
|
-
<line num="382" count="4" type="cond" truecount="3" falsecount="1"/>
|
|
172
|
-
<line num="383" count="0" type="stmt"/>
|
|
173
|
-
<line num="384" count="0" type="stmt"/>
|
|
174
|
-
<line num="387" count="4" type="cond" truecount="1" falsecount="1"/>
|
|
175
|
-
<line num="388" count="4" type="cond" truecount="1" falsecount="1"/>
|
|
176
|
-
<line num="390" count="0" type="stmt"/>
|
|
177
|
-
<line num="391" count="0" type="stmt"/>
|
|
178
|
-
<line num="395" count="2" type="stmt"/>
|
|
179
|
-
<line num="396" count="1" type="cond" truecount="3" falsecount="1"/>
|
|
180
|
-
<line num="397" count="1" type="stmt"/>
|
|
181
|
-
<line num="399" count="0" type="stmt"/>
|
|
182
|
-
<line num="402" count="0" type="stmt"/>
|
|
183
|
-
<line num="405" count="2" type="stmt"/>
|
|
184
|
-
<line num="406" count="5" type="stmt"/>
|
|
185
|
-
<line num="408" count="5" type="cond" truecount="3" falsecount="1"/>
|
|
186
|
-
<line num="409" count="5" type="stmt"/>
|
|
187
|
-
<line num="411" count="0" type="stmt"/>
|
|
188
|
-
<line num="414" count="5" type="cond" truecount="2" falsecount="0"/>
|
|
189
|
-
<line num="415" count="4" type="stmt"/>
|
|
190
|
-
<line num="418" count="1" type="stmt"/>
|
|
191
|
-
<line num="421" count="2" type="stmt"/>
|
|
192
|
-
<line num="422" count="1" type="cond" truecount="3" falsecount="1"/>
|
|
193
|
-
<line num="423" count="1" type="stmt"/>
|
|
194
|
-
<line num="425" count="0" type="stmt"/>
|
|
195
|
-
</file>
|
|
196
|
-
<file name="jwtRoles.ts" path="/Users/pankajpriscilla/SO_CareCardCa/pkg-jwt-read/src/jwtRoles.ts">
|
|
197
|
-
<metrics statements="6" coveredstatements="6" conditionals="4" coveredconditionals="4" methods="2" coveredmethods="2"/>
|
|
198
|
-
<line num="1" count="2" type="stmt"/>
|
|
199
|
-
<line num="8" count="2" type="stmt"/>
|
|
200
|
-
<line num="10" count="3" type="cond" truecount="2" falsecount="0"/>
|
|
201
|
-
<line num="13" count="2" type="stmt"/>
|
|
202
|
-
<line num="20" count="2" type="stmt"/>
|
|
203
|
-
<line num="21" count="3" type="cond" truecount="2" falsecount="0"/>
|
|
204
|
-
</file>
|
|
205
|
-
</project>
|
|
206
|
-
</coverage>
|