alp-node-auth 5.3.1 → 6.0.3

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.
Files changed (50) hide show
  1. package/.eslintrc.json +1 -1
  2. package/CHANGELOG.md +51 -0
  3. package/README.md +0 -1
  4. package/dist/MongoUsersManager.d.ts.map +1 -1
  5. package/dist/authSocketIO.d.ts.map +1 -1
  6. package/dist/{index-node12-dev.mjs → index-node14.mjs} +33 -21
  7. package/dist/index-node14.mjs.map +1 -0
  8. package/dist/index.d.ts +1 -2
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/services/authentification/AuthenticationService.d.ts.map +1 -1
  11. package/dist/services/user/UserAccountGoogleService.d.ts.map +1 -1
  12. package/dist/services/user/UserAccountSlackService.d.ts.map +1 -1
  13. package/dist/services/user/UserAccountsService.d.ts.map +1 -1
  14. package/dist/utils/cookies.d.ts.map +1 -1
  15. package/dist/utils/createFindConnectedAndUser.d.ts +1 -1
  16. package/dist/utils/createFindConnectedAndUser.d.ts.map +1 -1
  17. package/package.json +26 -50
  18. package/rollup.config.mjs +3 -0
  19. package/src/.eslintrc.json +19 -2
  20. package/src/MongoUsersManager.ts +2 -1
  21. package/src/authApolloContext.ts +4 -4
  22. package/src/authSocketIO.ts +5 -4
  23. package/src/createAuthController.ts +2 -2
  24. package/src/index.ts +6 -3
  25. package/src/services/authentification/AuthenticationService.ts +5 -3
  26. package/src/services/user/UserAccountGoogleService.ts +8 -5
  27. package/src/services/user/UserAccountSlackService.ts +7 -5
  28. package/src/services/user/UserAccountsService.ts +10 -9
  29. package/src/utils/cookies.ts +2 -1
  30. package/src/utils/createFindConnectedAndUser.ts +11 -12
  31. package/strategies/dropbox.js +4 -6
  32. package/strategies/facebook.js +4 -6
  33. package/strategies/foursquare.js +4 -6
  34. package/strategies/github.js +4 -6
  35. package/strategies/google.js +4 -6
  36. package/strategies/slack.js +4 -6
  37. package/dist/index-node12-dev.cjs.js +0 -848
  38. package/dist/index-node12-dev.cjs.js.map +0 -1
  39. package/dist/index-node12-dev.mjs.map +0 -1
  40. package/dist/index-node12.cjs.js +0 -848
  41. package/dist/index-node12.cjs.js.map +0 -1
  42. package/dist/index-node12.mjs +0 -832
  43. package/dist/index-node12.mjs.map +0 -1
  44. package/index.js +0 -6
  45. package/strategies/dropbox.mjs +0 -18
  46. package/strategies/facebook.mjs +0 -18
  47. package/strategies/foursquare.mjs +0 -18
  48. package/strategies/github.mjs +0 -18
  49. package/strategies/google.mjs +0 -18
  50. package/strategies/slack.mjs +0 -18
package/.eslintrc.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "root": true,
3
- "extends": ["@pob/eslint-config/root", "@pob/eslint-config-node"],
3
+ "extends": ["@pob/eslint-config/root-module"],
4
4
  "ignorePatterns": ["*.d.ts", "/dist"],
5
5
  "rules": {
6
6
  "prefer-destructuring": "off",
package/CHANGELOG.md CHANGED
@@ -3,6 +3,57 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [6.0.3](https://github.com/christophehurpeau/alp/compare/alp-node-auth@6.0.2...alp-node-auth@6.0.3) (2022-01-15)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update peer dependencies ([74892bc](https://github.com/christophehurpeau/alp/commit/74892bc8dd99ca862ba427914eb893b083e9b9da))
12
+
13
+
14
+
15
+
16
+
17
+ ## [6.0.2](https://github.com/christophehurpeau/alp/compare/alp-node-auth@6.0.1...alp-node-auth@6.0.2) (2022-01-02)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * extra entries ([fbfb15f](https://github.com/christophehurpeau/alp/commit/fbfb15fd4cfc474ccb803105fb8ece71414a6f5d))
23
+
24
+
25
+
26
+
27
+
28
+ ## [6.0.1](https://github.com/christophehurpeau/alp/compare/alp-node-auth@6.0.0...alp-node-auth@6.0.1) (2022-01-02)
29
+
30
+ **Note:** Version bump only for package alp-node-auth
31
+
32
+
33
+
34
+
35
+
36
+ # [6.0.0](https://github.com/christophehurpeau/alp/compare/alp-node-auth@5.3.1...alp-node-auth@6.0.0) (2022-01-02)
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * update nightingale and fix tests ([3691716](https://github.com/christophehurpeau/alp/commit/36917162d0ee3dccc07384caf018b7760d98b744))
42
+
43
+
44
+ ### Features
45
+
46
+ * use ESM and drop node 12 ([f45054e](https://github.com/christophehurpeau/alp/commit/f45054e931eea88451d183722797eba057511236))
47
+
48
+
49
+ ### BREAKING CHANGES
50
+
51
+ * requires node 14 and ESM
52
+
53
+
54
+
55
+
56
+
6
57
  ## [5.3.1](https://github.com/christophehurpeau/alp/compare/alp-node-auth@5.3.0...alp-node-auth@5.3.1) (2021-04-10)
7
58
 
8
59
 
package/README.md CHANGED
@@ -46,7 +46,6 @@ export default new UsersManager(new MongoStore('users'));
46
46
 
47
47
  ```js
48
48
  import Alp from 'alp-node';
49
- import 'alp-node/fetch';
50
49
  import authInit from 'alp-node-auth';
51
50
  import googleStrategy from 'alp-node-auth/strategies/google';
52
51
  import * as loginModuleDescriptor from './modules/auth/login';
@@ -1 +1 @@
1
- {"version":3,"file":"MongoUsersManager.d.ts","sourceRoot":"","sources":["../src/MongoUsersManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAU,MAAM,YAAY,CAAC;AACtE,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE/D,MAAM,CAAC,OAAO,OAAO,iBAAiB,CACpC,CAAC,SAAS,IAAI,GAAG,IAAI,EACrB,UAAU,SAAS,aAAa,GAAG,aAAa;IAEhD,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;gBAET,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;IAIhC,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAIxD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OAAO,CAAC,GAAG,CAAC;IAIjC,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,UAAU;IAI7B,wBAAwB,CAAC,EACvB,SAAS,EACT,MAAM,EACN,QAAQ,GACT,EAAE;QACD,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;QAC3B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAqB1B,aAAa,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAapD,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC,GAAG,aAAa;CAmBnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"authSocketIO.d.ts","sourceRoot":"","sources":["../src/authSocketIO.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,iBAAiB,MAAM,qBAAqB,CAAC;AAMzD,eAAO,MAAM,YAAY,+BAClB,eAAe,8EAEhB,GAAG,iDAEN,IAgCF,CAAC"}
1
+ {"version":3,"file":"authSocketIO.d.ts","sourceRoot":"","sources":["../src/authSocketIO.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,iBAAiB,MAAM,qBAAqB,CAAC;AAMzD,eAAO,MAAM,YAAY,+BAClB,eAAe,8EAGhB,GAAG,iDAEN,IAgCF,CAAC"}
@@ -1,10 +1,11 @@
1
1
  import { promisify } from 'util';
2
2
  import jsonwebtoken from 'jsonwebtoken';
3
- import Logger from 'nightingale-logger';
3
+ import { Logger } from 'nightingale-logger';
4
4
  import 'alp-router';
5
5
  import { EventEmitter } from 'events';
6
6
  import { randomBytes } from 'crypto';
7
7
  import Cookies from 'cookies';
8
+ import { fetch } from 'alp-node';
8
9
 
9
10
  function createAuthController({
10
11
  usersManager,
@@ -76,7 +77,7 @@ async function randomHex(size) {
76
77
  return buffer.toString('hex');
77
78
  }
78
79
 
79
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
80
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
80
81
  const logger$4 = new Logger('alp:auth:authentication');
81
82
  class AuthenticationService extends EventEmitter {
82
83
  constructor(config, strategies, userAccountsService) {
@@ -299,6 +300,7 @@ class AuthenticationService extends EventEmitter {
299
300
 
300
301
  }
301
302
 
303
+ /* eslint-disable @typescript-eslint/no-shadow */
302
304
  const logger$3 = new Logger('alp:auth:userAccounts');
303
305
  const STATUSES = {
304
306
  VALIDATED: 'validated',
@@ -314,7 +316,7 @@ class UserAccountsService extends EventEmitter {
314
316
  getScope(strategy, scopeKey, user, accountId) {
315
317
  logger$3.debug('getScope', {
316
318
  strategy,
317
- userId: user === null || user === void 0 ? void 0 : user._id
319
+ userId: user?._id
318
320
  });
319
321
  const service = this.strategyToService[strategy];
320
322
 
@@ -439,7 +441,8 @@ class UserAccountsService extends EventEmitter {
439
441
  userEmails.push(email);
440
442
  }
441
443
  });
442
- user.emailDomains = [...user.emails.reduce((domains, email) => domains.add(email.split('@', 2)[1]), new Set())];
444
+ user.emailDomains = [// eslint-disable-next-line unicorn/no-array-reduce
445
+ ...user.emails.reduce((domains, email) => domains.add(email.split('@', 2)[1]), new Set())];
443
446
  const keyPath = this.usersManager.store.keyPath;
444
447
 
445
448
  if (user[keyPath]) {
@@ -460,6 +463,7 @@ class UserAccountsService extends EventEmitter {
460
463
 
461
464
  const COOKIE_NAME = 'connectedUser';
462
465
  const getTokenFromRequest = (req, options) => {
466
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
463
467
  const cookies = new Cookies(req, null, { ...options,
464
468
  secure: true
465
469
  });
@@ -473,7 +477,7 @@ const createDecodeJWT = secretKey => async (token, jwtAudience) => {
473
477
  algorithms: ['HS512'],
474
478
  audience: jwtAudience
475
479
  });
476
- return result === null || result === void 0 ? void 0 : result.connected;
480
+ return result?.connected;
477
481
  };
478
482
 
479
483
  const createFindConnectedAndUser = (secretKey, usersManager, logger) => {
@@ -535,7 +539,8 @@ class MongoUsersManager {
535
539
  }
536
540
  }]
537
541
  };
538
- }
542
+ } // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
543
+
539
544
 
540
545
  return this.store.findOne(query);
541
546
  }
@@ -576,15 +581,16 @@ class MongoUsersManager {
576
581
 
577
582
  }
578
583
 
579
- /* global fetch */
584
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
580
585
  class UserAccountGoogleService {
581
586
  constructor(scopeKeyToScope) {
582
- this.providerKey = 'google';
583
587
  this.scopeKeyToScope = { ...scopeKeyToScope,
584
588
  login: 'openid profile email'
585
589
  };
586
590
  }
587
591
 
592
+ providerKey = 'google';
593
+
588
594
  getProfile(tokens) {
589
595
  return fetch(`https://www.googleapis.com/oauth2/v1/userinfo?access_token=${tokens.accessToken}`).then(response => response.json());
590
596
  }
@@ -623,21 +629,22 @@ class UserAccountGoogleService {
623
629
  }
624
630
 
625
631
  getScope(oldScope, newScope) {
626
- return !oldScope ? newScope.split(' ') : oldScope.concat(newScope.split(' ')).filter((item, i, ar) => ar.indexOf(item) === i);
632
+ return !oldScope ? newScope.split(' ') : [...oldScope, ...newScope.split(' ')].filter((item, i, ar) => ar.indexOf(item) === i);
627
633
  }
628
634
 
629
635
  }
630
636
 
631
- /* global fetch */
637
+ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
632
638
  // https://api.slack.com/methods/users.identity
633
639
  class UserAccountSlackService {
634
640
  constructor(scopeKeyToScope) {
635
- this.providerKey = 'google';
636
641
  this.scopeKeyToScope = { ...scopeKeyToScope,
637
642
  login: 'identity.basic identity.email identity.avatar'
638
643
  };
639
644
  }
640
645
 
646
+ providerKey = 'google';
647
+
641
648
  getProfile(tokens) {
642
649
  return fetch(`https://slack.com/api/users.identity?token=${tokens.accessToken}`).then(response => response.json());
643
650
  }
@@ -671,7 +678,7 @@ class UserAccountSlackService {
671
678
  }
672
679
 
673
680
  getScope(oldScope, newScope) {
674
- return !oldScope ? newScope.split(' ') : oldScope.concat(newScope.split(' ')).filter((item, i, ar) => ar.indexOf(item) === i);
681
+ return !oldScope ? newScope.split(' ') : [...oldScope, ...newScope.split(' ')].filter((item, i, ar) => ar.indexOf(item) === i);
675
682
  }
676
683
 
677
684
  }
@@ -682,10 +689,12 @@ const authSocketIO = (app, usersManager, io) => {
682
689
  const users = new Map();
683
690
  io.users = users;
684
691
  io.use(async (socket, next) => {
685
- const handshakeData = socket.request;
692
+ const handshakeData = socket.request; // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
693
+
686
694
  const token = getTokenFromRequest(handshakeData);
687
695
  if (!token) return next();
688
- const [connected, user] = await findConnectedAndUser(handshakeData.headers['user-agent'], token);
696
+ const [connected, user] = await findConnectedAndUser( // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
697
+ handshakeData.headers['user-agent'], token);
689
698
  if (!connected || !user) return next();
690
699
  socket.user = user;
691
700
  users.set(socket.client.id, user);
@@ -712,18 +721,20 @@ const createAuthApolloContext = (config, usersManager) => {
712
721
  req,
713
722
  connection
714
723
  }) => {
715
- if (connection !== null && connection !== void 0 && connection.user) {
724
+ if (connection?.user) {
716
725
  return {
717
726
  user: connection.user
718
727
  };
719
728
  }
720
729
 
721
- if (!req) return null;
730
+ if (!req) return null; // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
731
+
722
732
  const token = getTokenFromReq(req);
723
733
  if (!token) return {
724
734
  user: undefined
725
735
  };
726
- const [, user] = await findConnectedAndUser(req.headers['user-agent'], token);
736
+ const [, user] = await findConnectedAndUser( // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
737
+ req.headers['user-agent'], token);
727
738
  return {
728
739
  user
729
740
  };
@@ -741,6 +752,7 @@ function init({
741
752
  authHooks,
742
753
  jwtAudience
743
754
  }) {
755
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
744
756
  return app => {
745
757
  const userAccountsService = new UserAccountsService(usersManager, strategyToService);
746
758
  const authenticationService = new AuthenticationService(app.config, strategies, userAccountsService);
@@ -770,7 +782,8 @@ function init({
770
782
  algorithm: 'HS512',
771
783
  audience: jwtAudience || this.request.headers['user-agent'],
772
784
  expiresIn: '30 days'
773
- });
785
+ }); // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
786
+
774
787
  this.cookies.set(COOKIE_NAME, token, {
775
788
  httpOnly: true,
776
789
  secure: this.config.get('allowHttps')
@@ -827,6 +840,5 @@ function init({
827
840
  };
828
841
  }
829
842
 
830
- export default init;
831
- export { AuthenticationService, MongoUsersManager, STATUSES, UserAccountGoogleService, UserAccountSlackService, authSocketIO, createAuthApolloContext };
832
- //# sourceMappingURL=index-node12-dev.mjs.map
843
+ export { AuthenticationService, MongoUsersManager, STATUSES, UserAccountGoogleService, UserAccountSlackService, authSocketIO, createAuthApolloContext, init as default };
844
+ //# sourceMappingURL=index-node14.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-node14.mjs","sources":["../src/createAuthController.ts","../src/createRoutes.ts","../src/utils/generators.ts","../src/services/authentification/AuthenticationService.ts","../src/services/user/UserAccountsService.ts","../src/utils/cookies.ts","../src/utils/createFindConnectedAndUser.ts","../src/MongoUsersManager.ts","../src/services/user/UserAccountGoogleService.ts","../src/services/user/UserAccountSlackService.ts","../src/authSocketIO.ts","../src/authApolloContext.ts","../src/index.ts"],"sourcesContent":["import type { Context } from 'alp-node';\nimport 'alp-router';\nimport type { User, UserSanitized } from '../types.d';\nimport type MongoUsersManager from './MongoUsersManager';\nimport type {\n AuthenticationService,\n AccessResponseHooks,\n} from './services/authentification/AuthenticationService';\nimport type {\n AllowedStrategyKeys,\n AllowedMapParamsStrategy,\n} from './services/authentification/types';\n\nexport interface CreateAuthControllerParams<\n StrategyKeys extends AllowedStrategyKeys,\n U extends User = User,\n USanitized extends UserSanitized = UserSanitized,\n> {\n authenticationService: AuthenticationService<StrategyKeys, U, UserSanitized>;\n homeRouterKey?: string;\n usersManager: MongoUsersManager<U, USanitized>;\n defaultStrategy?: StrategyKeys;\n authHooks?: AuthHooks<StrategyKeys>;\n}\n\nexport interface AuthController {\n login: (ctx: Context) => Promise<void>;\n addScope: (ctx: Context) => Promise<void>;\n loginResponse: (ctx: Context) => Promise<void>;\n logout: (ctx: Context) => Promise<void>;\n}\n\ntype OptionalRecord<K extends keyof any, T> = { [P in K]?: T };\n\nexport interface AuthHooks<StrategyKeys extends AllowedStrategyKeys>\n extends AccessResponseHooks<StrategyKeys> {\n paramsForLogin?: <StrategyKey extends StrategyKeys>(\n strategy: StrategyKey,\n ctx: Context,\n ) => // eslint-disable-next-line @typescript-eslint/no-invalid-void-type\n | void\n | Promise<void>\n | OptionalRecord<AllowedMapParamsStrategy[StrategyKey], any>\n | Promise<OptionalRecord<AllowedMapParamsStrategy[StrategyKey], any>>;\n}\n\nexport function createAuthController<\n StrategyKeys extends AllowedStrategyKeys,\n U extends User = User,\n USanitized extends UserSanitized = UserSanitized,\n>({\n usersManager,\n authenticationService,\n homeRouterKey = '/',\n defaultStrategy,\n authHooks = {},\n}: CreateAuthControllerParams<StrategyKeys, U, USanitized>): AuthController {\n return {\n async login(ctx: Context): Promise<void> {\n const strategy: StrategyKeys = (ctx.namedParam('strategy') ||\n defaultStrategy) as StrategyKeys;\n if (!strategy) throw new Error('Strategy missing');\n const params =\n (authHooks.paramsForLogin &&\n (await authHooks.paramsForLogin(strategy, ctx))) ||\n {};\n await authenticationService.redirectAuthUrl(ctx, strategy, {}, params);\n },\n\n async addScope(ctx: Context): Promise<void> {\n if (ctx.state.connected) {\n await ctx.redirectTo(homeRouterKey);\n return;\n }\n\n const strategy: StrategyKeys = (ctx.namedParam('strategy') ||\n defaultStrategy) as StrategyKeys;\n if (!strategy) throw new Error('Strategy missing');\n const scopeKey = ctx.namedParam('scopeKey');\n if (!scopeKey) throw new Error('Scope missing');\n await authenticationService.redirectAuthUrl(ctx, strategy, { scopeKey });\n },\n\n async loginResponse(ctx: Context): Promise<void> {\n if (ctx.state.connected) {\n await ctx.redirectTo(homeRouterKey);\n return;\n }\n\n const strategy: StrategyKeys = ctx.namedParam('strategy') as StrategyKeys;\n ctx.assert(strategy);\n\n const connectedUser = await authenticationService.accessResponse(\n ctx,\n strategy,\n ctx.state.connected as boolean | undefined,\n {\n afterLoginSuccess: authHooks.afterLoginSuccess,\n afterScopeUpdate: authHooks.afterScopeUpdate,\n },\n );\n const keyPath = usersManager.store.keyPath;\n await ctx.setConnected(connectedUser[keyPath], connectedUser);\n await ctx.redirectTo(homeRouterKey);\n },\n\n async logout(ctx: Context): Promise<void> {\n ctx.logout();\n await ctx.redirectTo(homeRouterKey);\n },\n };\n}\n","import type { AuthController } from './createAuthController';\n\nexport interface AuthRoutes {\n login: [string, (segment: any) => void];\n addScope: [string, AuthController['addScope']];\n logout: [string, AuthController['logout']];\n}\n\nexport const createRoutes = (controller: AuthController): AuthRoutes => ({\n login: [\n '/login/:strategy?',\n (segment: any) => {\n segment.add('/response', controller.loginResponse, 'loginResponse');\n segment.defaultRoute(controller.login, 'login');\n },\n ],\n addScope: ['/auth/add-scope/:strategy/:scopeKey', controller.addScope],\n logout: ['/logout', controller.logout],\n});\n","import { randomBytes } from 'crypto';\nimport { promisify } from 'util';\n\nconst randomBytesPromisified = promisify(randomBytes);\n\nexport async function randomBase64(size: number): Promise<string> {\n const buffer = await randomBytesPromisified(size);\n return buffer.toString('base64');\n}\n\nexport async function randomHex(size: number): Promise<string> {\n const buffer = await randomBytesPromisified(size);\n return buffer.toString('hex');\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-argument */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable camelcase, max-lines */\nimport { EventEmitter } from 'events';\nimport 'alp-router';\nimport type { Context, NodeConfig } from 'alp-types';\nimport { Logger } from 'nightingale-logger';\nimport type { OAuthClient } from 'simple-oauth2';\nimport type { AccountId, User, Account, UserSanitized } from '../../../types.d';\nimport { randomHex } from '../../utils/generators';\nimport type UserAccountsService from '../user/UserAccountsService';\nimport type { AllowedStrategyKeys, Tokens } from './types';\n\nconst logger = new Logger('alp:auth:authentication');\n\nexport interface GenerateAuthUrlOptions {\n accessType?: string;\n grantType?: string;\n includeGrantedScopes?: boolean;\n loginHint?: string;\n prompt?: string;\n redirectUri?: string;\n scope?: string;\n state?: string;\n}\n\nexport interface GetTokensOptions {\n code: string;\n redirectUri: string;\n}\n\nexport interface Strategy {\n type: string;\n}\n\nexport interface Oauth2Strategy<Params extends string> extends Strategy {\n oauth2: OAuthClient<Params>;\n}\n\nexport type Strategies<StrategyKeys extends AllowedStrategyKeys> = Record<\n StrategyKeys,\n Oauth2Strategy<any>\n>;\n\nexport interface AccessResponseHooks<StrategyKeys, U extends User = User> {\n afterLoginSuccess?: <StrategyKey extends StrategyKeys>(\n strategy: StrategyKey,\n connectedUser: U,\n ) => void | Promise<void>;\n\n afterScopeUpdate?: <StrategyKey extends StrategyKeys>(\n strategy: StrategyKey,\n scopeKey: string,\n account: Account,\n user: U,\n ) => void | Promise<void>;\n}\n\nexport class AuthenticationService<\n StrategyKeys extends AllowedStrategyKeys,\n U extends User = User,\n USanitized extends UserSanitized = UserSanitized,\n> extends EventEmitter {\n config: NodeConfig;\n\n strategies: Strategies<StrategyKeys>;\n\n userAccountsService: UserAccountsService<StrategyKeys, U, USanitized>;\n\n constructor(\n config: NodeConfig,\n strategies: Strategies<StrategyKeys>,\n userAccountsService: UserAccountsService<StrategyKeys, U, USanitized>,\n ) {\n super();\n this.config = config;\n this.strategies = strategies;\n this.userAccountsService = userAccountsService;\n }\n\n generateAuthUrl<T extends StrategyKeys>(strategy: T, params: any): string {\n logger.debug('generateAuthUrl', { strategy, params });\n const strategyInstance = this.strategies[strategy];\n switch (strategyInstance.type) {\n case 'oauth2':\n return strategyInstance.oauth2.authorizationCode.authorizeURL(params);\n default:\n throw new Error('Invalid strategy');\n }\n }\n\n async getTokens(\n strategy: StrategyKeys,\n options: GetTokensOptions,\n ): Promise<Tokens> {\n logger.debug('getTokens', { strategy, options });\n const strategyInstance = this.strategies[strategy];\n switch (strategyInstance.type) {\n case 'oauth2': {\n const result = await strategyInstance.oauth2.authorizationCode.getToken(\n {\n code: options.code,\n redirect_uri: options.redirectUri,\n },\n );\n if (!result) return result;\n return {\n accessToken: result.access_token,\n refreshToken: result.refresh_token,\n tokenType: result.token_type,\n expiresIn: result.expires_in,\n expireDate: (() => {\n const d = new Date();\n d.setTime(d.getTime() + result.expires_in * 1000);\n return d;\n })(),\n idToken: result.id_token,\n };\n // return strategyInstance.accessToken.create(result);\n }\n\n default:\n throw new Error('Invalid stategy');\n }\n }\n\n async refreshToken(\n strategy: StrategyKeys,\n tokensParam: { refreshToken: string },\n ): Promise<Tokens> {\n logger.debug('refreshToken', { strategy });\n if (!tokensParam.refreshToken) {\n throw new Error('Missing refresh token');\n }\n const strategyInstance = this.strategies[strategy];\n switch (strategyInstance.type) {\n case 'oauth2': {\n const token = strategyInstance.oauth2.accessToken.create({\n refresh_token: tokensParam.refreshToken,\n });\n const result = await token.refresh();\n const tokens = result.token;\n return {\n accessToken: tokens.access_token,\n tokenType: tokens.token_type,\n expiresIn: tokens.expires_in,\n expireDate: (() => {\n const d = new Date();\n d.setTime(d.getTime() + tokens.expires_in * 1000);\n return d;\n })(),\n idToken: tokens.id_token,\n };\n }\n\n default:\n throw new Error('Invalid stategy');\n }\n }\n\n redirectUri(ctx: Context, strategy: string): string {\n const host = `http${this.config.get('allowHttps') ? 's' : ''}://${\n ctx.request.host\n }`;\n return `${host}${ctx.urlGenerator('loginResponse', { strategy })}`;\n }\n\n async redirectAuthUrl(\n ctx: Context,\n strategy: StrategyKeys,\n {\n refreshToken,\n scopeKey,\n user,\n accountId,\n }: {\n refreshToken?: string | undefined;\n scopeKey?: string | undefined;\n user?: U;\n accountId?: AccountId;\n },\n params?: any,\n ): Promise<void> {\n logger.debug('redirectAuthUrl', { strategy, scopeKey, refreshToken });\n const state = await randomHex(8);\n const isLoginAccess = !scopeKey || scopeKey === 'login';\n const scope = this.userAccountsService.getScope(\n strategy,\n scopeKey || 'login',\n user,\n accountId,\n );\n\n if (!scope) {\n throw new Error('Invalid empty scope');\n }\n\n ctx.cookies.set(\n `auth_${strategy}_${state}`,\n JSON.stringify({\n scopeKey,\n scope,\n isLoginAccess,\n }),\n {\n maxAge: 10 * 60 * 1000,\n httpOnly: true,\n secure: this.config.get('allowHttps'),\n },\n );\n const redirectUri = this.generateAuthUrl(strategy, {\n redirect_uri: this.redirectUri(ctx, strategy),\n scope,\n state,\n access_type: refreshToken ? 'offline' : 'online',\n ...params,\n });\n\n return ctx.redirect(redirectUri);\n }\n\n async accessResponse<StrategyKey extends StrategyKeys>(\n ctx: any,\n strategy: StrategyKey,\n isConnected: undefined | boolean,\n hooks: AccessResponseHooks<StrategyKeys, U>,\n ): Promise<U> {\n if (ctx.query.error) {\n const error: any = new Error(ctx.query.error);\n error.status = 403;\n error.expose = true;\n throw error;\n }\n\n const code = ctx.query.code;\n const state = ctx.query.state;\n const cookieName = `auth_${strategy}_${state as string}`;\n let cookie = ctx.cookies.get(cookieName);\n ctx.cookies.set(cookieName, '', { expires: new Date(1) });\n if (!cookie) {\n throw new Error('No cookie for this state');\n }\n\n cookie = JSON.parse(cookie);\n if (!cookie || !cookie.scope) {\n throw new Error('Unexpected cookie value');\n }\n\n if (!cookie.isLoginAccess) {\n if (!isConnected) {\n throw new Error('You are not connected');\n }\n }\n\n const tokens: Tokens = await this.getTokens(strategy, {\n code,\n redirectUri: this.redirectUri(ctx, strategy),\n });\n\n if (cookie.isLoginAccess) {\n const user = await this.userAccountsService.findOrCreateFromStrategy(\n strategy,\n tokens,\n cookie.scope,\n cookie.scopeKey,\n );\n\n if (hooks.afterLoginSuccess) {\n await hooks.afterLoginSuccess(strategy, user);\n }\n\n return user;\n }\n\n const connectedUser = ctx.state.user;\n const { account, user } = await this.userAccountsService.update(\n connectedUser,\n strategy,\n tokens,\n cookie.scope,\n cookie.scopeKey,\n );\n\n if (hooks.afterScopeUpdate) {\n await hooks.afterScopeUpdate(strategy, cookie.scopeKey, account, user);\n }\n\n return connectedUser;\n }\n\n refreshAccountTokens(user: U, account: Account): Promise<boolean> {\n if (\n account.tokenExpireDate &&\n account.tokenExpireDate.getTime() > Date.now()\n ) {\n return Promise.resolve(false);\n }\n return this.refreshToken(account.provider as StrategyKeys, {\n // accessToken: account.accessToken,\n refreshToken: account.refreshToken!,\n }).then((tokens: Tokens) => {\n if (!tokens) {\n // serviceGoogle.updateFields({ accessToken:null, refreshToken:null, status: .OUTDATED });\n return false;\n }\n account.accessToken = tokens.accessToken;\n account.tokenExpireDate = tokens.expireDate;\n return this.userAccountsService\n .updateAccount(user, account)\n .then(() => true);\n });\n }\n}\n","/* eslint-disable @typescript-eslint/no-shadow */\nimport { EventEmitter } from 'events';\nimport { Logger } from 'nightingale-logger';\nimport type { AccountId, User, Account, UserSanitized } from '../../../types.d';\nimport type MongoUsersManager from '../../MongoUsersManager';\nimport type { AllowedStrategyKeys } from '../authentification/types';\nimport type { AccountService, TokensObject } from './types';\n\nconst logger = new Logger('alp:auth:userAccounts');\n\nexport const STATUSES = {\n VALIDATED: 'validated',\n DELETED: 'deleted',\n};\n\nexport default class UserAccountsService<\n StrategyKeys extends AllowedStrategyKeys,\n U extends User = User,\n USanitized extends UserSanitized = UserSanitized,\n> extends EventEmitter {\n private readonly strategyToService: Record<StrategyKeys, AccountService<any>>;\n\n usersManager: MongoUsersManager<U, USanitized>;\n\n constructor(\n usersManager: MongoUsersManager<U, USanitized>,\n strategyToService: Record<StrategyKeys, AccountService<any>>,\n ) {\n super();\n this.usersManager = usersManager;\n this.strategyToService = strategyToService;\n }\n\n getScope(\n strategy: StrategyKeys,\n scopeKey: string,\n user?: U,\n accountId?: AccountId,\n ): string {\n logger.debug('getScope', { strategy, userId: user?._id });\n const service = this.strategyToService[strategy];\n if (!service) {\n throw new Error('Strategy not supported');\n }\n\n const newScope = service.scopeKeyToScope[scopeKey];\n if (!user || !accountId) {\n return newScope;\n }\n const account = user.accounts.find(\n (account) =>\n account.provider === strategy && account.accountId === accountId,\n );\n\n if (!account) {\n throw new Error('Could not found associated account');\n }\n return service.getScope(account.scope, newScope).join(' ');\n }\n\n async update(\n user: U,\n strategy: StrategyKeys,\n tokens: TokensObject,\n scope: string,\n subservice: string,\n ): Promise<{ user: U; account: U['accounts'][number] }> {\n const service = this.strategyToService[strategy];\n const profile = await service.getProfile(tokens);\n const accountId = service.getId(profile);\n const account = user.accounts.find(\n (account) =>\n account.provider === strategy && account.accountId === accountId,\n );\n if (!account) {\n // TODO check if already exists in other user => merge\n // TODO else add a new account in this user\n throw new Error('Could not found associated account');\n }\n account.status = 'valid';\n account.accessToken = tokens.accessToken;\n if (tokens.refreshToken) {\n account.refreshToken = tokens.refreshToken;\n }\n if (tokens.expireDate) {\n account.tokenExpireDate = tokens.expireDate;\n }\n account.scope = service.getScope(account.scope, scope);\n account.subservices = account.subservices || [];\n if (subservice && !account.subservices.includes(subservice)) {\n account.subservices.push(subservice);\n }\n\n await this.usersManager.replaceOne(user);\n return { user, account };\n }\n\n async findOrCreateFromStrategy(\n strategy: StrategyKeys,\n tokens: TokensObject,\n scope: string,\n subservice: string,\n ): Promise<U> {\n const service = this.strategyToService[strategy];\n if (!service) throw new Error('Strategy not supported');\n\n const profile = await service.getProfile(tokens);\n const accountId = service.getId(profile);\n if (!accountId) throw new Error('Invalid profile: no id found');\n\n const emails = service.getEmails(profile);\n\n let user: Partial<U> | undefined =\n await this.usersManager.findOneByAccountOrEmails({\n provider: service.providerKey,\n accountId,\n emails,\n });\n\n logger.info(!user ? 'create user' : 'existing user', { emails, user });\n\n if (!user) {\n user = {};\n }\n\n Object.assign(user, {\n displayName: service.getDisplayName(profile),\n fullName: service.getFullName(profile),\n status: STATUSES.VALIDATED,\n });\n\n if (!user.accounts) user.accounts = [];\n\n let account: Partial<Account> | undefined = user.accounts.find(\n (account: Account) =>\n account.provider === strategy && account.accountId === accountId,\n );\n\n if (!account) {\n account = { provider: strategy, accountId };\n // @ts-expect-error well...\n user.accounts.push(account);\n }\n\n account.name = service.getAccountName(profile);\n account.status = 'valid';\n account.profile = profile;\n account.accessToken = tokens.accessToken;\n if (tokens.refreshToken) {\n account.refreshToken = tokens.refreshToken;\n }\n if (tokens.expireDate) {\n account.tokenExpireDate = tokens.expireDate;\n }\n account.scope = service.getScope(account.scope, scope);\n\n if (!account.subservices) account.subservices = [];\n if (subservice && !account.subservices.includes(subservice)) {\n account.subservices.push(subservice);\n }\n\n if (!user.emails) user.emails = [];\n const userEmails = user.emails;\n emails.forEach((email: string) => {\n if (!userEmails.includes(email)) {\n userEmails.push(email);\n }\n });\n\n user.emailDomains = [\n // eslint-disable-next-line unicorn/no-array-reduce\n ...user.emails.reduce(\n (domains: Set<string>, email: string) =>\n domains.add(email.split('@', 2)[1]),\n new Set<string>(),\n ),\n ];\n\n const keyPath = this.usersManager.store.keyPath;\n\n if (user[keyPath]) {\n await this.usersManager.replaceOne(user as U);\n } else {\n await this.usersManager.insertOne(user as U);\n }\n\n return user as U;\n }\n\n async updateAccount(user: U, account: Account): Promise<U> {\n await this.usersManager.updateAccount(user, account);\n return user;\n }\n}\n","import type { IncomingMessage } from 'http';\nimport type { Option } from 'cookies';\nimport Cookies from 'cookies';\n\nexport const COOKIE_NAME = 'connectedUser';\n\nexport const getTokenFromRequest = (\n req: IncomingMessage,\n options?: Pick<Option, Exclude<keyof Option, 'secure'>>,\n): string | undefined => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n const cookies = new Cookies(req, null as unknown as any, {\n ...options,\n secure: true,\n });\n\n return cookies.get(COOKIE_NAME);\n};\n","import { promisify } from 'util';\nimport type {\n GetPublicKeyOrSecret,\n Secret,\n VerifyCallback,\n VerifyOptions,\n} from 'jsonwebtoken';\nimport jsonwebtoken from 'jsonwebtoken';\nimport type { Logger } from 'nightingale-logger';\nimport type { User, UserSanitized } from '../../types.d';\nimport type MongoUsersManager from '../MongoUsersManager';\n\ntype Verify = (\n token: string,\n secretOrPublicKey: Secret | GetPublicKeyOrSecret,\n options?: VerifyOptions,\n callback?: VerifyCallback,\n) => void;\n\nconst verifyPromisified = promisify<\n Parameters<Verify>[0],\n Parameters<Verify>[1],\n Parameters<Verify>[2],\n Parameters<VerifyCallback>[1]\n>(jsonwebtoken.verify as Verify);\n\nconst createDecodeJWT =\n (secretKey: string) =>\n async (token: string, jwtAudience: string): Promise<string | undefined> => {\n const result = await verifyPromisified(token, secretKey, {\n algorithms: ['HS512'],\n audience: jwtAudience,\n });\n return (result as any)?.connected as string | undefined;\n };\n\nexport type FindConnectedAndUser<U extends User> = (\n jwtAudience?: string,\n token?: string,\n) => Promise<[null | undefined | U['_id'], null | undefined | U]>;\n\nexport const createFindConnectedAndUser = <\n U extends User,\n USanitized extends UserSanitized,\n>(\n secretKey: string,\n usersManager: MongoUsersManager<U, USanitized>,\n logger: Logger,\n): FindConnectedAndUser<U> => {\n const decodeJwt = createDecodeJWT(secretKey);\n\n const findConnectedAndUser: FindConnectedAndUser<U> = async (\n jwtAudience,\n token,\n ) => {\n if (!token || !jwtAudience) return [null, null];\n\n let connected;\n try {\n connected = await decodeJwt(token, jwtAudience);\n } catch (err: unknown) {\n logger.debug('failed to verify authentification', { err });\n }\n\n if (connected == null) return [null, null];\n\n const user = await usersManager.findConnected(connected);\n\n return [connected, user];\n };\n\n return findConnectedAndUser;\n};\n","import type { MongoInsertType, MongoStore, Update } from 'liwi-mongo';\nimport type { User, Account, UserSanitized } from '../types.d';\n\nexport default class MongoUsersManager<\n U extends User = User,\n USanitized extends UserSanitized = UserSanitized,\n> {\n store: MongoStore<U>;\n\n constructor(store: MongoStore<U>) {\n this.store = store;\n }\n\n findConnected(connected: string): Promise<U | undefined> {\n return this.store.findByKey(connected);\n }\n\n insertOne(user: MongoInsertType<U>): Promise<any> {\n return this.store.insertOne(user);\n }\n\n replaceOne(user: U): Promise<any> {\n return this.store.replaceOne(user);\n }\n\n sanitize(user: U): USanitized {\n return this.sanitizeBaseUser(user) as USanitized;\n }\n\n findOneByAccountOrEmails({\n accountId,\n emails,\n provider,\n }: {\n accountId: string | number;\n emails?: string[];\n provider: string;\n }): Promise<U | undefined> {\n let query: any = {\n 'accounts.provider': provider,\n 'accounts.accountId': accountId,\n };\n\n if (emails && emails.length > 0) {\n query = {\n $or: [\n query,\n {\n emails: { $in: emails },\n },\n ],\n };\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n return this.store.findOne(query);\n }\n\n updateAccount(user: U, account: Account): Promise<U> {\n const accountIndex = user.accounts.indexOf(account);\n if (accountIndex === -1) {\n throw new Error('Invalid account');\n }\n\n return this.store.partialUpdateOne(user, {\n $set: {\n [`accounts.${accountIndex}`]: account,\n },\n } as Update<U>);\n }\n\n protected sanitizeBaseUser(user: U): UserSanitized {\n return {\n _id: user._id,\n created: user.created,\n updated: user.updated,\n displayName: user.displayName,\n fullName: user.fullName,\n status: user.status,\n emails: user.emails,\n emailDomains: user.emailDomains,\n accounts: user.accounts.map((account: Account) => ({\n provider: account.provider,\n accountId: account.accountId,\n name: account.name,\n status: account.status,\n profile: account.profile,\n })),\n };\n }\n}\n","/* eslint-disable @typescript-eslint/no-unsafe-argument */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport { fetch } from 'alp-node';\nimport type { Tokens } from '../authentification/types';\nimport type { AccountService, FullName } from './types';\n\nexport default class UserAccountGoogleService<ScopeKeys extends 'login'>\n implements AccountService<ScopeKeys>\n{\n scopeKeyToScope: Record<ScopeKeys, string>;\n\n constructor(scopeKeyToScope: Record<Exclude<'login', ScopeKeys>, string>) {\n this.scopeKeyToScope = {\n ...scopeKeyToScope,\n login: 'openid profile email',\n };\n }\n\n providerKey = 'google';\n\n getProfile(tokens: Tokens): Promise<any> {\n return fetch(\n `https://www.googleapis.com/oauth2/v1/userinfo?access_token=${tokens.accessToken}`,\n ).then((response) => response.json());\n }\n\n getId(profile: any): any {\n return profile.id;\n }\n\n getAccountName(profile: any): string | null | undefined {\n return profile.email;\n }\n\n getEmails(profile: any): string[] {\n const emails: string[] = [];\n\n if (profile.email) {\n emails.push(profile.email);\n }\n\n return emails;\n }\n\n getDisplayName(profile: any): string | null | undefined {\n return profile.name;\n }\n\n getFullName(profile: any): FullName {\n return {\n givenName: profile.given_name,\n familyName: profile.family_name,\n };\n }\n\n getDefaultScope(newScope: string): string[] {\n return this.getScope(undefined, newScope);\n }\n\n getScope(oldScope: string[] | undefined, newScope: string): string[] {\n return !oldScope\n ? newScope.split(' ')\n : [...oldScope, ...newScope.split(' ')].filter(\n (item, i, ar) => ar.indexOf(item) === i,\n );\n }\n}\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport { fetch } from 'alp-node';\nimport type { Tokens } from '../authentification/types';\nimport type { AccountService, FullName } from './types';\n\n// https://api.slack.com/methods/users.identity\n\nexport default class UserAccountSlackService<ScopeKeys extends 'login'>\n implements AccountService<ScopeKeys>\n{\n scopeKeyToScope: Record<ScopeKeys, string>;\n\n constructor(scopeKeyToScope: Record<Exclude<'login', ScopeKeys>, string>) {\n this.scopeKeyToScope = {\n ...scopeKeyToScope,\n login: 'identity.basic identity.email identity.avatar',\n };\n }\n\n providerKey = 'google';\n\n getProfile(tokens: Tokens): Promise<any> {\n return fetch(\n `https://slack.com/api/users.identity?token=${tokens.accessToken}`,\n ).then((response) => response.json());\n }\n\n getId(profile: any): string | null {\n if (\n !profile ||\n !profile.team ||\n !profile.team.id ||\n !profile.user ||\n !profile.user.id\n ) {\n return null;\n }\n return `team:${profile.team.id as string};user:${\n profile.user.id as string\n }`;\n }\n\n getAccountName(profile: any): string | null | undefined {\n return profile.user.email;\n }\n\n getEmails(profile: any): string[] {\n return profile.user.email ? [profile.user.email] : [];\n }\n\n getDisplayName(profile: any): string | null | undefined {\n return profile.user.name;\n }\n\n getFullName(profile: any): FullName | null {\n return null;\n }\n\n getDefaultScope(newScope: string): string[] {\n return this.getScope(undefined, newScope);\n }\n\n getScope(oldScope: string[] | undefined, newScope: string): string[] {\n return !oldScope\n ? newScope.split(' ')\n : [...oldScope, ...newScope.split(' ')].filter(\n (item, i, ar) => ar.indexOf(item) === i,\n );\n }\n}\n","import type { NodeApplication } from 'alp-types';\nimport type { Option } from 'cookies';\nimport { Logger } from 'nightingale-logger';\nimport type { User } from '../types.d';\nimport type MongoUsersManager from './MongoUsersManager';\nimport { getTokenFromRequest } from './utils/cookies';\nimport { createFindConnectedAndUser } from './utils/createFindConnectedAndUser';\n\nconst logger = new Logger('alp:auth');\n\nexport const authSocketIO = <U extends User = User>(\n app: NodeApplication,\n usersManager: MongoUsersManager<U>,\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n io: any,\n options?: Pick<Option, Exclude<keyof Option, 'secure'>>,\n): void => {\n const findConnectedAndUser = createFindConnectedAndUser(\n app.config.get<Map<string, string>>('authentication').get('secretKey')!,\n usersManager,\n logger,\n );\n\n const users = new Map();\n io.users = users;\n\n io.use(async (socket: any, next: any) => {\n const handshakeData = socket.request;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n const token = getTokenFromRequest(handshakeData);\n\n if (!token) return next();\n\n const [connected, user] = await findConnectedAndUser(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n handshakeData.headers['user-agent'],\n token,\n );\n\n if (!connected || !user) return next();\n\n socket.user = user;\n users.set(socket.client.id, user);\n\n socket.on('disconnected', () => users.delete(socket.client.id));\n\n await next();\n });\n};\n","import type { IncomingMessage } from 'http';\nimport type { NodeConfig } from 'alp-types';\nimport { Logger } from 'nightingale-logger';\nimport type { User } from '../types.d';\nimport type MongoUsersManager from './MongoUsersManager';\nimport { getTokenFromRequest, COOKIE_NAME } from './utils/cookies';\nimport { createFindConnectedAndUser } from './utils/createFindConnectedAndUser';\n\nconst logger = new Logger('alp:auth');\n\nconst getTokenFromReq = (\n req: IncomingMessage & { cookies?: Record<string, string> },\n): string | undefined => {\n if (req.cookies) return req.cookies[COOKIE_NAME];\n return getTokenFromRequest(req);\n};\n\n/*\n * Not tested yet.\n * @internal\n */\nexport const createAuthApolloContext = <U extends User = User>(\n config: NodeConfig,\n usersManager: MongoUsersManager<U>,\n): any => {\n const findConnectedAndUser = createFindConnectedAndUser(\n config.get<Map<string, string>>('authentication').get('secretKey')!,\n usersManager,\n logger,\n );\n\n return async ({ req, connection }: { req: any; connection: any }) => {\n if (connection?.user) {\n return { user: connection.user };\n }\n\n if (!req) return null;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n const token = getTokenFromReq(req);\n\n if (!token) return { user: undefined };\n\n const [, user] = await findConnectedAndUser(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n req.headers['user-agent'],\n token,\n );\n\n return { user };\n };\n};\n","import type { IncomingMessage } from 'http';\nimport { promisify } from 'util';\nimport type { Context } from 'alp-node';\nimport type { ContextState, NodeApplication } from 'alp-types';\nimport jsonwebtoken from 'jsonwebtoken';\nimport { Logger } from 'nightingale-logger';\nimport type { User, UserSanitized } from '../types.d';\nimport type MongoUsersManager from './MongoUsersManager';\nimport type {\n AuthController as AuthControllerType,\n AuthHooks,\n} from './createAuthController';\nimport { createAuthController } from './createAuthController';\nimport type { AuthRoutes as AuthRoutesType } from './createRoutes';\nimport { createRoutes } from './createRoutes';\nimport type { Strategies } from './services/authentification/AuthenticationService';\nimport { AuthenticationService } from './services/authentification/AuthenticationService';\nimport type { AllowedStrategyKeys } from './services/authentification/types';\nimport UserAccountsService from './services/user/UserAccountsService';\nimport type { AccountService } from './services/user/types';\nimport { getTokenFromRequest, COOKIE_NAME } from './utils/cookies';\nimport { createFindConnectedAndUser } from './utils/createFindConnectedAndUser';\n\nexport { default as MongoUsersManager } from './MongoUsersManager';\nexport { default as UserAccountGoogleService } from './services/user/UserAccountGoogleService';\nexport { default as UserAccountSlackService } from './services/user/UserAccountSlackService';\nexport { authSocketIO } from './authSocketIO';\nexport { createAuthApolloContext } from './authApolloContext';\nexport { STATUSES } from './services/user/UserAccountsService';\n\ndeclare module 'alp-types' {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n interface ContextState {\n connected: NonNullable<ContextState['user']>['_id'] | null | undefined;\n user: User | null | undefined;\n }\n\n interface ContextSanitizedState {\n connected:\n | NonNullable<ContextSanitizedState['user']>['_id']\n | null\n | undefined;\n user: UserSanitized | null | undefined;\n }\n\n interface BaseContext {\n setConnected: (\n connected: NonNullable<ContextState['user']>['_id'],\n user: NonNullable<ContextState['user']>,\n ) => Promise<void>;\n logout: () => void;\n }\n}\n\nconst logger = new Logger('alp:auth');\n\nconst signPromisified: any = promisify(jsonwebtoken.sign);\n\nexport type AuthController = AuthControllerType;\nexport type AuthRoutes = AuthRoutesType;\nexport { AuthenticationService } from './services/authentification/AuthenticationService';\n\nexport default function init<\n StrategyKeys extends AllowedStrategyKeys = 'google',\n U extends User = User,\n USanitized extends UserSanitized = UserSanitized,\n>({\n homeRouterKey,\n usersManager,\n strategies,\n defaultStrategy,\n strategyToService,\n authHooks,\n jwtAudience,\n}: {\n homeRouterKey?: string;\n usersManager: MongoUsersManager<U, USanitized>;\n strategies: Strategies<StrategyKeys>;\n defaultStrategy?: StrategyKeys;\n strategyToService: Record<StrategyKeys, AccountService<any>>;\n authHooks?: AuthHooks<StrategyKeys>;\n jwtAudience?: string;\n}) {\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n return (app: NodeApplication) => {\n const userAccountsService = new UserAccountsService(\n usersManager,\n strategyToService,\n );\n\n const authenticationService = new AuthenticationService(\n app.config,\n strategies,\n userAccountsService,\n );\n\n const controller = createAuthController({\n usersManager,\n authenticationService,\n homeRouterKey,\n defaultStrategy,\n authHooks,\n });\n\n app.context.setConnected = async function (\n this: Context,\n connected: NonNullable<ContextState['user']>['_id'],\n user: NonNullable<ContextState['user']>,\n ): Promise<void> {\n logger.debug('setConnected', { connected });\n if (!connected) {\n throw new Error('Illegal value for setConnected');\n }\n\n this.state.connected = connected;\n this.state.user = user;\n\n const token = await signPromisified(\n { connected, time: Date.now() },\n this.config\n .get<Map<string, unknown>>('authentication')\n .get('secretKey'),\n {\n algorithm: 'HS512',\n audience: jwtAudience || this.request.headers['user-agent'],\n expiresIn: '30 days',\n },\n );\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n this.cookies.set(COOKIE_NAME, token, {\n httpOnly: true,\n secure: this.config.get('allowHttps'),\n });\n };\n\n app.context.logout = function (this: Context): void {\n delete this.state.connected;\n delete this.state.user;\n this.cookies.set(COOKIE_NAME, '', { expires: new Date(1) });\n };\n\n const getConnectedAndUser = createFindConnectedAndUser(\n app.config\n .get<Map<string, unknown>>('authentication')\n .get('secretKey') as string,\n usersManager,\n logger,\n );\n\n return {\n routes: createRoutes(controller),\n\n getConnectedAndUserFromRequest: (\n req: IncomingMessage,\n ): ReturnType<typeof getConnectedAndUser> => {\n const token = getTokenFromRequest(req);\n return getConnectedAndUser(\n jwtAudience || req.headers['user-agent'],\n token,\n );\n },\n getConnectedAndUser,\n\n middleware: async <T>(\n ctx: Context,\n next: () => T | Promise<T>,\n ): Promise<T> => {\n const token = ctx.cookies.get(COOKIE_NAME);\n const userAgent = ctx.request.headers['user-agent'];\n logger.debug('middleware', { token });\n\n const setState = (\n connected: U['_id'] | null | undefined,\n user: U | null | undefined,\n ): void => {\n ctx.state.connected = connected;\n ctx.state.user = user;\n ctx.sanitizedState.connected = connected;\n ctx.sanitizedState.user = user && usersManager.sanitize(user);\n };\n\n const [connected, user] = await getConnectedAndUser(\n jwtAudience || userAgent,\n token,\n );\n logger.debug('middleware', { connected });\n\n if (connected == null || user == null) {\n if (token) ctx.cookies.set(COOKIE_NAME, '', { expires: new Date(1) });\n setState(null, null);\n return next();\n }\n\n setState(connected, user);\n return next();\n },\n };\n };\n}\n"],"names":["createAuthController","usersManager","authenticationService","homeRouterKey","defaultStrategy","authHooks","login","ctx","strategy","namedParam","Error","params","paramsForLogin","redirectAuthUrl","addScope","state","connected","redirectTo","scopeKey","loginResponse","assert","connectedUser","accessResponse","afterLoginSuccess","afterScopeUpdate","keyPath","store","setConnected","logout","createRoutes","controller","segment","add","defaultRoute","randomBytesPromisified","promisify","randomBytes","randomHex","size","buffer","toString","logger","Logger","AuthenticationService","EventEmitter","constructor","config","strategies","userAccountsService","generateAuthUrl","debug","strategyInstance","type","oauth2","authorizationCode","authorizeURL","getTokens","options","result","getToken","code","redirect_uri","redirectUri","accessToken","access_token","refreshToken","refresh_token","tokenType","token_type","expiresIn","expires_in","expireDate","d","Date","setTime","getTime","idToken","id_token","tokensParam","token","create","refresh","tokens","host","get","request","urlGenerator","user","accountId","scope","getScope","cookies","set","JSON","stringify","isLoginAccess","maxAge","httpOnly","secure","access_type","redirect","isConnected","hooks","query","error","status","expose","cookieName","cookie","expires","parse","findOrCreateFromStrategy","account","update","refreshAccountTokens","tokenExpireDate","now","Promise","resolve","provider","then","updateAccount","STATUSES","VALIDATED","DELETED","UserAccountsService","strategyToService","userId","_id","service","newScope","scopeKeyToScope","accounts","find","join","subservice","profile","getProfile","getId","subservices","includes","push","replaceOne","emails","getEmails","findOneByAccountOrEmails","providerKey","info","Object","assign","displayName","getDisplayName","fullName","getFullName","name","getAccountName","userEmails","forEach","email","emailDomains","reduce","domains","split","Set","insertOne","COOKIE_NAME","getTokenFromRequest","req","Cookies","verifyPromisified","jsonwebtoken","verify","createDecodeJWT","secretKey","jwtAudience","algorithms","audience","createFindConnectedAndUser","decodeJwt","err","findConnected","MongoUsersManager","findByKey","sanitize","sanitizeBaseUser","length","$or","$in","findOne","accountIndex","indexOf","partialUpdateOne","$set","created","updated","map","UserAccountGoogleService","fetch","response","json","id","givenName","given_name","familyName","family_name","getDefaultScope","undefined","oldScope","filter","item","i","ar","UserAccountSlackService","team","authSocketIO","app","io","findConnectedAndUser","users","Map","use","socket","next","handshakeData","headers","client","on","delete","getTokenFromReq","createAuthApolloContext","connection","signPromisified","sign","init","context","time","algorithm","getConnectedAndUser","routes","getConnectedAndUserFromRequest","middleware","userAgent","setState","sanitizedState"],"mappings":";;;;;;;;;AA8CO,SAASA,oBAAT,CAIL;AACAC,EAAAA,YADA;AAEAC,EAAAA,qBAFA;AAGAC,EAAAA,aAAa,GAAG,GAHhB;AAIAC,EAAAA,eAJA;AAKAC,EAAAA,SAAS,GAAG;AALZ,CAJK,EAUqE;AAC1E,SAAO;AACL,UAAMC,KAAN,CAAYC,GAAZ,EAAyC;AACvC,YAAMC,QAAsB,GAAID,GAAG,CAACE,UAAJ,CAAe,UAAf,KAC9BL,eADF;AAEA,UAAI,CAACI,QAAL,EAAe,MAAM,IAAIE,KAAJ,CAAU,kBAAV,CAAN;AACf,YAAMC,MAAM,GACTN,SAAS,CAACO,cAAV,KACE,MAAMP,SAAS,CAACO,cAAV,CAAyBJ,QAAzB,EAAmCD,GAAnC,CADR,CAAD,IAEA,EAHF;AAIA,YAAML,qBAAqB,CAACW,eAAtB,CAAsCN,GAAtC,EAA2CC,QAA3C,EAAqD,EAArD,EAAyDG,MAAzD,CAAN;AACD,KAVI;;AAYL,UAAMG,QAAN,CAAeP,GAAf,EAA4C;AAC1C,UAAIA,GAAG,CAACQ,KAAJ,CAAUC,SAAd,EAAyB;AACvB,cAAMT,GAAG,CAACU,UAAJ,CAAed,aAAf,CAAN;AACA;AACD;;AAED,YAAMK,QAAsB,GAAID,GAAG,CAACE,UAAJ,CAAe,UAAf,KAC9BL,eADF;AAEA,UAAI,CAACI,QAAL,EAAe,MAAM,IAAIE,KAAJ,CAAU,kBAAV,CAAN;AACf,YAAMQ,QAAQ,GAAGX,GAAG,CAACE,UAAJ,CAAe,UAAf,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UAAAA,GAAG,CAACQ,KAAJ,CAAUC,SAAV,GAAsBA,SAAtB;AACAT,UAAAA,GAAG,CAACQ,KAAJ,CAAUwE,IAAV,GAAiBA,IAAjB;AACAhF,UAAAA,GAAG,CAAC4O,cAAJ,CAAmBnO,SAAnB,GAA+BA,SAA/B;AACAT,UAAAA,GAAG,CAAC4O,cAAJ,CAAmB5J,IAAnB,GAA0BA,IAAI,IAAItF,YAAY,CAACsL,QAAb,CAAsBhG,IAAtB,CAAlC;AACD,SARD;;AAUA,cAAM,CAACvE,SAAD,EAAYuE,IAAZ,IAAoB,MAAMsJ,mBAAmB,CACjD/D,WAAW,IAAImE,SADkC,EAEjDlK,KAFiD,CAAnD;AAIAtC,QAAAA,MAAM,CAACS,KAAP,CAAa,YAAb,EAA2B;AAAElC,UAAAA;AAAF,SAA3B;;AAEA,YAAIA,SAAS,IAAI,IAAb,IAAqBuE,IAAI,IAAI,IAAjC,EAAuC;AACrC,cAAIR,KAAJ,EAAWxE,GAAG,CAACoF,OAAJ,CAAYC,GAAZ,CAAgByE,WAAhB,EAA6B,EAA7B,EAAiC;AAAExD,YAAAA,OAAO,EAAE,IAAIpC,IAAJ,CAAS,CAAT;AAAX,WAAjC;AACXyK,UAAAA,QAAQ,CAAC,IAAD,EAAO,IAAP,CAAR;AACA,iBAAOpB,IAAI,EAAX;AACD;;AAEDoB,QAAAA,QAAQ,CAAClO,SAAD,EAAYuE,IAAZ,CAAR;AACA,eAAOuI,IAAI,EAAX;AACD;AA9CI,KAAP;AAgDD,GAlHD;AAmHD;;;;"}
package/dist/index.d.ts CHANGED
@@ -6,10 +6,8 @@ import type MongoUsersManager from './MongoUsersManager';
6
6
  import type { AuthController as AuthControllerType, AuthHooks } from './createAuthController';
7
7
  import type { AuthRoutes as AuthRoutesType } from './createRoutes';
8
8
  import type { Strategies } from './services/authentification/AuthenticationService';
9
- import { AuthenticationService } from './services/authentification/AuthenticationService';
10
9
  import type { AllowedStrategyKeys } from './services/authentification/types';
11
10
  import type { AccountService } from './services/user/types';
12
- export { AuthenticationService };
13
11
  export { default as MongoUsersManager } from './MongoUsersManager';
14
12
  export { default as UserAccountGoogleService } from './services/user/UserAccountGoogleService';
15
13
  export { default as UserAccountSlackService } from './services/user/UserAccountSlackService';
@@ -32,6 +30,7 @@ declare module 'alp-types' {
32
30
  }
33
31
  export declare type AuthController = AuthControllerType;
34
32
  export declare type AuthRoutes = AuthRoutesType;
33
+ export { AuthenticationService } from './services/authentification/AuthenticationService';
35
34
  export default function init<StrategyKeys extends AllowedStrategyKeys = 'google', U extends User = User, USanitized extends UserSanitized = UserSanitized>({ homeRouterKey, usersManager, strategies, defaultStrategy, strategyToService, authHooks, jwtAudience, }: {
36
35
  homeRouterKey?: string;
37
36
  usersManager: MongoUsersManager<U, USanitized>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAE5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,KAAK,EAAgB,eAAe,EAAE,MAAM,WAAW,CAAC;AAG/D,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,iBAAiB,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EACV,cAAc,IAAI,kBAAkB,EACpC,SAAS,EACV,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mDAAmD,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI5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EACnD,CAAC,SAAS,IAAI,GAAG,IAAI,EACrB,UAAU,SAAS,aAAa,GAAG,aAAa,EAChD,EACA,aAAa,EACb,YAAY,EACZ,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,WAAW,GACZ,EAAE;IACD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,iBAAiB,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;IAC/C,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IACrC,eAAe,CAAC,EAAE,YAAY,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC,YAAY,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7D,SAAS,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,SAEc,eAAe;;0CAsEjB,eAAe;;yBAWf,OAAO;EAkCnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"AuthenticationService.d.ts","sourceRoot":"","sources":["../../../src/services/authentification/AuthenticationService.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEhF,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAI3D,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC;I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O,CAAC,OAAO,CAAC;CAsBlE"}
1
+ {"version":3,"file":"AuthenticationService.d.ts","sourceRoot":"","sources":["../../../src/services/authentification/AuthenticationService.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEhF,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAI3D,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc,CAAC,MAAM,SAAS,MAAM,CAAE,SAAQ,QAAQ;IACrE,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED,oBAAY,UAAU,CAAC,YAAY,SAAS,mBAAmB,IAAI,MAAM,CACvE,YAAY,EACZ,cAAc,CAAC,GAAG,CAAC,CACpB,CAAC;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AAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE;CAOrE"}
1
+ {"version":3,"file":"UserAccountSlackService.d.ts","sourceRoot":"","sources":["../../../src/services/user/UserAccountSlackService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxD,MAAM,CAAC,OAAO,OAAO,uBAAuB,CAAC,SAAS,SAAS,OAAO,CACpE,YAAW,cAAc,CAAC,SAAS,CAAC;IAEpC,eAAe,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;gBAE/B,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAOxE,WAAW,SAAY;IAEvB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAMxC,KAAK,CAAC,OAAO,EAAE,GAAG,GAAG,MAAM,GAAG,IAAI;IAelC,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS;IAIvD,SAAS,CAAC,OAAO,EAAE,GAAG,GAAG,MAAM,EAAE;IAIjC,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS;IAIvD,WAAW,CAAC,OAAO,EAAE,GAAG,GAAG,QAAQ,GAAG,IAAI;IAI1C,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE;IAI3C,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE;CAOrE"}
@@ -1 +1 @@
1
- {"version":3,"file":"UserAccountsService.d.ts","sourceRoot":"","sources":["../../../src/services/user/UserAccountsService.ts"],"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AAE,YAAY,EACpB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,OAAO,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAA;KAAE,CAAC;IA+BjD,wBAAwB,CAC5B,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,CAAC,CAAC;IAuFP,aAAa,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;CAI3D"}
@@ -1 +1 @@
1
- {"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../src/utils/cookies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGtC,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAE3C,eAAO,MAAM,mBAAmB,QACzB,eAAe,iDAEnB,MAAM,GAAG,SAOX,CAAC"}
1
+ {"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../src/utils/cookies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGtC,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAE3C,eAAO,MAAM,mBAAmB,QACzB,eAAe,iDAEnB,MAAM,GAAG,SAQX,CAAC"}
@@ -1,4 +1,4 @@
1
- import type Logger from 'nightingale-logger';
1
+ import type { Logger } from 'nightingale-logger';
2
2
  import type { User, UserSanitized } from '../../types.d';
3
3
  import type MongoUsersManager from '../MongoUsersManager';
4
4
  export declare type FindConnectedAndUser<U extends User> = (jwtAudience?: string, token?: string) => Promise<[null | undefined | U['_id'], null | undefined | U]>;
@@ -1 +1 @@
1
- {"version":3,"file":"createFindConnectedAndUser.d.ts","sourceRoot":"","sources":["../../src/utils/createFindConnectedAndUser.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,iBAAiB,MAAM,sBAAsB,CAAC;AA2B1D,oBAAY,oBAAoB,CAAC,CAAC,SAAS,IAAI,IAAI,CACjD,WAAW,CAAC,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,MAAM,KACX,OAAO,CAAC,CAAC,IAAI,GAAG,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC;AAElE,eAAO,MAAM,0BAA0B,gEAI1B,MAAM,0DAET,MAAM,4BAyBf,CAAC"}
1
+ {"version":3,"file":"createFindConnectedAndUser.d.ts","sourceRoot":"","sources":["../../src/utils/createFindConnectedAndUser.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,iBAAiB,MAAM,sBAAsB,CAAC;AA0B1D,oBAAY,oBAAoB,CAAC,CAAC,SAAS,IAAI,IAAI,CACjD,WAAW,CAAC,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,MAAM,KACX,OAAO,CAAC,CAAC,IAAI,GAAG,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC;AAElE,eAAO,MAAM,0BAA0B,gEAI1B,MAAM,0DAET,MAAM,4BAyBf,CAAC"}