passport-descope 1.0.0 → 1.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/README.md +2 -2
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +44 -39
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ passport.use(new DescopeStrategy({
|
|
|
42
42
|
|
|
43
43
|
**Optional**
|
|
44
44
|
|
|
45
|
-
3. `managementKey` - If you would like to also return user information as part of the verifyCallback function, you will need to include a Descope Management Key when you initialize your `DescopeStrategy` object. You can create one in the Company Settings portal [here](https://app.descope.com/settings/company/settings).
|
|
45
|
+
3. `managementKey` - If you would like to also return user information as part of the verifyCallback function, you will need to include a Descope Management Key when you initialize your `DescopeStrategy` object. You can create one in the Company Settings portal [here](https://app.descope.com/settings/company/settings). To load the user details, pass `{ userDetails: true }` as the third (`info`) argument of the verify callback, for example `cb(null, {id: jwtDetails.token.sub}, { userDetails: true })`; the authenticated user is then the Descope user details instead of the object you passed.
|
|
46
46
|
|
|
47
47
|
---
|
|
48
48
|
|
|
@@ -50,7 +50,7 @@ If you would like to learn more about Passport JS Strategies, please visit their
|
|
|
50
50
|
|
|
51
51
|
## Code Samples
|
|
52
52
|
|
|
53
|
-
- [TODO List Sample App]()
|
|
53
|
+
- [TODO List Sample App](https://github.com/descope-sample-apps/passportjs_sample)
|
|
54
54
|
|
|
55
55
|
## Feedback
|
|
56
56
|
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";var e=require("@descope/node-sdk");module.exports=class{constructor(t){this._options=t,this.name="descope",this._descopeClient=e({projectId:t.projectId,managementKey:t.managementKey}),this._realm=t.realm||"Users",t.scope&&(this._scope=Array.isArray(t.scope)?t.scope:[t.scope])}async authenticate(t,r){const s=this,o=(e=>{var t;const r=null===(t=e.headers)||void 0===t?void 0:t.authorization;if(!r)return null;const s=r.split(" ");if(2==s.length){const e=s[0],t=s[1];if(/^Bearer$/i.test(e))return t}return null})(t)||(t=>{var r;const s=new Map,o=null===(r=t.headers)||void 0===r?void 0:r.cookie;return o?(o.split(";").forEach(e=>{let[t,...r]=e.split("=");if(t=null==t?void 0:t.trim(),!t)return;const o=r.join("=").trim();if(o)try{s.set(t,decodeURIComponent(o))}catch(e){return}}),s.get(e.SessionTokenCookieName)):null})(t);let n=null;try{n=await s._descopeClient.validateJwt(o)}catch(e){const t="No valid token provided",r=e instanceof Error?e.message:t;return s.fail(s._challenge(401,r))}s._options.verify(n,(e,t,r)=>e?s.error(e):t?(null==r?void 0:r.userDetails)?s._descopeClient.management.user.loadByUserId(n.token.sub).then(e=>e.ok&&e.data?s.success(e.data,r):s.fail(s._challenge(401,"invalid_token"))).catch(e=>s.error(e)):s.success(t,r):("string"==typeof r&&(r={message:r}),r=r||{},s.fail(s._challenge(401,"invalid_token",r.message))),t)}_challenge(e,t,r){let s='Bearer realm="'+this._realm+'"';return this._scope&&(s+=', scope="'+this._scope.join(" ")+'"'),e&&(s+=', error="'+e+'"'),t&&(s+=', error_description="'+t+'"'),r&&(s+=', error_uri="'+r+'"'),s}};
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../src/index.ts","../../src/token.ts"],"sourcesContent":["/* eslint-disable no-console */\n/* eslint-disable no-underscore-dangle */\nimport { Request, Response } from 'express';\nimport { StrategyCreatedStatic } from 'passport';\nimport { tokenFromHeader, tokenFromCookie } from './token';\nimport DescopeClient from '@descope/node-sdk';\
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../src/index.ts","../../src/token.ts"],"sourcesContent":["/* eslint-disable no-console */\n/* eslint-disable no-underscore-dangle */\nimport { Request, Response } from 'express';\nimport { StrategyCreatedStatic } from 'passport';\nimport { tokenFromHeader, tokenFromCookie } from './token';\nimport DescopeClient from '@descope/node-sdk';\n\ntype VerifyCallback = (\n payload: any,\n verifyCallback: (err?: Error | null, user?: Object, info?: any) => void,\n req: Request,\n) => void;\n\ninterface Options {\n /** Descope project id to use */\n projectId: string;\n /** Descope optional management key to retrieve extra user details */\n managementKey?: string;\n /** The callback to load the user details if stored outside of Descope */\n verify: VerifyCallback;\n /** The realm for the challenge */\n realm?: string;\n /** The scopes for the challenge */\n scope?: [string] | string;\n}\n\ntype DescopeSdk = ReturnType<typeof DescopeClient>;\ntype ValidateSessionRes = ReturnType<DescopeSdk[\"validateJwt\"]>;\ntype AuthenticationInfo = Awaited<ValidateSessionRes>;\n\n/**\n * DescopeStrategy for PassportJS verifies that the given JWT token in either Authorization Bearer or DS cookie is valid.\n * It requires the Descope project ID and a verify function is there to allow the app to manipulate user details.\n */\nclass DescopeStrategy {\n name: string = 'descope';\n _descopeClient: DescopeSdk;\n _realm: string;\n _scope: [string];\n\n constructor(private _options: Options) {\n this._descopeClient = DescopeClient({ projectId: _options.projectId, managementKey: _options.managementKey });\n this._realm = _options.realm || 'Users';\n if (_options.scope) {\n this._scope = (Array.isArray(_options.scope)) ? _options.scope : [ _options.scope ];\n }\n }\n\n async authenticate(this: StrategyCreatedStatic & DescopeStrategy, req: Request, options?: any): Promise<void> {\n const self = this;\n const token = tokenFromHeader(req) || tokenFromCookie(req);\n let authInfo: AuthenticationInfo = null;\n try {\n authInfo = await self._descopeClient.validateJwt(token);\n } catch (error) {\n const defaultMessage = 'No valid token provided';\n const message = error instanceof Error ? error.message : defaultMessage;\n return self.fail(self._challenge(401, message));\n }\n\n const verifyCallback = (err?: Error | null, user?: Object, info?: any) => {\n if (err) {\n return self.error(err);\n }\n if (!user) {\n if (typeof info == 'string') {\n info = { message: info }\n }\n info = info || {};\n return self.fail(self._challenge(401, 'invalid_token', info.message)); \n }\n if (info?.userDetails) {\n return self._descopeClient.management.user.loadByUserId(authInfo.token.sub)\n .then((res) => {\n if (!res.ok || !res.data) {\n return self.fail(self._challenge(401, 'invalid_token'));\n }\n return self.success(res.data, info);\n })\n .catch((error) => self.error(error));\n }\n return self.success(user, info);\n };\n\n self._options.verify(authInfo, verifyCallback, req);\n }\n\n /**\n * Generate a challenge response in case of failure\n * @param this the Descope strategy\n * @param code error code\n * @param desc error description\n * @param uri relevant uri for the error\n * @returns the challenge string\n */\n _challenge(this: StrategyCreatedStatic & DescopeStrategy, code?: number, desc?: string, uri?: string) {\n let challenge = 'Bearer realm=\"' + this._realm + '\"';\n if (this._scope) {\n challenge += ', scope=\"' + this._scope.join(' ') + '\"';\n }\n if (code) {\n challenge += ', error=\"' + code + '\"';\n }\n if (desc) {\n challenge += ', error_description=\"' + desc + '\"';\n }\n if (uri) {\n challenge += ', error_uri=\"' + uri + '\"';\n }\n return challenge;\n }\n}\n\nexport default DescopeStrategy;\n","/* eslint-disable no-console */\nimport { Request } from 'express';\nimport DescopeClient from '@descope/node-sdk';\n\nexport const tokenFromCookie = (request: Request) => {\n const list = new Map<string, string>();\n const cookieHeader = request.headers?.cookie;\n if (!cookieHeader) return null;\n\n cookieHeader.split(`;`).forEach((cookie: string) => {\n let [name, ...rest] = cookie.split(`=`);\n name = name?.trim();\n if (!name) return;\n const value = rest.join(`=`).trim();\n if (!value) return;\n try {\n list.set(name, decodeURIComponent(value));\n } catch {\n return;\n }\n });\n\n return list.get(DescopeClient.SessionTokenCookieName);\n};\n\nexport const tokenFromHeader = (request: Request) => {\n const authHeader = request.headers?.authorization;\n if (!authHeader) return null;\n\n const parts = authHeader.split(' ');\n if (parts.length == 2) {\n const scheme = parts[0], credentials = parts[1];\n if (/^Bearer$/i.test(scheme)) {\n return credentials;\n }\n }\n return null\n};"],"names":["constructor","_options","this","name","_descopeClient","DescopeClient","projectId","managementKey","_realm","realm","scope","_scope","Array","isArray","authenticate","req","options","self","token","request","authHeader","_a","headers","authorization","parts","split","length","scheme","credentials","test","tokenFromHeader","list","Map","cookieHeader","cookie","forEach","rest","trim","value","join","set","decodeURIComponent","get","SessionTokenCookieName","tokenFromCookie","authInfo","validateJwt","error","defaultMessage","message","Error","fail","_challenge","verify","err","user","info","userDetails","management","loadByUserId","sub","then","res","ok","data","success","catch","code","desc","uri","challenge"],"mappings":"+DAkCA,MAME,WAAAA,CAAoBC,GAAAC,KAAAD,SAAAA,EALpBC,KAAAC,KAAe,UAMbD,KAAKE,eAAiBC,EAAc,CAAEC,UAAWL,EAASK,UAAWC,cAAeN,EAASM,gBAC7FL,KAAKM,OAASP,EAASQ,OAAS,QAC5BR,EAASS,QACXR,KAAKS,OAAUC,MAAMC,QAAQZ,EAASS,OAAUT,EAASS,MAAQ,CAAET,EAASS,OAEhF,CAEA,kBAAMI,CAA4DC,EAAcC,GAC9E,MAAMC,EAAOf,KACPgB,ECzBqB,CAACC,UAC9B,MAAMC,EAA4B,QAAfC,EAAAF,EAAQG,eAAO,IAAAD,SAAAA,EAAEE,cACpC,IAAKH,EAAY,OAAO,KAExB,MAAMI,EAAQJ,EAAWK,MAAM,KAC/B,GAAoB,GAAhBD,EAAME,OAAa,CACrB,MAAMC,EAASH,EAAM,GAAII,EAAcJ,EAAM,GAC7C,GAAI,YAAYK,KAAKF,GACnB,OAAOC,CAEX,CACA,OAAO,MDcSE,CAAgBf,IC9CH,CAACI,UAC9B,MAAMY,EAAO,IAAIC,IACXC,EAA8B,QAAfZ,EAAAF,EAAQG,eAAO,IAAAD,SAAAA,EAAEa,OACtC,OAAKD,GAELA,EAAaR,MAAM,KAAKU,QAASD,IAC/B,IAAK/B,KAASiC,GAAQF,EAAOT,MAAM,KAEnC,GADAtB,EAAOA,eAAAA,EAAMkC,QACRlC,EAAM,OACX,MAAMmC,EAAQF,EAAKG,KAAK,KAAKF,OAC7B,GAAKC,EACL,IACEP,EAAKS,IAAIrC,EAAMsC,mBAAmBH,GACpC,CAAE,MAAAjB,GACA,MACF,IAGKU,EAAKW,IAAIrC,EAAcsC,yBAfJ,MD2CcC,CAAgB7B,GACtD,IAAI8B,EAA+B,KACnC,IACEA,QAAiB5B,EAAKb,eAAe0C,YAAY5B,EACnD,CAAE,MAAO6B,GACP,MAAMC,EAAiB,0BACjBC,EAAUF,aAAiBG,MAAQH,EAAME,QAAUD,EACzD,OAAO/B,EAAKkC,KAAKlC,EAAKmC,WAAW,IAAKH,GACxC,CA0BAhC,EAAKhB,SAASoD,OAAOR,EAxBE,CAACS,EAAoBC,EAAeC,IACrDF,EACKrC,EAAK8B,MAAMO,GAEfC,GAODC,aAAI,EAAJA,EAAMC,aACDxC,EAAKb,eAAesD,WAAWH,KAAKI,aAAad,EAAS3B,MAAM0C,KACpEC,KAAMC,GACAA,EAAIC,IAAOD,EAAIE,KAGb/C,EAAKgD,QAAQH,EAAIE,KAAMR,GAFrBvC,EAAKkC,KAAKlC,EAAKmC,WAAW,IAAK,mBAIzCc,MAAOnB,GAAU9B,EAAK8B,MAAMA,IAE1B9B,EAAKgD,QAAQV,EAAMC,IAhBL,iBAARA,IACTA,EAAO,CAAEP,QAASO,IAEpBA,EAAOA,GAAQ,CAAA,EACRvC,EAAKkC,KAAKlC,EAAKmC,WAAW,IAAK,gBAAiBI,EAAKP,WAejBlC,EACjD,CAUA,UAAAqC,CAA0De,EAAeC,EAAeC,GACtF,IAAIC,EAAY,iBAAmBpE,KAAKM,OAAS,IAajD,OAZIN,KAAKS,SACP2D,GAAa,YAAcpE,KAAKS,OAAO4B,KAAK,KAAO,KAEjD4B,IACFG,GAAa,YAAcH,EAAO,KAEhCC,IACFE,GAAa,wBAA0BF,EAAO,KAE5CC,IACFC,GAAa,gBAAkBD,EAAM,KAEhCC,CACT"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"@descope/node-sdk";class
|
|
1
|
+
import e from"@descope/node-sdk";class t{constructor(t){this._options=t,this.name="descope",this._descopeClient=e({projectId:t.projectId,managementKey:t.managementKey}),this._realm=t.realm||"Users",t.scope&&(this._scope=Array.isArray(t.scope)?t.scope:[t.scope])}async authenticate(t,r){const o=this,s=(e=>{var t;const r=null===(t=e.headers)||void 0===t?void 0:t.authorization;if(!r)return null;const o=r.split(" ");if(2==o.length){const e=o[0],t=o[1];if(/^Bearer$/i.test(e))return t}return null})(t)||(t=>{var r;const o=new Map,s=null===(r=t.headers)||void 0===r?void 0:r.cookie;return s?(s.split(";").forEach(e=>{let[t,...r]=e.split("=");if(t=null==t?void 0:t.trim(),!t)return;const s=r.join("=").trim();if(s)try{o.set(t,decodeURIComponent(s))}catch(e){return}}),o.get(e.SessionTokenCookieName)):null})(t);let n=null;try{n=await o._descopeClient.validateJwt(s)}catch(e){const t="No valid token provided",r=e instanceof Error?e.message:t;return o.fail(o._challenge(401,r))}o._options.verify(n,(e,t,r)=>e?o.error(e):t?(null==r?void 0:r.userDetails)?o._descopeClient.management.user.loadByUserId(n.token.sub).then(e=>e.ok&&e.data?o.success(e.data,r):o.fail(o._challenge(401,"invalid_token"))).catch(e=>o.error(e)):o.success(t,r):("string"==typeof r&&(r={message:r}),r=r||{},o.fail(o._challenge(401,"invalid_token",r.message))),t)}_challenge(e,t,r){let o='Bearer realm="'+this._realm+'"';return this._scope&&(o+=', scope="'+this._scope.join(" ")+'"'),e&&(o+=', error="'+e+'"'),t&&(o+=', error_description="'+t+'"'),r&&(o+=', error_uri="'+r+'"'),o}}export{t as default};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/index.ts","../src/token.ts"],"sourcesContent":["/* eslint-disable no-console */\n/* eslint-disable no-underscore-dangle */\nimport { Request, Response } from 'express';\nimport { StrategyCreatedStatic } from 'passport';\nimport { tokenFromHeader, tokenFromCookie } from './token';\nimport DescopeClient from '@descope/node-sdk';\
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/index.ts","../src/token.ts"],"sourcesContent":["/* eslint-disable no-console */\n/* eslint-disable no-underscore-dangle */\nimport { Request, Response } from 'express';\nimport { StrategyCreatedStatic } from 'passport';\nimport { tokenFromHeader, tokenFromCookie } from './token';\nimport DescopeClient from '@descope/node-sdk';\n\ntype VerifyCallback = (\n payload: any,\n verifyCallback: (err?: Error | null, user?: Object, info?: any) => void,\n req: Request,\n) => void;\n\ninterface Options {\n /** Descope project id to use */\n projectId: string;\n /** Descope optional management key to retrieve extra user details */\n managementKey?: string;\n /** The callback to load the user details if stored outside of Descope */\n verify: VerifyCallback;\n /** The realm for the challenge */\n realm?: string;\n /** The scopes for the challenge */\n scope?: [string] | string;\n}\n\ntype DescopeSdk = ReturnType<typeof DescopeClient>;\ntype ValidateSessionRes = ReturnType<DescopeSdk[\"validateJwt\"]>;\ntype AuthenticationInfo = Awaited<ValidateSessionRes>;\n\n/**\n * DescopeStrategy for PassportJS verifies that the given JWT token in either Authorization Bearer or DS cookie is valid.\n * It requires the Descope project ID and a verify function is there to allow the app to manipulate user details.\n */\nclass DescopeStrategy {\n name: string = 'descope';\n _descopeClient: DescopeSdk;\n _realm: string;\n _scope: [string];\n\n constructor(private _options: Options) {\n this._descopeClient = DescopeClient({ projectId: _options.projectId, managementKey: _options.managementKey });\n this._realm = _options.realm || 'Users';\n if (_options.scope) {\n this._scope = (Array.isArray(_options.scope)) ? _options.scope : [ _options.scope ];\n }\n }\n\n async authenticate(this: StrategyCreatedStatic & DescopeStrategy, req: Request, options?: any): Promise<void> {\n const self = this;\n const token = tokenFromHeader(req) || tokenFromCookie(req);\n let authInfo: AuthenticationInfo = null;\n try {\n authInfo = await self._descopeClient.validateJwt(token);\n } catch (error) {\n const defaultMessage = 'No valid token provided';\n const message = error instanceof Error ? error.message : defaultMessage;\n return self.fail(self._challenge(401, message));\n }\n\n const verifyCallback = (err?: Error | null, user?: Object, info?: any) => {\n if (err) {\n return self.error(err);\n }\n if (!user) {\n if (typeof info == 'string') {\n info = { message: info }\n }\n info = info || {};\n return self.fail(self._challenge(401, 'invalid_token', info.message)); \n }\n if (info?.userDetails) {\n return self._descopeClient.management.user.loadByUserId(authInfo.token.sub)\n .then((res) => {\n if (!res.ok || !res.data) {\n return self.fail(self._challenge(401, 'invalid_token'));\n }\n return self.success(res.data, info);\n })\n .catch((error) => self.error(error));\n }\n return self.success(user, info);\n };\n\n self._options.verify(authInfo, verifyCallback, req);\n }\n\n /**\n * Generate a challenge response in case of failure\n * @param this the Descope strategy\n * @param code error code\n * @param desc error description\n * @param uri relevant uri for the error\n * @returns the challenge string\n */\n _challenge(this: StrategyCreatedStatic & DescopeStrategy, code?: number, desc?: string, uri?: string) {\n let challenge = 'Bearer realm=\"' + this._realm + '\"';\n if (this._scope) {\n challenge += ', scope=\"' + this._scope.join(' ') + '\"';\n }\n if (code) {\n challenge += ', error=\"' + code + '\"';\n }\n if (desc) {\n challenge += ', error_description=\"' + desc + '\"';\n }\n if (uri) {\n challenge += ', error_uri=\"' + uri + '\"';\n }\n return challenge;\n }\n}\n\nexport default DescopeStrategy;\n","/* eslint-disable no-console */\nimport { Request } from 'express';\nimport DescopeClient from '@descope/node-sdk';\n\nexport const tokenFromCookie = (request: Request) => {\n const list = new Map<string, string>();\n const cookieHeader = request.headers?.cookie;\n if (!cookieHeader) return null;\n\n cookieHeader.split(`;`).forEach((cookie: string) => {\n let [name, ...rest] = cookie.split(`=`);\n name = name?.trim();\n if (!name) return;\n const value = rest.join(`=`).trim();\n if (!value) return;\n try {\n list.set(name, decodeURIComponent(value));\n } catch {\n return;\n }\n });\n\n return list.get(DescopeClient.SessionTokenCookieName);\n};\n\nexport const tokenFromHeader = (request: Request) => {\n const authHeader = request.headers?.authorization;\n if (!authHeader) return null;\n\n const parts = authHeader.split(' ');\n if (parts.length == 2) {\n const scheme = parts[0], credentials = parts[1];\n if (/^Bearer$/i.test(scheme)) {\n return credentials;\n }\n }\n return null\n};"],"names":["DescopeStrategy","constructor","_options","this","name","_descopeClient","DescopeClient","projectId","managementKey","_realm","realm","scope","_scope","Array","isArray","authenticate","req","options","self","token","request","authHeader","_a","headers","authorization","parts","split","length","scheme","credentials","test","tokenFromHeader","list","Map","cookieHeader","cookie","forEach","rest","trim","value","join","set","decodeURIComponent","get","SessionTokenCookieName","tokenFromCookie","authInfo","validateJwt","error","defaultMessage","message","Error","fail","_challenge","verify","err","user","info","userDetails","management","loadByUserId","sub","then","res","ok","data","success","catch","code","desc","uri","challenge"],"mappings":"iCAkCA,MAAMA,EAMJ,WAAAC,CAAoBC,GAAAC,KAAAD,SAAAA,EALpBC,KAAAC,KAAe,UAMbD,KAAKE,eAAiBC,EAAc,CAAEC,UAAWL,EAASK,UAAWC,cAAeN,EAASM,gBAC7FL,KAAKM,OAASP,EAASQ,OAAS,QAC5BR,EAASS,QACXR,KAAKS,OAAUC,MAAMC,QAAQZ,EAASS,OAAUT,EAASS,MAAQ,CAAET,EAASS,OAEhF,CAEA,kBAAMI,CAA4DC,EAAcC,GAC9E,MAAMC,EAAOf,KACPgB,ECzBqB,CAACC,UAC9B,MAAMC,EAA4B,QAAfC,EAAAF,EAAQG,eAAO,IAAAD,SAAAA,EAAEE,cACpC,IAAKH,EAAY,OAAO,KAExB,MAAMI,EAAQJ,EAAWK,MAAM,KAC/B,GAAoB,GAAhBD,EAAME,OAAa,CACrB,MAAMC,EAASH,EAAM,GAAII,EAAcJ,EAAM,GAC7C,GAAI,YAAYK,KAAKF,GACnB,OAAOC,CAEX,CACA,OAAO,MDcSE,CAAgBf,IC9CH,CAACI,UAC9B,MAAMY,EAAO,IAAIC,IACXC,EAA8B,QAAfZ,EAAAF,EAAQG,eAAO,IAAAD,SAAAA,EAAEa,OACtC,OAAKD,GAELA,EAAaR,MAAM,KAAKU,QAASD,IAC/B,IAAK/B,KAASiC,GAAQF,EAAOT,MAAM,KAEnC,GADAtB,EAAOA,eAAAA,EAAMkC,QACRlC,EAAM,OACX,MAAMmC,EAAQF,EAAKG,KAAK,KAAKF,OAC7B,GAAKC,EACL,IACEP,EAAKS,IAAIrC,EAAMsC,mBAAmBH,GACpC,CAAE,MAAAjB,GACA,MACF,IAGKU,EAAKW,IAAIrC,EAAcsC,yBAfJ,MD2CcC,CAAgB7B,GACtD,IAAI8B,EAA+B,KACnC,IACEA,QAAiB5B,EAAKb,eAAe0C,YAAY5B,EACnD,CAAE,MAAO6B,GACP,MAAMC,EAAiB,0BACjBC,EAAUF,aAAiBG,MAAQH,EAAME,QAAUD,EACzD,OAAO/B,EAAKkC,KAAKlC,EAAKmC,WAAW,IAAKH,GACxC,CA0BAhC,EAAKhB,SAASoD,OAAOR,EAxBE,CAACS,EAAoBC,EAAeC,IACrDF,EACKrC,EAAK8B,MAAMO,GAEfC,GAODC,aAAI,EAAJA,EAAMC,aACDxC,EAAKb,eAAesD,WAAWH,KAAKI,aAAad,EAAS3B,MAAM0C,KACpEC,KAAMC,GACAA,EAAIC,IAAOD,EAAIE,KAGb/C,EAAKgD,QAAQH,EAAIE,KAAMR,GAFrBvC,EAAKkC,KAAKlC,EAAKmC,WAAW,IAAK,mBAIzCc,MAAOnB,GAAU9B,EAAK8B,MAAMA,IAE1B9B,EAAKgD,QAAQV,EAAMC,IAhBL,iBAARA,IACTA,EAAO,CAAEP,QAASO,IAEpBA,EAAOA,GAAQ,CAAA,EACRvC,EAAKkC,KAAKlC,EAAKmC,WAAW,IAAK,gBAAiBI,EAAKP,WAejBlC,EACjD,CAUA,UAAAqC,CAA0De,EAAeC,EAAeC,GACtF,IAAIC,EAAY,iBAAmBpE,KAAKM,OAAS,IAajD,OAZIN,KAAKS,SACP2D,GAAa,YAAcpE,KAAKS,OAAO4B,KAAK,KAAO,KAEjD4B,IACFG,GAAa,YAAcH,EAAO,KAEhCC,IACFE,GAAa,wBAA0BF,EAAO,KAE5CC,IACFC,GAAa,gBAAkBD,EAAM,KAEhCC,CACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "passport-descope",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Passport strategy for Descope authentication service",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/cjs/index.cjs.js",
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
"require": "./dist/cjs/index.cjs.js",
|
|
11
|
-
"import":
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.esm.js"
|
|
14
|
+
}
|
|
12
15
|
},
|
|
13
16
|
"type": "module",
|
|
14
17
|
"files": [
|
|
@@ -16,13 +19,13 @@
|
|
|
16
19
|
],
|
|
17
20
|
"repository": {
|
|
18
21
|
"type": "git",
|
|
19
|
-
"url": "git://github.com/descope/passport-descope.git"
|
|
22
|
+
"url": "git+https://github.com/descope/passport-descope.git"
|
|
20
23
|
},
|
|
21
24
|
"engines": {
|
|
22
|
-
"node": ">=
|
|
25
|
+
"node": ">= 18.0.0"
|
|
23
26
|
},
|
|
24
27
|
"scripts": {
|
|
25
|
-
"build": "
|
|
28
|
+
"build": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\" && rollup -c --bundleConfigAsCjs",
|
|
26
29
|
"test": "jest",
|
|
27
30
|
"lint": "eslint src/**/*.ts --fix",
|
|
28
31
|
"format": "prettier . --write --ignore-path .gitignore",
|
|
@@ -40,43 +43,45 @@
|
|
|
40
43
|
"node"
|
|
41
44
|
],
|
|
42
45
|
"devDependencies": {
|
|
43
|
-
"@rollup/plugin-commonjs": "
|
|
44
|
-
"@rollup/plugin-node-resolve": "
|
|
45
|
-
"@rollup/plugin-typescript": "
|
|
46
|
-
"@types/express": "
|
|
47
|
-
"@types/jest": "
|
|
48
|
-
"@types/jsonwebtoken": "
|
|
49
|
-
"@types/passport": "
|
|
50
|
-
"@types/node": "
|
|
51
|
-
"@types/node-fetch": "
|
|
52
|
-
"@typescript-eslint/eslint-plugin": "
|
|
53
|
-
"@typescript-eslint/parser": "
|
|
54
|
-
"
|
|
55
|
-
"eslint
|
|
56
|
-
"eslint-config-airbnb-
|
|
57
|
-
"eslint-config-
|
|
58
|
-
"eslint-
|
|
59
|
-
"eslint-
|
|
60
|
-
"eslint-plugin-
|
|
61
|
-
"eslint-plugin-jest
|
|
62
|
-
"eslint-plugin-jest-
|
|
63
|
-
"eslint-plugin-
|
|
64
|
-
"eslint-plugin-
|
|
65
|
-
"eslint-plugin-
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"rollup
|
|
70
|
-
"rollup-plugin-dts": "
|
|
71
|
-
"rollup
|
|
72
|
-
"ts-jest": "
|
|
73
|
-
"ts-node": "
|
|
74
|
-
"
|
|
46
|
+
"@rollup/plugin-commonjs": "29.0.3",
|
|
47
|
+
"@rollup/plugin-node-resolve": "16.0.3",
|
|
48
|
+
"@rollup/plugin-typescript": "12.3.1",
|
|
49
|
+
"@types/express": "5.0.6",
|
|
50
|
+
"@types/jest": "30.0.0",
|
|
51
|
+
"@types/jsonwebtoken": "9.0.10",
|
|
52
|
+
"@types/passport": "1.0.17",
|
|
53
|
+
"@types/node": "22.20.5",
|
|
54
|
+
"@types/node-fetch": "2.6.13",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "8.72.2",
|
|
56
|
+
"@typescript-eslint/parser": "8.72.2",
|
|
57
|
+
"@typescript/native": "npm:typescript@7.0.2",
|
|
58
|
+
"eslint": "10.14.0",
|
|
59
|
+
"eslint-config-airbnb-base": "15.0.0",
|
|
60
|
+
"eslint-config-airbnb-typescript": "18.0.0",
|
|
61
|
+
"eslint-config-prettier": "10.1.8",
|
|
62
|
+
"eslint-import-resolver-typescript": "4.4.5",
|
|
63
|
+
"eslint-plugin-import": "2.32.0",
|
|
64
|
+
"eslint-plugin-jest": "29.17.0",
|
|
65
|
+
"eslint-plugin-jest-dom": "5.10.1",
|
|
66
|
+
"eslint-plugin-jest-formatting": "4.0.0",
|
|
67
|
+
"eslint-plugin-no-only-tests": "3.4.0",
|
|
68
|
+
"eslint-plugin-prefer-arrow": "1.2.3",
|
|
69
|
+
"eslint-plugin-prettier": "5.5.7",
|
|
70
|
+
"jest": "30.5.2",
|
|
71
|
+
"prettier": "3.9.10",
|
|
72
|
+
"rollup": "4.68.2",
|
|
73
|
+
"rollup-plugin-dts": "6.4.1",
|
|
74
|
+
"@rollup/plugin-terser": "1.0.2",
|
|
75
|
+
"ts-jest": "29.4.15",
|
|
76
|
+
"ts-node": "10.9.2",
|
|
77
|
+
"tslib": "2.9.1",
|
|
78
|
+
"typescript": "npm:@typescript/typescript6@6.0.2"
|
|
75
79
|
},
|
|
76
80
|
"dependencies": {
|
|
77
|
-
"@descope/node-sdk": "1.
|
|
81
|
+
"@descope/node-sdk": "1.10.0"
|
|
78
82
|
},
|
|
79
83
|
"peerDependencies": {
|
|
80
84
|
"tslib": ">=1.14.1"
|
|
81
|
-
}
|
|
85
|
+
},
|
|
86
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
82
87
|
}
|