@breadstone/archipel-platform-authentication 0.0.8 → 0.0.10

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 (71) hide show
  1. package/package.json +35 -27
  2. package/src/AuthModule.d.ts +22 -8
  3. package/src/AuthModule.js +19 -24
  4. package/src/connectors/AnonymousConnector.d.ts +42 -0
  5. package/src/connectors/AnonymousConnector.js +54 -0
  6. package/src/{strategies/AppleStrategy.d.ts → connectors/AppleConnector.d.ts} +16 -5
  7. package/src/{strategies/AppleStrategy.js → connectors/AppleConnector.js} +16 -15
  8. package/src/connectors/ConnectorBase.d.ts +39 -0
  9. package/src/connectors/ConnectorBase.js +33 -0
  10. package/src/connectors/GithubConnector.d.ts +34 -0
  11. package/src/{strategies/GithubStrategy.js → connectors/GithubConnector.js} +13 -12
  12. package/src/{strategies/GoogleStrategy.d.ts → connectors/GoogleConnector.d.ts} +17 -6
  13. package/src/{strategies/GoogleStrategy.js → connectors/GoogleConnector.js} +14 -13
  14. package/src/{strategies/JwtStrategy.d.ts → connectors/JwtConnector.d.ts} +16 -6
  15. package/src/{strategies/JwtStrategy.js → connectors/JwtConnector.js} +11 -10
  16. package/src/{strategies/LocalStrategy.d.ts → connectors/LocalConnector.d.ts} +16 -6
  17. package/src/{strategies/LocalStrategy.js → connectors/LocalConnector.js} +9 -9
  18. package/src/{strategies/MicrosoftStrategy.d.ts → connectors/MicrosoftConnector.d.ts} +16 -6
  19. package/src/{strategies/MicrosoftStrategy.js → connectors/MicrosoftConnector.js} +15 -14
  20. package/src/{apple → connectors/apple}/env.js +1 -1
  21. package/src/connectors/apple/index.d.ts +2 -0
  22. package/src/connectors/apple/index.js +8 -0
  23. package/src/{github → connectors/github}/env.js +1 -1
  24. package/src/connectors/github/index.d.ts +2 -0
  25. package/src/connectors/github/index.js +8 -0
  26. package/src/{google → connectors/google}/env.js +1 -1
  27. package/src/connectors/google/index.d.ts +2 -0
  28. package/src/connectors/google/index.js +8 -0
  29. package/src/{microsoft → connectors/microsoft}/env.js +1 -1
  30. package/src/connectors/microsoft/index.d.ts +2 -0
  31. package/src/connectors/microsoft/index.js +8 -0
  32. package/src/env.d.ts +2 -0
  33. package/src/env.js +47 -43
  34. package/src/{services/mfa → mfa}/IMfaChannel.d.ts +1 -1
  35. package/src/{services/mfa → mfa}/MfaEncryptionService.js +4 -4
  36. package/src/{services → mfa}/MfaService.d.ts +3 -3
  37. package/src/{services → mfa}/MfaService.js +3 -3
  38. package/src/{services/mfa → mfa}/MfaState.js +2 -2
  39. package/src/{services/mfa → mfa}/channels/EmailOtpMfaChannel.d.ts +2 -2
  40. package/src/{services/mfa → mfa}/channels/EmailOtpMfaChannel.js +4 -3
  41. package/src/{services/mfa → mfa}/channels/PushMfaChannel.d.ts +2 -2
  42. package/src/{services/mfa → mfa}/channels/PushMfaChannel.js +4 -3
  43. package/src/{services/mfa → mfa}/channels/SmsMfaChannel.d.ts +2 -2
  44. package/src/{services/mfa → mfa}/channels/SmsMfaChannel.js +4 -3
  45. package/src/{services/mfa → mfa}/channels/TotpMfaChannel.d.ts +3 -3
  46. package/src/{services/mfa → mfa}/channels/TotpMfaChannel.js +5 -4
  47. package/src/mfa/totp/index.d.ts +22 -0
  48. package/src/mfa/totp/index.js +29 -0
  49. package/src/services/ChallengeService.js +4 -3
  50. package/src/services/VerificationService.js +2 -1
  51. package/src/services/index.d.ts +1 -1
  52. package/src/services/index.js +1 -1
  53. package/src/strategies/AnonymousStrategy.js +2 -1
  54. package/src/apple/index.d.ts +0 -2
  55. package/src/apple/index.js +0 -8
  56. package/src/github/index.d.ts +0 -2
  57. package/src/github/index.js +0 -8
  58. package/src/google/index.d.ts +0 -2
  59. package/src/google/index.js +0 -8
  60. package/src/microsoft/index.d.ts +0 -2
  61. package/src/microsoft/index.js +0 -8
  62. package/src/strategies/GithubStrategy.d.ts +0 -23
  63. /package/src/{apple → connectors/apple}/env.d.ts +0 -0
  64. /package/src/{github → connectors/github}/env.d.ts +0 -0
  65. /package/src/{google → connectors/google}/env.d.ts +0 -0
  66. /package/src/{microsoft → connectors/microsoft}/env.d.ts +0 -0
  67. /package/src/{services/mfa → mfa}/IMfaChannel.js +0 -0
  68. /package/src/{services/mfa → mfa}/MfaEncryptionService.d.ts +0 -0
  69. /package/src/{services/mfa → mfa}/MfaState.d.ts +0 -0
  70. /package/src/{services/mfa → mfa}/MfaTokens.d.ts +0 -0
  71. /package/src/{services/mfa → mfa}/MfaTokens.js +0 -0
@@ -1,4 +1,4 @@
1
- import { IMfaSetup } from '../../models';
1
+ import { IMfaSetup } from '../models';
2
2
  import { IMfaSetupContext } from './MfaState';
3
3
  /**
4
4
  * Defines the contract each MFA channel must implement.
@@ -3,9 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.MfaEncryptionService = void 0;
5
5
  const tslib_1 = require("tslib");
6
- const common_1 = require("@nestjs/common");
7
6
  const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
7
+ const common_1 = require("@nestjs/common");
8
8
  const node_crypto_1 = require("node:crypto");
9
+ const env_1 = require("../env");
9
10
  // #endregion
10
11
  /**
11
12
  * Provides AES-GCM encryption for MFA secrets.
@@ -16,9 +17,8 @@ let MfaEncryptionService = class MfaEncryptionService {
16
17
  // #endregion
17
18
  // #region Ctor
18
19
  constructor(configService) {
19
- const rawKey = configService.tryGet('AUTH_MFA_ENCRYPTION_KEY', '');
20
- const material = rawKey && rawKey.length > 0 ? rawKey : 'strivio-mfa-default-key';
21
- this._key = (0, node_crypto_1.createHash)('sha256').update(material).digest();
20
+ const rawKey = configService.get(env_1.AUTH_MFA_ENCRYPTION_KEY.key);
21
+ this._key = (0, node_crypto_1.createHash)('sha256').update(rawKey).digest();
22
22
  }
23
23
  // #endregion
24
24
  // #region Methods
@@ -1,9 +1,9 @@
1
1
  import { BcryptService } from '@breadstone/archipel-platform-cryptography';
2
2
  import { MfaSubjectPort } from '../contracts/MfaSubjectPort';
3
3
  import { IMfaConfirmation, IMfaSetup } from '../models';
4
- import { IMfaChannel } from './mfa/IMfaChannel';
5
- import { MfaEncryptionService } from './mfa/MfaEncryptionService';
6
- import { IMfaSetupContext } from './mfa/MfaState';
4
+ import { IMfaChannel } from './IMfaChannel';
5
+ import { MfaEncryptionService } from './MfaEncryptionService';
6
+ import { IMfaSetupContext } from './MfaState';
7
7
  /**
8
8
  * Orchestrates MFA channels, backup codes, and user preferences.
9
9
  *
@@ -7,9 +7,9 @@ const archipel_platform_cryptography_1 = require("@breadstone/archipel-platform-
7
7
  const common_1 = require("@nestjs/common");
8
8
  const node_crypto_1 = require("node:crypto");
9
9
  const MfaSubjectPort_1 = require("../contracts/MfaSubjectPort");
10
- const MfaEncryptionService_1 = require("./mfa/MfaEncryptionService");
11
- const MfaState_1 = require("./mfa/MfaState");
12
- const MfaTokens_1 = require("./mfa/MfaTokens");
10
+ const MfaEncryptionService_1 = require("./MfaEncryptionService");
11
+ const MfaState_1 = require("./MfaState");
12
+ const MfaTokens_1 = require("./MfaTokens");
13
13
  // #endregion
14
14
  /**
15
15
  * Orchestrates MFA channels, backup codes, and user preferences.
@@ -12,12 +12,12 @@ function resolveMfaState(raw) {
12
12
  return {
13
13
  preferredMethod: typed.preferredMethod,
14
14
  channels: typed.channels ?? {},
15
- trustedDevices: typed.trustedDevices ?? []
15
+ trustedDevices: typed.trustedDevices ?? [],
16
16
  };
17
17
  }
18
18
  return {
19
19
  channels: {},
20
- trustedDevices: []
20
+ trustedDevices: [],
21
21
  };
22
22
  }
23
23
  //# sourceMappingURL=MfaState.js.map
@@ -1,7 +1,7 @@
1
1
  import { ConfigService } from '@breadstone/archipel-platform-core';
2
2
  import { BcryptService } from '@breadstone/archipel-platform-cryptography';
3
- import { MfaSubjectPort } from '../../../contracts/MfaSubjectPort';
4
- import { IMfaSetup } from '../../../models';
3
+ import { MfaSubjectPort } from '../../contracts/MfaSubjectPort';
4
+ import { IMfaSetup } from '../../models';
5
5
  import { IMfaChannel } from '../IMfaChannel';
6
6
  import { IMfaSetupContext } from '../MfaState';
7
7
  export declare class EmailOtpMfaChannel implements IMfaChannel {
@@ -8,7 +8,8 @@ const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
8
8
  const archipel_platform_cryptography_1 = require("@breadstone/archipel-platform-cryptography");
9
9
  const common_1 = require("@nestjs/common");
10
10
  const node_crypto_1 = require("node:crypto");
11
- const MfaSubjectPort_1 = require("../../../contracts/MfaSubjectPort");
11
+ const MfaSubjectPort_1 = require("../../contracts/MfaSubjectPort");
12
+ const env_1 = require("../../env");
12
13
  const MfaState_1 = require("../MfaState");
13
14
  // #endregion
14
15
  let EmailOtpMfaChannel = EmailOtpMfaChannel_1 = class EmailOtpMfaChannel {
@@ -18,8 +19,8 @@ let EmailOtpMfaChannel = EmailOtpMfaChannel_1 = class EmailOtpMfaChannel {
18
19
  this._mfaSubject = mfaSubject;
19
20
  this._configService = configService;
20
21
  this._bcryptService = bcryptService;
21
- this._ttlMilliseconds = archipel_platform_core_1.DateTimeUtils.parse(this._configService.tryGet('AUTH_MFA_EMAIL_CODE_TTL', '10m'));
22
- this._minResendMilliseconds = archipel_platform_core_1.DateTimeUtils.parse(this._configService.tryGet('AUTH_MFA_EMAIL_MIN_RESEND', '30s'));
22
+ this._ttlMilliseconds = archipel_platform_core_1.DateTimeUtils.parse(this._configService.tryGet(env_1.AUTH_MFA_EMAIL_CODE_TTL.key, '10m'));
23
+ this._minResendMilliseconds = archipel_platform_core_1.DateTimeUtils.parse(this._configService.tryGet(env_1.AUTH_MFA_EMAIL_MIN_RESEND.key, '30s'));
23
24
  }
24
25
  async initSetup(userId, context) {
25
26
  const user = await this._mfaSubject.findById(userId);
@@ -1,7 +1,7 @@
1
1
  import { ConfigService } from '@breadstone/archipel-platform-core';
2
2
  import { BcryptService } from '@breadstone/archipel-platform-cryptography';
3
- import { MfaSubjectPort } from '../../../contracts/MfaSubjectPort';
4
- import { IMfaSetup } from '../../../models';
3
+ import { MfaSubjectPort } from '../../contracts/MfaSubjectPort';
4
+ import { IMfaSetup } from '../../models';
5
5
  import { IMfaChannel } from '../IMfaChannel';
6
6
  import { IMfaSetupContext } from '../MfaState';
7
7
  /**
@@ -8,7 +8,8 @@ const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
8
8
  const archipel_platform_cryptography_1 = require("@breadstone/archipel-platform-cryptography");
9
9
  const common_1 = require("@nestjs/common");
10
10
  const node_crypto_1 = require("node:crypto");
11
- const MfaSubjectPort_1 = require("../../../contracts/MfaSubjectPort");
11
+ const MfaSubjectPort_1 = require("../../contracts/MfaSubjectPort");
12
+ const env_1 = require("../../env");
12
13
  const MfaState_1 = require("../MfaState");
13
14
  // #endregion
14
15
  /**
@@ -25,8 +26,8 @@ let PushMfaChannel = PushMfaChannel_1 = class PushMfaChannel {
25
26
  this._mfaSubject = mfaSubject;
26
27
  this._configService = configService;
27
28
  this._bcryptService = bcryptService;
28
- this._ttlMilliseconds = archipel_platform_core_1.DateTimeUtils.parse(this._configService.tryGet('AUTH_MFA_PUSH_CODE_TTL', '10m'));
29
- this._minResendMilliseconds = archipel_platform_core_1.DateTimeUtils.parse(this._configService.tryGet('AUTH_MFA_PUSH_MIN_RESEND', '30s'));
29
+ this._ttlMilliseconds = archipel_platform_core_1.DateTimeUtils.parse(this._configService.tryGet(env_1.AUTH_MFA_PUSH_CODE_TTL.key, '10m'));
30
+ this._minResendMilliseconds = archipel_platform_core_1.DateTimeUtils.parse(this._configService.tryGet(env_1.AUTH_MFA_PUSH_MIN_RESEND.key, '30s'));
30
31
  }
31
32
  // #endregion
32
33
  // #region Methods
@@ -1,7 +1,7 @@
1
1
  import { ConfigService } from '@breadstone/archipel-platform-core';
2
2
  import { BcryptService } from '@breadstone/archipel-platform-cryptography';
3
- import { MfaSubjectPort } from '../../../contracts/MfaSubjectPort';
4
- import { IMfaSetup } from '../../../models';
3
+ import { MfaSubjectPort } from '../../contracts/MfaSubjectPort';
4
+ import { IMfaSetup } from '../../models';
5
5
  import { IMfaChannel } from '../IMfaChannel';
6
6
  import { IMfaSetupContext } from '../MfaState';
7
7
  export declare class SmsMfaChannel implements IMfaChannel {
@@ -8,7 +8,8 @@ const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
8
8
  const archipel_platform_cryptography_1 = require("@breadstone/archipel-platform-cryptography");
9
9
  const common_1 = require("@nestjs/common");
10
10
  const node_crypto_1 = require("node:crypto");
11
- const MfaSubjectPort_1 = require("../../../contracts/MfaSubjectPort");
11
+ const MfaSubjectPort_1 = require("../../contracts/MfaSubjectPort");
12
+ const env_1 = require("../../env");
12
13
  const MfaState_1 = require("../MfaState");
13
14
  // #endregion
14
15
  let SmsMfaChannel = SmsMfaChannel_1 = class SmsMfaChannel {
@@ -21,8 +22,8 @@ let SmsMfaChannel = SmsMfaChannel_1 = class SmsMfaChannel {
21
22
  this._mfaSubject = mfaSubject;
22
23
  this._configService = configService;
23
24
  this._bcryptService = bcryptService;
24
- this._ttlMilliseconds = archipel_platform_core_1.DateTimeUtils.parse(this._configService.tryGet('AUTH_MFA_SMS_CODE_TTL', '10m'));
25
- this._minResendMilliseconds = archipel_platform_core_1.DateTimeUtils.parse(this._configService.tryGet('AUTH_MFA_SMS_MIN_RESEND', '30s'));
25
+ this._ttlMilliseconds = archipel_platform_core_1.DateTimeUtils.parse(this._configService.tryGet(env_1.AUTH_MFA_SMS_CODE_TTL.key, '10m'));
26
+ this._minResendMilliseconds = archipel_platform_core_1.DateTimeUtils.parse(this._configService.tryGet(env_1.AUTH_MFA_SMS_MIN_RESEND.key, '30s'));
26
27
  }
27
28
  // #endregion
28
29
  // #region Methods
@@ -1,7 +1,7 @@
1
1
  import { ConfigService } from '@breadstone/archipel-platform-core';
2
- import { IOtpService } from '@breadstone/archipel-platform-cryptography';
3
- import { MfaSubjectPort } from '../../../contracts/MfaSubjectPort';
4
- import { IMfaSetup } from '../../../models';
2
+ import { IOtpService } from '@breadstone/archipel-platform-cryptography/otp';
3
+ import { MfaSubjectPort } from '../../contracts/MfaSubjectPort';
4
+ import { IMfaSetup } from '../../models';
5
5
  import { IMfaChannel } from '../IMfaChannel';
6
6
  import { MfaEncryptionService } from '../MfaEncryptionService';
7
7
  import { IMfaSetupContext } from '../MfaState';
@@ -4,9 +4,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.TotpMfaChannel = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
7
- const archipel_platform_cryptography_1 = require("@breadstone/archipel-platform-cryptography");
7
+ const otp_1 = require("@breadstone/archipel-platform-cryptography/otp");
8
8
  const common_1 = require("@nestjs/common");
9
- const MfaSubjectPort_1 = require("../../../contracts/MfaSubjectPort");
9
+ const MfaSubjectPort_1 = require("../../contracts/MfaSubjectPort");
10
+ const env_1 = require("../../env");
10
11
  const MfaEncryptionService_1 = require("../MfaEncryptionService");
11
12
  const MfaState_1 = require("../MfaState");
12
13
  // #endregion
@@ -20,7 +21,7 @@ let TotpMfaChannel = class TotpMfaChannel {
20
21
  this._configService = configService;
21
22
  this._encryptionService = encryptionService;
22
23
  this._otpService = otpService;
23
- this._issuer = this._configService.tryGet('AUTH_MFA_ISSUER', 'Strivio');
24
+ this._issuer = this._configService.get(env_1.AUTH_MFA_ISSUER.key);
24
25
  }
25
26
  // #endregion
26
27
  // #region Methods
@@ -93,7 +94,7 @@ let TotpMfaChannel = class TotpMfaChannel {
93
94
  exports.TotpMfaChannel = TotpMfaChannel;
94
95
  exports.TotpMfaChannel = TotpMfaChannel = tslib_1.__decorate([
95
96
  (0, common_1.Injectable)(),
96
- tslib_1.__param(3, (0, common_1.Inject)(archipel_platform_cryptography_1.OTP_SERVICE_TOKEN)),
97
+ tslib_1.__param(3, (0, common_1.Inject)(otp_1.OTP_SERVICE_TOKEN)),
97
98
  tslib_1.__metadata("design:paramtypes", [MfaSubjectPort_1.MfaSubjectPort,
98
99
  archipel_platform_core_1.ConfigService,
99
100
  MfaEncryptionService_1.MfaEncryptionService, Object])
@@ -0,0 +1,22 @@
1
+ import type { Provider } from '@nestjs/common';
2
+ /**
3
+ * Providers required by the {@link TotpMfaChannel}.
4
+ *
5
+ * Spread these into the `additionalProviders` option of `AuthModule.register()`
6
+ * when enabling TOTP-based MFA.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { TotpMfaChannel, TOTP_MFA_PROVIDERS } from '@breadstone/archipel-platform-authentication/mfa/totp';
11
+ *
12
+ * AuthModule.register({
13
+ * mfaChannels: [TotpMfaChannel],
14
+ * additionalProviders: [...TOTP_MFA_PROVIDERS],
15
+ * // ...
16
+ * });
17
+ * ```
18
+ *
19
+ * @public
20
+ */
21
+ export declare const TOTP_MFA_PROVIDERS: ReadonlyArray<Provider>;
22
+ export { TotpMfaChannel } from '../channels/TotpMfaChannel';
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ //#region Imports
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TotpMfaChannel = exports.TOTP_MFA_PROVIDERS = void 0;
5
+ const otp_1 = require("@breadstone/archipel-platform-cryptography/otp");
6
+ //#endregion
7
+ /**
8
+ * Providers required by the {@link TotpMfaChannel}.
9
+ *
10
+ * Spread these into the `additionalProviders` option of `AuthModule.register()`
11
+ * when enabling TOTP-based MFA.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * import { TotpMfaChannel, TOTP_MFA_PROVIDERS } from '@breadstone/archipel-platform-authentication/mfa/totp';
16
+ *
17
+ * AuthModule.register({
18
+ * mfaChannels: [TotpMfaChannel],
19
+ * additionalProviders: [...TOTP_MFA_PROVIDERS],
20
+ * // ...
21
+ * });
22
+ * ```
23
+ *
24
+ * @public
25
+ */
26
+ exports.TOTP_MFA_PROVIDERS = [{ provide: otp_1.OTP_SERVICE_TOKEN, useClass: otp_1.OtpService }];
27
+ var TotpMfaChannel_1 = require("../channels/TotpMfaChannel");
28
+ Object.defineProperty(exports, "TotpMfaChannel", { enumerable: true, get: function () { return TotpMfaChannel_1.TotpMfaChannel; } });
29
+ //# sourceMappingURL=index.js.map
@@ -3,9 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.ChallengeService = void 0;
5
5
  const tslib_1 = require("tslib");
6
- const common_1 = require("@nestjs/common");
7
6
  const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
7
+ const common_1 = require("@nestjs/common");
8
8
  const node_crypto_1 = require("node:crypto");
9
+ const env_1 = require("../env");
9
10
  /**
10
11
  * Stores and validates MFA login challenges.
11
12
  *
@@ -15,8 +16,8 @@ let ChallengeService = class ChallengeService {
15
16
  // #endregion
16
17
  // #region Ctor
17
18
  constructor(configService) {
18
- this._ttlMilliseconds = archipel_platform_core_1.DateTimeUtils.parse(configService.tryGet('AUTH_MFA_CHALLENGE_EXPIRES_IN', '5m'));
19
- this._maxAttempts = Number(configService.tryGet('AUTH_MFA_MAX_ATTEMPTS', '5'));
19
+ this._ttlMilliseconds = archipel_platform_core_1.DateTimeUtils.parse(configService.tryGet(env_1.AUTH_MFA_CHALLENGE_EXPIRES_IN.key, '5m'));
20
+ this._maxAttempts = Number(configService.tryGet(env_1.AUTH_MFA_MAX_ATTEMPTS.key, '5'));
20
21
  this._challenges = new Map();
21
22
  }
22
23
  // #endregion
@@ -7,6 +7,7 @@ const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
7
7
  const common_1 = require("@nestjs/common");
8
8
  const jwt_1 = require("@nestjs/jwt");
9
9
  const VerificationSubjectPort_1 = require("../contracts/VerificationSubjectPort");
10
+ const env_1 = require("../env");
10
11
  // #endregion
11
12
  /**
12
13
  * Manages email / PIN verification tokens via the {@link VerificationSubjectPort}.
@@ -42,7 +43,7 @@ let VerificationService = class VerificationService {
42
43
  */
43
44
  exhibitToken(data) {
44
45
  return this._jwtService.signAsync(data, {
45
- expiresIn: archipel_platform_core_1.DateTimeUtils.parse(this._configService.get('AUTH_VERIFY_JWT_EXPIRES_IN')),
46
+ expiresIn: archipel_platform_core_1.DateTimeUtils.parse(this._configService.get(env_1.AUTH_VERIFY_JWT_EXPIRES_IN.key)),
46
47
  });
47
48
  }
48
49
  /**
@@ -1,5 +1,5 @@
1
1
  export * from './AuthTokenService';
2
2
  export * from './ChallengeService';
3
- export * from './MfaService';
3
+ export * from '../mfa/MfaService';
4
4
  export * from './SessionService';
5
5
  export * from './VerificationService';
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./AuthTokenService"), exports);
5
5
  tslib_1.__exportStar(require("./ChallengeService"), exports);
6
- tslib_1.__exportStar(require("./MfaService"), exports);
6
+ tslib_1.__exportStar(require("../mfa/MfaService"), exports);
7
7
  tslib_1.__exportStar(require("./SessionService"), exports);
8
8
  tslib_1.__exportStar(require("./VerificationService"), exports);
9
9
  //# sourceMappingURL=index.js.map
@@ -8,6 +8,7 @@ const common_1 = require("@nestjs/common");
8
8
  const passport_1 = require("@nestjs/passport");
9
9
  const passport_custom_1 = require("passport-custom");
10
10
  const AuthSubjectPort_1 = require("../contracts/AuthSubjectPort");
11
+ const env_1 = require("../env");
11
12
  // #endregion
12
13
  /**
13
14
  * Anonymous strategy for temporary user login.
@@ -38,7 +39,7 @@ let AnonymousStrategy = class AnonymousStrategy extends (0, passport_1.PassportS
38
39
  * @returns The authenticated user and this is also later available in the request.user object
39
40
  */
40
41
  async validate() {
41
- const user = await this._authSubject.findAnonymous(this._configService.get('SEED_ANONYMOUS_USERNAME'));
42
+ const user = await this._authSubject.findAnonymous(this._configService.get(env_1.SEED_ANONYMOUS_USERNAME.key));
42
43
  if (!user) {
43
44
  throw new common_1.NotFoundException('User not found');
44
45
  }
@@ -1,2 +0,0 @@
1
- export { AppleStrategy } from '../strategies/AppleStrategy';
2
- export { APPLE_AUTH_CONFIG_ENTRIES } from './env';
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.APPLE_AUTH_CONFIG_ENTRIES = exports.AppleStrategy = void 0;
4
- var AppleStrategy_1 = require("../strategies/AppleStrategy");
5
- Object.defineProperty(exports, "AppleStrategy", { enumerable: true, get: function () { return AppleStrategy_1.AppleStrategy; } });
6
- var env_1 = require("./env");
7
- Object.defineProperty(exports, "APPLE_AUTH_CONFIG_ENTRIES", { enumerable: true, get: function () { return env_1.APPLE_AUTH_CONFIG_ENTRIES; } });
8
- //# sourceMappingURL=index.js.map
@@ -1,2 +0,0 @@
1
- export { GithubStrategy } from '../strategies/GithubStrategy';
2
- export { GITHUB_AUTH_CONFIG_ENTRIES } from './env';
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GITHUB_AUTH_CONFIG_ENTRIES = exports.GithubStrategy = void 0;
4
- var GithubStrategy_1 = require("../strategies/GithubStrategy");
5
- Object.defineProperty(exports, "GithubStrategy", { enumerable: true, get: function () { return GithubStrategy_1.GithubStrategy; } });
6
- var env_1 = require("./env");
7
- Object.defineProperty(exports, "GITHUB_AUTH_CONFIG_ENTRIES", { enumerable: true, get: function () { return env_1.GITHUB_AUTH_CONFIG_ENTRIES; } });
8
- //# sourceMappingURL=index.js.map
@@ -1,2 +0,0 @@
1
- export { GoogleStrategy } from '../strategies/GoogleStrategy';
2
- export { GOOGLE_AUTH_CONFIG_ENTRIES } from './env';
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GOOGLE_AUTH_CONFIG_ENTRIES = exports.GoogleStrategy = void 0;
4
- var GoogleStrategy_1 = require("../strategies/GoogleStrategy");
5
- Object.defineProperty(exports, "GoogleStrategy", { enumerable: true, get: function () { return GoogleStrategy_1.GoogleStrategy; } });
6
- var env_1 = require("./env");
7
- Object.defineProperty(exports, "GOOGLE_AUTH_CONFIG_ENTRIES", { enumerable: true, get: function () { return env_1.GOOGLE_AUTH_CONFIG_ENTRIES; } });
8
- //# sourceMappingURL=index.js.map
@@ -1,2 +0,0 @@
1
- export { MicrosoftStrategy } from '../strategies/MicrosoftStrategy';
2
- export { MICROSOFT_AUTH_CONFIG_ENTRIES } from './env';
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MICROSOFT_AUTH_CONFIG_ENTRIES = exports.MicrosoftStrategy = void 0;
4
- var MicrosoftStrategy_1 = require("../strategies/MicrosoftStrategy");
5
- Object.defineProperty(exports, "MicrosoftStrategy", { enumerable: true, get: function () { return MicrosoftStrategy_1.MicrosoftStrategy; } });
6
- var env_1 = require("./env");
7
- Object.defineProperty(exports, "MICROSOFT_AUTH_CONFIG_ENTRIES", { enumerable: true, get: function () { return env_1.MICROSOFT_AUTH_CONFIG_ENTRIES; } });
8
- //# sourceMappingURL=index.js.map
@@ -1,23 +0,0 @@
1
- import { ConfigService } from '@breadstone/archipel-platform-core';
2
- import { type Profile, Strategy } from 'passport-github2';
3
- import type { IAuthSubject } from '../contracts/IAuthSubject';
4
- import { SocialAuthPort } from '../contracts/SocialAuthPort';
5
- declare const GithubStrategy_base: new (...args: [options: import("passport-github2").StrategyOptionsWithRequest] | [options: import("passport-github2").StrategyOptions]) => Strategy & {
6
- validate(...args: any[]): unknown;
7
- };
8
- export declare class GithubStrategy extends GithubStrategy_base {
9
- private readonly _socialAuth;
10
- /**
11
- * Constructs a new instance of the `GithubStrategy` class.
12
- *
13
- * @public
14
- * @param socialAuth Social auth port instance.
15
- * @param configService Configuration service instance.
16
- */
17
- constructor(socialAuth: SocialAuthPort, configService: ConfigService);
18
- /**
19
- * @public
20
- */
21
- validate(_accessToken: string, _refreshToken: string, profile: Profile): Promise<IAuthSubject>;
22
- }
23
- export {};
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes