@breadstone/archipel-platform-authentication 0.0.7 → 0.0.9

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 -26
  2. package/src/AuthModule.d.ts +22 -8
  3. package/src/AuthModule.js +24 -28
  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} +17 -7
  17. package/src/{strategies/LocalStrategy.js → connectors/LocalConnector.js} +11 -11
  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 +9 -3
  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 +4 -4
  37. package/src/{services → mfa}/MfaService.js +5 -5
  38. package/src/{services/mfa → mfa}/MfaState.js +2 -2
  39. package/src/{services/mfa → mfa}/channels/EmailOtpMfaChannel.d.ts +4 -3
  40. package/src/{services/mfa → mfa}/channels/EmailOtpMfaChannel.js +6 -4
  41. package/src/{services/mfa → mfa}/channels/PushMfaChannel.d.ts +4 -3
  42. package/src/{services/mfa → mfa}/channels/PushMfaChannel.js +6 -4
  43. package/src/{services/mfa → mfa}/channels/SmsMfaChannel.d.ts +4 -3
  44. package/src/{services/mfa → mfa}/channels/SmsMfaChannel.js +6 -4
  45. package/src/{services/mfa → mfa}/channels/TotpMfaChannel.d.ts +4 -3
  46. package/src/{services/mfa → mfa}/channels/TotpMfaChannel.js +5 -3
  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
@@ -5,9 +5,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.EmailOtpMfaChannel = void 0;
6
6
  const tslib_1 = require("tslib");
7
7
  const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
8
+ const archipel_platform_cryptography_1 = require("@breadstone/archipel-platform-cryptography");
8
9
  const common_1 = require("@nestjs/common");
9
10
  const node_crypto_1 = require("node:crypto");
10
- const MfaSubjectPort_1 = require("../../../contracts/MfaSubjectPort");
11
+ const MfaSubjectPort_1 = require("../../contracts/MfaSubjectPort");
12
+ const env_1 = require("../../env");
11
13
  const MfaState_1 = require("../MfaState");
12
14
  // #endregion
13
15
  let EmailOtpMfaChannel = EmailOtpMfaChannel_1 = class EmailOtpMfaChannel {
@@ -17,8 +19,8 @@ let EmailOtpMfaChannel = EmailOtpMfaChannel_1 = class EmailOtpMfaChannel {
17
19
  this._mfaSubject = mfaSubject;
18
20
  this._configService = configService;
19
21
  this._bcryptService = bcryptService;
20
- this._ttlMilliseconds = archipel_platform_core_1.DateTimeUtils.parse(this._configService.tryGet('AUTH_MFA_EMAIL_CODE_TTL', '10m'));
21
- 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'));
22
24
  }
23
25
  async initSetup(userId, context) {
24
26
  const user = await this._mfaSubject.findById(userId);
@@ -147,6 +149,6 @@ let EmailOtpMfaChannel = EmailOtpMfaChannel_1 = class EmailOtpMfaChannel {
147
149
  exports.EmailOtpMfaChannel = EmailOtpMfaChannel;
148
150
  exports.EmailOtpMfaChannel = EmailOtpMfaChannel = EmailOtpMfaChannel_1 = tslib_1.__decorate([
149
151
  (0, common_1.Injectable)(),
150
- tslib_1.__metadata("design:paramtypes", [MfaSubjectPort_1.MfaSubjectPort, archipel_platform_core_1.ConfigService, archipel_platform_core_1.BcryptService])
152
+ tslib_1.__metadata("design:paramtypes", [MfaSubjectPort_1.MfaSubjectPort, archipel_platform_core_1.ConfigService, archipel_platform_cryptography_1.BcryptService])
151
153
  ], EmailOtpMfaChannel);
152
154
  //# sourceMappingURL=EmailOtpMfaChannel.js.map
@@ -1,6 +1,7 @@
1
- import { BcryptService, ConfigService } from '@breadstone/archipel-platform-core';
2
- import { MfaSubjectPort } from '../../../contracts/MfaSubjectPort';
3
- import { IMfaSetup } from '../../../models';
1
+ import { ConfigService } from '@breadstone/archipel-platform-core';
2
+ import { BcryptService } from '@breadstone/archipel-platform-cryptography';
3
+ import { MfaSubjectPort } from '../../contracts/MfaSubjectPort';
4
+ import { IMfaSetup } from '../../models';
4
5
  import { IMfaChannel } from '../IMfaChannel';
5
6
  import { IMfaSetupContext } from '../MfaState';
6
7
  /**
@@ -5,9 +5,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.PushMfaChannel = void 0;
6
6
  const tslib_1 = require("tslib");
7
7
  const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
8
+ const archipel_platform_cryptography_1 = require("@breadstone/archipel-platform-cryptography");
8
9
  const common_1 = require("@nestjs/common");
9
10
  const node_crypto_1 = require("node:crypto");
10
- const MfaSubjectPort_1 = require("../../../contracts/MfaSubjectPort");
11
+ const MfaSubjectPort_1 = require("../../contracts/MfaSubjectPort");
12
+ const env_1 = require("../../env");
11
13
  const MfaState_1 = require("../MfaState");
12
14
  // #endregion
13
15
  /**
@@ -24,8 +26,8 @@ let PushMfaChannel = PushMfaChannel_1 = class PushMfaChannel {
24
26
  this._mfaSubject = mfaSubject;
25
27
  this._configService = configService;
26
28
  this._bcryptService = bcryptService;
27
- this._ttlMilliseconds = archipel_platform_core_1.DateTimeUtils.parse(this._configService.tryGet('AUTH_MFA_PUSH_CODE_TTL', '10m'));
28
- 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'));
29
31
  }
30
32
  // #endregion
31
33
  // #region Methods
@@ -145,6 +147,6 @@ let PushMfaChannel = PushMfaChannel_1 = class PushMfaChannel {
145
147
  exports.PushMfaChannel = PushMfaChannel;
146
148
  exports.PushMfaChannel = PushMfaChannel = PushMfaChannel_1 = tslib_1.__decorate([
147
149
  (0, common_1.Injectable)(),
148
- tslib_1.__metadata("design:paramtypes", [MfaSubjectPort_1.MfaSubjectPort, archipel_platform_core_1.ConfigService, archipel_platform_core_1.BcryptService])
150
+ tslib_1.__metadata("design:paramtypes", [MfaSubjectPort_1.MfaSubjectPort, archipel_platform_core_1.ConfigService, archipel_platform_cryptography_1.BcryptService])
149
151
  ], PushMfaChannel);
150
152
  //# sourceMappingURL=PushMfaChannel.js.map
@@ -1,6 +1,7 @@
1
- import { BcryptService, ConfigService } from '@breadstone/archipel-platform-core';
2
- import { MfaSubjectPort } from '../../../contracts/MfaSubjectPort';
3
- import { IMfaSetup } from '../../../models';
1
+ import { ConfigService } from '@breadstone/archipel-platform-core';
2
+ import { BcryptService } from '@breadstone/archipel-platform-cryptography';
3
+ import { MfaSubjectPort } from '../../contracts/MfaSubjectPort';
4
+ import { IMfaSetup } from '../../models';
4
5
  import { IMfaChannel } from '../IMfaChannel';
5
6
  import { IMfaSetupContext } from '../MfaState';
6
7
  export declare class SmsMfaChannel implements IMfaChannel {
@@ -5,9 +5,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.SmsMfaChannel = void 0;
6
6
  const tslib_1 = require("tslib");
7
7
  const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
8
+ const archipel_platform_cryptography_1 = require("@breadstone/archipel-platform-cryptography");
8
9
  const common_1 = require("@nestjs/common");
9
10
  const node_crypto_1 = require("node:crypto");
10
- const MfaSubjectPort_1 = require("../../../contracts/MfaSubjectPort");
11
+ const MfaSubjectPort_1 = require("../../contracts/MfaSubjectPort");
12
+ const env_1 = require("../../env");
11
13
  const MfaState_1 = require("../MfaState");
12
14
  // #endregion
13
15
  let SmsMfaChannel = SmsMfaChannel_1 = class SmsMfaChannel {
@@ -20,8 +22,8 @@ let SmsMfaChannel = SmsMfaChannel_1 = class SmsMfaChannel {
20
22
  this._mfaSubject = mfaSubject;
21
23
  this._configService = configService;
22
24
  this._bcryptService = bcryptService;
23
- this._ttlMilliseconds = archipel_platform_core_1.DateTimeUtils.parse(this._configService.tryGet('AUTH_MFA_SMS_CODE_TTL', '10m'));
24
- 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'));
25
27
  }
26
28
  // #endregion
27
29
  // #region Methods
@@ -153,6 +155,6 @@ let SmsMfaChannel = SmsMfaChannel_1 = class SmsMfaChannel {
153
155
  exports.SmsMfaChannel = SmsMfaChannel;
154
156
  exports.SmsMfaChannel = SmsMfaChannel = SmsMfaChannel_1 = tslib_1.__decorate([
155
157
  (0, common_1.Injectable)(),
156
- tslib_1.__metadata("design:paramtypes", [MfaSubjectPort_1.MfaSubjectPort, archipel_platform_core_1.ConfigService, archipel_platform_core_1.BcryptService])
158
+ tslib_1.__metadata("design:paramtypes", [MfaSubjectPort_1.MfaSubjectPort, archipel_platform_core_1.ConfigService, archipel_platform_cryptography_1.BcryptService])
157
159
  ], SmsMfaChannel);
158
160
  //# sourceMappingURL=SmsMfaChannel.js.map
@@ -1,6 +1,7 @@
1
- import { ConfigService, IOtpService } from '@breadstone/archipel-platform-core';
2
- import { MfaSubjectPort } from '../../../contracts/MfaSubjectPort';
3
- import { IMfaSetup } from '../../../models';
1
+ import { ConfigService } from '@breadstone/archipel-platform-core';
2
+ import { IOtpService } from '@breadstone/archipel-platform-cryptography/otp';
3
+ import { MfaSubjectPort } from '../../contracts/MfaSubjectPort';
4
+ import { IMfaSetup } from '../../models';
4
5
  import { IMfaChannel } from '../IMfaChannel';
5
6
  import { MfaEncryptionService } from '../MfaEncryptionService';
6
7
  import { IMfaSetupContext } from '../MfaState';
@@ -4,8 +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 otp_1 = require("@breadstone/archipel-platform-cryptography/otp");
7
8
  const common_1 = require("@nestjs/common");
8
- const MfaSubjectPort_1 = require("../../../contracts/MfaSubjectPort");
9
+ const MfaSubjectPort_1 = require("../../contracts/MfaSubjectPort");
10
+ const env_1 = require("../../env");
9
11
  const MfaEncryptionService_1 = require("../MfaEncryptionService");
10
12
  const MfaState_1 = require("../MfaState");
11
13
  // #endregion
@@ -19,7 +21,7 @@ let TotpMfaChannel = class TotpMfaChannel {
19
21
  this._configService = configService;
20
22
  this._encryptionService = encryptionService;
21
23
  this._otpService = otpService;
22
- this._issuer = this._configService.tryGet('AUTH_MFA_ISSUER', 'Strivio');
24
+ this._issuer = this._configService.get(env_1.AUTH_MFA_ISSUER.key);
23
25
  }
24
26
  // #endregion
25
27
  // #region Methods
@@ -92,7 +94,7 @@ let TotpMfaChannel = class TotpMfaChannel {
92
94
  exports.TotpMfaChannel = TotpMfaChannel;
93
95
  exports.TotpMfaChannel = TotpMfaChannel = tslib_1.__decorate([
94
96
  (0, common_1.Injectable)(),
95
- tslib_1.__param(3, (0, common_1.Inject)(archipel_platform_core_1.OTP_SERVICE_TOKEN)),
97
+ tslib_1.__param(3, (0, common_1.Inject)(otp_1.OTP_SERVICE_TOKEN)),
96
98
  tslib_1.__metadata("design:paramtypes", [MfaSubjectPort_1.MfaSubjectPort,
97
99
  archipel_platform_core_1.ConfigService,
98
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