@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,24 +1,25 @@
1
1
  "use strict";
2
2
  // #region Imports
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.GoogleStrategy = void 0;
4
+ exports.GoogleConnector = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
7
7
  const common_1 = require("@nestjs/common");
8
- const passport_1 = require("@nestjs/passport");
9
8
  const passport_google_oauth20_1 = require("passport-google-oauth20");
10
9
  const SocialAuthPort_1 = require("../contracts/SocialAuthPort");
10
+ const env_1 = require("../env");
11
+ const ConnectorBase_1 = require("./ConnectorBase");
11
12
  // #endregion
12
13
  /**
13
- * The `GoogleStrategy` integrates Google OAuth authentication.
14
+ * The `GoogleConnector` integrates Google OAuth authentication.
14
15
  *
15
16
  * @public
16
17
  */
17
- let GoogleStrategy = class GoogleStrategy extends (0, passport_1.PassportStrategy)(passport_google_oauth20_1.Strategy, 'google') {
18
+ let GoogleConnector = class GoogleConnector extends (0, ConnectorBase_1.ConnectorBase)(passport_google_oauth20_1.Strategy, 'google') {
18
19
  // #endregion
19
20
  // #region Ctor
20
21
  /**
21
- * Initializes a new instance of the `GoogleStrategy` class.
22
+ * Initializes a new instance of the `GoogleConnector` class.
22
23
  *
23
24
  * @public
24
25
  * @param socialAuth Social auth port instance.
@@ -26,14 +27,14 @@ let GoogleStrategy = class GoogleStrategy extends (0, passport_1.PassportStrateg
26
27
  */
27
28
  constructor(socialAuth, configService) {
28
29
  const scope = configService
29
- .tryGet('AUTH_GOOGLE_SCOPE', 'email,profile')
30
+ .tryGet(env_1.AUTH_GOOGLE_SCOPE.key, 'email,profile')
30
31
  .split(',')
31
32
  .map((s) => s.trim())
32
33
  .filter(Boolean);
33
34
  super({
34
- clientID: configService.get('AUTH_GOOGLE_CLIENT_ID'),
35
- clientSecret: configService.get('AUTH_GOOGLE_CLIENT_SECRET'),
36
- callbackURL: configService.tryGet('AUTH_GOOGLE_CALLBACK_URL', '/auth/google/callback'),
35
+ clientID: configService.get(env_1.AUTH_GOOGLE_CLIENT_ID.key),
36
+ clientSecret: configService.get(env_1.AUTH_GOOGLE_CLIENT_SECRET.key),
37
+ callbackURL: configService.tryGet(env_1.AUTH_GOOGLE_CALLBACK_URL.key, '/auth/google/callback'),
37
38
  scope,
38
39
  state: true,
39
40
  });
@@ -71,9 +72,9 @@ let GoogleStrategy = class GoogleStrategy extends (0, passport_1.PassportStrateg
71
72
  return user;
72
73
  }
73
74
  };
74
- exports.GoogleStrategy = GoogleStrategy;
75
- exports.GoogleStrategy = GoogleStrategy = tslib_1.__decorate([
75
+ exports.GoogleConnector = GoogleConnector;
76
+ exports.GoogleConnector = GoogleConnector = tslib_1.__decorate([
76
77
  (0, common_1.Injectable)(),
77
78
  tslib_1.__metadata("design:paramtypes", [SocialAuthPort_1.SocialAuthPort, archipel_platform_core_1.ConfigService])
78
- ], GoogleStrategy);
79
- //# sourceMappingURL=GoogleStrategy.js.map
79
+ ], GoogleConnector);
80
+ //# sourceMappingURL=GoogleConnector.js.map
@@ -1,18 +1,28 @@
1
1
  import { ConfigService } from '@breadstone/archipel-platform-core';
2
- import { Strategy } from 'passport-jwt';
3
2
  import { AuthSubjectPort } from '../contracts/AuthSubjectPort';
4
3
  import type { IAuthSubject } from '../contracts/IAuthSubject';
5
4
  import { JwtPayloadBase } from '../models/JwtPayloadBase';
6
- declare const JwtStrategy_base: new (...args: [opt: import("passport-jwt").StrategyOptionsWithRequest] | [opt: import("passport-jwt").StrategyOptionsWithoutRequest]) => Strategy & {
7
- validate(...args: any[]): unknown;
5
+ declare const JwtConnector_base: (abstract new (...args: any[]) => {
6
+ [x: string]: any;
7
+ validate(...args: unknown[]): Promise<unknown>;
8
+ }) & {
9
+ apply(this: Function, thisArg: any, argArray?: any): any;
10
+ call(this: Function, thisArg: any, ...argArray: any[]): any;
11
+ bind(this: Function, thisArg: any, ...argArray: any[]): any;
12
+ toString(): string;
13
+ readonly length: number;
14
+ arguments: any;
15
+ caller: Function;
16
+ readonly name: string;
17
+ [Symbol.hasInstance](value: any): boolean;
8
18
  };
9
19
  /**
10
- * JWT strategy for handling token validation.
20
+ * JWT connector for handling token validation.
11
21
  */
12
- export declare class JwtStrategy extends JwtStrategy_base {
22
+ export declare class JwtConnector extends JwtConnector_base {
13
23
  private readonly _authSubject;
14
24
  /**
15
- * Constructs a new instance of the `JwtStrategy` class.
25
+ * Constructs a new instance of the `JwtConnector` class.
16
26
  *
17
27
  * @public
18
28
  * @param authSubject Auth subject port instance.
@@ -1,22 +1,23 @@
1
1
  "use strict";
2
2
  // #region Imports
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.JwtStrategy = void 0;
4
+ exports.JwtConnector = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
7
7
  const common_1 = require("@nestjs/common");
8
- const passport_1 = require("@nestjs/passport");
9
8
  const passport_jwt_1 = require("passport-jwt");
10
9
  const AuthSubjectPort_1 = require("../contracts/AuthSubjectPort");
10
+ const env_1 = require("../env");
11
+ const ConnectorBase_1 = require("./ConnectorBase");
11
12
  // #endregion
12
13
  /**
13
- * JWT strategy for handling token validation.
14
+ * JWT connector for handling token validation.
14
15
  */
15
- let JwtStrategy = class JwtStrategy extends (0, passport_1.PassportStrategy)(passport_jwt_1.Strategy) {
16
+ let JwtConnector = class JwtConnector extends (0, ConnectorBase_1.ConnectorBase)(passport_jwt_1.Strategy) {
16
17
  // #endregion
17
18
  // #region Ctor
18
19
  /**
19
- * Constructs a new instance of the `JwtStrategy` class.
20
+ * Constructs a new instance of the `JwtConnector` class.
20
21
  *
21
22
  * @public
22
23
  * @param authSubject Auth subject port instance.
@@ -26,7 +27,7 @@ let JwtStrategy = class JwtStrategy extends (0, passport_1.PassportStrategy)(pas
26
27
  super({
27
28
  jwtFromRequest: passport_jwt_1.ExtractJwt.fromAuthHeaderAsBearerToken(),
28
29
  ignoreExpiration: false, // Optional: Allow or disallow expired tokens
29
- secretOrKey: configService.get('AUTH_JWT_SECRET'), // The secret used for signing tokens
30
+ secretOrKey: configService.get(env_1.AUTH_JWT_SECRET.key), // The secret used for signing tokens
30
31
  });
31
32
  this._authSubject = authSubject;
32
33
  }
@@ -47,9 +48,9 @@ let JwtStrategy = class JwtStrategy extends (0, passport_1.PassportStrategy)(pas
47
48
  return user;
48
49
  }
49
50
  };
50
- exports.JwtStrategy = JwtStrategy;
51
- exports.JwtStrategy = JwtStrategy = tslib_1.__decorate([
51
+ exports.JwtConnector = JwtConnector;
52
+ exports.JwtConnector = JwtConnector = tslib_1.__decorate([
52
53
  (0, common_1.Injectable)(),
53
54
  tslib_1.__metadata("design:paramtypes", [AuthSubjectPort_1.AuthSubjectPort, archipel_platform_core_1.ConfigService])
54
- ], JwtStrategy);
55
- //# sourceMappingURL=JwtStrategy.js.map
55
+ ], JwtConnector);
56
+ //# sourceMappingURL=JwtConnector.js.map
@@ -1,20 +1,30 @@
1
1
  import { BcryptService } from '@breadstone/archipel-platform-cryptography';
2
- import { Strategy } from 'passport-local';
3
2
  import { AuthSubjectPort } from '../contracts/AuthSubjectPort';
4
3
  import type { IAuthSubject } from '../contracts/IAuthSubject';
5
- declare const LocalStrategy_base: new (...args: [] | [options: import("passport-local").IStrategyOptionsWithRequest] | [options: import("passport-local").IStrategyOptions]) => Strategy & {
6
- validate(...args: any[]): unknown;
4
+ declare const LocalConnector_base: (abstract new (...args: any[]) => {
5
+ [x: string]: any;
6
+ validate(...args: unknown[]): Promise<unknown>;
7
+ }) & {
8
+ apply(this: Function, thisArg: any, argArray?: any): any;
9
+ call(this: Function, thisArg: any, ...argArray: any[]): any;
10
+ bind(this: Function, thisArg: any, ...argArray: any[]): any;
11
+ toString(): string;
12
+ readonly length: number;
13
+ arguments: any;
14
+ caller: Function;
15
+ readonly name: string;
16
+ [Symbol.hasInstance](value: any): boolean;
7
17
  };
8
18
  /**
9
- * Local strategy for user name and password login.
19
+ * Local connector for user name and password login.
10
20
  *
11
21
  * @public
12
22
  */
13
- export declare class LocalStrategy extends LocalStrategy_base {
23
+ export declare class LocalConnector extends LocalConnector_base {
14
24
  private readonly _authSubject;
15
25
  private readonly _bcryptService;
16
26
  /**
17
- * Constructs a new instance of the `LocalStrategy` class.
27
+ * Constructs a new instance of the `LocalConnector` class.
18
28
  *
19
29
  * @public
20
30
  * @param authSubject Auth subject port instance.
@@ -1,24 +1,24 @@
1
1
  "use strict";
2
2
  // #region Imports
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.LocalStrategy = void 0;
4
+ exports.LocalConnector = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const archipel_platform_cryptography_1 = require("@breadstone/archipel-platform-cryptography");
7
7
  const common_1 = require("@nestjs/common");
8
- const passport_1 = require("@nestjs/passport");
9
8
  const passport_local_1 = require("passport-local");
10
9
  const AuthSubjectPort_1 = require("../contracts/AuthSubjectPort");
10
+ const ConnectorBase_1 = require("./ConnectorBase");
11
11
  // #endregion
12
12
  /**
13
- * Local strategy for user name and password login.
13
+ * Local connector for user name and password login.
14
14
  *
15
15
  * @public
16
16
  */
17
- let LocalStrategy = class LocalStrategy extends (0, passport_1.PassportStrategy)(passport_local_1.Strategy) {
17
+ let LocalConnector = class LocalConnector extends (0, ConnectorBase_1.ConnectorBase)(passport_local_1.Strategy) {
18
18
  // #endregion
19
19
  // #region Ctor
20
20
  /**
21
- * Constructs a new instance of the `LocalStrategy` class.
21
+ * Constructs a new instance of the `LocalConnector` class.
22
22
  *
23
23
  * @public
24
24
  * @param authSubject Auth subject port instance.
@@ -51,9 +51,9 @@ let LocalStrategy = class LocalStrategy extends (0, passport_1.PassportStrategy)
51
51
  return user;
52
52
  }
53
53
  };
54
- exports.LocalStrategy = LocalStrategy;
55
- exports.LocalStrategy = LocalStrategy = tslib_1.__decorate([
54
+ exports.LocalConnector = LocalConnector;
55
+ exports.LocalConnector = LocalConnector = tslib_1.__decorate([
56
56
  (0, common_1.Injectable)(),
57
57
  tslib_1.__metadata("design:paramtypes", [AuthSubjectPort_1.AuthSubjectPort, archipel_platform_cryptography_1.BcryptService])
58
- ], LocalStrategy);
59
- //# sourceMappingURL=LocalStrategy.js.map
58
+ ], LocalConnector);
59
+ //# sourceMappingURL=LocalConnector.js.map
@@ -1,20 +1,30 @@
1
1
  import { ConfigService } from '@breadstone/archipel-platform-core';
2
2
  import type { Profile as PassportProfile } from 'passport';
3
- import { Strategy } from 'passport-microsoft';
4
3
  import type { IAuthSubject } from '../contracts/IAuthSubject';
5
4
  import { SocialAuthPort } from '../contracts/SocialAuthPort';
6
- declare const MicrosoftStrategy_base: new (...args: [options: import("passport-microsoft").MicrosoftStrategyOptionsWithRequest] | [options: import("passport-microsoft").MicrosoftStrategyOptions]) => Strategy & {
7
- validate(...args: any[]): unknown;
5
+ declare const MicrosoftConnector_base: (abstract new (...args: any[]) => {
6
+ [x: string]: any;
7
+ validate(...args: unknown[]): Promise<unknown>;
8
+ }) & {
9
+ apply(this: Function, thisArg: any, argArray?: any): any;
10
+ call(this: Function, thisArg: any, ...argArray: any[]): any;
11
+ bind(this: Function, thisArg: any, ...argArray: any[]): any;
12
+ toString(): string;
13
+ readonly length: number;
14
+ arguments: any;
15
+ caller: Function;
16
+ readonly name: string;
17
+ [Symbol.hasInstance](value: any): boolean;
8
18
  };
9
19
  /**
10
- * The `MicrosoftStrategy` integrates Microsoft OAuth authentication.
20
+ * The `MicrosoftConnector` integrates Microsoft OAuth authentication.
11
21
  *
12
22
  * @public
13
23
  */
14
- export declare class MicrosoftStrategy extends MicrosoftStrategy_base {
24
+ export declare class MicrosoftConnector extends MicrosoftConnector_base {
15
25
  private readonly _socialAuth;
16
26
  /**
17
- * Initializes a new instance of the `MicrosoftStrategy` class.
27
+ * Initializes a new instance of the `MicrosoftConnector` class.
18
28
  *
19
29
  * @public
20
30
  * @param socialAuth Social auth port instance.
@@ -1,24 +1,25 @@
1
1
  "use strict";
2
2
  // #region Imports
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.MicrosoftStrategy = void 0;
4
+ exports.MicrosoftConnector = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
7
7
  const common_1 = require("@nestjs/common");
8
- const passport_1 = require("@nestjs/passport");
9
8
  const passport_microsoft_1 = require("passport-microsoft");
10
9
  const SocialAuthPort_1 = require("../contracts/SocialAuthPort");
10
+ const env_1 = require("../env");
11
+ const ConnectorBase_1 = require("./ConnectorBase");
11
12
  // #endregion
12
13
  /**
13
- * The `MicrosoftStrategy` integrates Microsoft OAuth authentication.
14
+ * The `MicrosoftConnector` integrates Microsoft OAuth authentication.
14
15
  *
15
16
  * @public
16
17
  */
17
- let MicrosoftStrategy = class MicrosoftStrategy extends (0, passport_1.PassportStrategy)(passport_microsoft_1.Strategy, 'microsoft') {
18
+ let MicrosoftConnector = class MicrosoftConnector extends (0, ConnectorBase_1.ConnectorBase)(passport_microsoft_1.Strategy, 'microsoft') {
18
19
  // #endregion
19
20
  // #region Ctor
20
21
  /**
21
- * Initializes a new instance of the `MicrosoftStrategy` class.
22
+ * Initializes a new instance of the `MicrosoftConnector` class.
22
23
  *
23
24
  * @public
24
25
  * @param socialAuth Social auth port instance.
@@ -26,15 +27,15 @@ let MicrosoftStrategy = class MicrosoftStrategy extends (0, passport_1.PassportS
26
27
  */
27
28
  constructor(socialAuth, configService) {
28
29
  const scope = configService
29
- .tryGet('AUTH_MICROSOFT_SCOPE', 'user.read')
30
+ .tryGet(env_1.AUTH_MICROSOFT_SCOPE.key, 'user.read')
30
31
  .split(',')
31
32
  .map((s) => s.trim())
32
33
  .filter(Boolean);
33
34
  super({
34
- clientID: configService.get('AUTH_MICROSOFT_CLIENT_ID'),
35
- clientSecret: configService.get('AUTH_MICROSOFT_CLIENT_SECRET'),
36
- callbackURL: configService.tryGet('AUTH_MICROSOFT_CALLBACK_URL', '/auth/microsoft/callback'),
37
- tenant: configService.tryGet('AUTH_MICROSOFT_TENANT', 'common'),
35
+ clientID: configService.get(env_1.AUTH_MICROSOFT_CLIENT_ID.key),
36
+ clientSecret: configService.get(env_1.AUTH_MICROSOFT_CLIENT_SECRET.key),
37
+ callbackURL: configService.tryGet(env_1.AUTH_MICROSOFT_CALLBACK_URL.key, '/auth/microsoft/callback'),
38
+ tenant: configService.tryGet(env_1.AUTH_MICROSOFT_TENANT.key, 'common'),
38
39
  scope,
39
40
  state: true,
40
41
  });
@@ -72,9 +73,9 @@ let MicrosoftStrategy = class MicrosoftStrategy extends (0, passport_1.PassportS
72
73
  return user;
73
74
  }
74
75
  };
75
- exports.MicrosoftStrategy = MicrosoftStrategy;
76
- exports.MicrosoftStrategy = MicrosoftStrategy = tslib_1.__decorate([
76
+ exports.MicrosoftConnector = MicrosoftConnector;
77
+ exports.MicrosoftConnector = MicrosoftConnector = tslib_1.__decorate([
77
78
  (0, common_1.Injectable)(),
78
79
  tslib_1.__metadata("design:paramtypes", [SocialAuthPort_1.SocialAuthPort, archipel_platform_core_1.ConfigService])
79
- ], MicrosoftStrategy);
80
- //# sourceMappingURL=MicrosoftStrategy.js.map
80
+ ], MicrosoftConnector);
81
+ //# sourceMappingURL=MicrosoftConnector.js.map
@@ -2,7 +2,7 @@
2
2
  // #region Imports
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.APPLE_AUTH_CONFIG_ENTRIES = void 0;
5
- const env_1 = require("../env");
5
+ const env_1 = require("../../env");
6
6
  // #endregion
7
7
  /** Configuration entries required by Apple Sign-In authentication. */
8
8
  exports.APPLE_AUTH_CONFIG_ENTRIES = [
@@ -0,0 +1,2 @@
1
+ export { AppleConnector } from '../AppleConnector';
2
+ export { APPLE_AUTH_CONFIG_ENTRIES } from './env';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.APPLE_AUTH_CONFIG_ENTRIES = exports.AppleConnector = void 0;
4
+ var AppleConnector_1 = require("../AppleConnector");
5
+ Object.defineProperty(exports, "AppleConnector", { enumerable: true, get: function () { return AppleConnector_1.AppleConnector; } });
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
@@ -2,7 +2,7 @@
2
2
  // #region Imports
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.GITHUB_AUTH_CONFIG_ENTRIES = void 0;
5
- const env_1 = require("../env");
5
+ const env_1 = require("../../env");
6
6
  // #endregion
7
7
  /** Configuration entries required by GitHub OAuth authentication. */
8
8
  exports.GITHUB_AUTH_CONFIG_ENTRIES = [
@@ -0,0 +1,2 @@
1
+ export { GithubConnector } from '../GithubConnector';
2
+ export { GITHUB_AUTH_CONFIG_ENTRIES } from './env';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GITHUB_AUTH_CONFIG_ENTRIES = exports.GithubConnector = void 0;
4
+ var GithubConnector_1 = require("../GithubConnector");
5
+ Object.defineProperty(exports, "GithubConnector", { enumerable: true, get: function () { return GithubConnector_1.GithubConnector; } });
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
@@ -2,7 +2,7 @@
2
2
  // #region Imports
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.GOOGLE_AUTH_CONFIG_ENTRIES = void 0;
5
- const env_1 = require("../env");
5
+ const env_1 = require("../../env");
6
6
  // #endregion
7
7
  /** Configuration entries required by Google OAuth authentication. */
8
8
  exports.GOOGLE_AUTH_CONFIG_ENTRIES = [
@@ -0,0 +1,2 @@
1
+ export { GoogleConnector } from '../GoogleConnector';
2
+ export { GOOGLE_AUTH_CONFIG_ENTRIES } from './env';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GOOGLE_AUTH_CONFIG_ENTRIES = exports.GoogleConnector = void 0;
4
+ var GoogleConnector_1 = require("../GoogleConnector");
5
+ Object.defineProperty(exports, "GoogleConnector", { enumerable: true, get: function () { return GoogleConnector_1.GoogleConnector; } });
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
@@ -2,7 +2,7 @@
2
2
  // #region Imports
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.MICROSOFT_AUTH_CONFIG_ENTRIES = void 0;
5
- const env_1 = require("../env");
5
+ const env_1 = require("../../env");
6
6
  // #endregion
7
7
  /** Configuration entries required by Microsoft OAuth authentication. */
8
8
  exports.MICROSOFT_AUTH_CONFIG_ENTRIES = [
@@ -0,0 +1,2 @@
1
+ export { MicrosoftConnector } from '../MicrosoftConnector';
2
+ export { MICROSOFT_AUTH_CONFIG_ENTRIES } from './env';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MICROSOFT_AUTH_CONFIG_ENTRIES = exports.MicrosoftConnector = void 0;
4
+ var MicrosoftConnector_1 = require("../MicrosoftConnector");
5
+ Object.defineProperty(exports, "MicrosoftConnector", { enumerable: true, get: function () { return MicrosoftConnector_1.MicrosoftConnector; } });
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
package/src/env.d.ts CHANGED
@@ -11,6 +11,8 @@ export declare const AUTH_MFA_ENCRYPTION_KEY: import("@breadstone/archipel-platf
11
11
  export declare const AUTH_MFA_CHALLENGE_EXPIRES_IN: import("@breadstone/archipel-platform-core").IConfigKey<string>;
12
12
  /** Maximum number of failed MFA attempts before lockout. */
13
13
  export declare const AUTH_MFA_MAX_ATTEMPTS: import("@breadstone/archipel-platform-core").IConfigKey<string>;
14
+ /** Issuer name shown in authenticator apps for TOTP MFA. */
15
+ export declare const AUTH_MFA_ISSUER: import("@breadstone/archipel-platform-core").IConfigKey<string>;
14
16
  /** Time-to-live for SMS OTP codes (e.g. `'10m'`). */
15
17
  export declare const AUTH_MFA_SMS_CODE_TTL: import("@breadstone/archipel-platform-core").IConfigKey<string>;
16
18
  /** Minimum interval between SMS resend requests (e.g. `'30s'`). */
package/src/env.js CHANGED
@@ -1,51 +1,35 @@
1
1
  "use strict";
2
2
  // #region Imports
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.PLATFORM_AUTHENTICATION_CONFIG_ENTRIES = exports.SEED_ANONYMOUS_USERNAME = exports.AUTH_GITHUB_SCOPE = exports.AUTH_GITHUB_CALLBACK_URL = exports.AUTH_GITHUB_CLIENT_SECRET = exports.AUTH_GITHUB_CLIENT_ID = exports.AUTH_APPLE_SCOPE = exports.AUTH_APPLE_CALLBACK_URL = exports.AUTH_APPLE_KEY_ID = exports.AUTH_APPLE_TEAM_ID = exports.AUTH_APPLE_CLIENT_ID = exports.AUTH_APPLE_PRIVATE_KEY = exports.AUTH_MICROSOFT_SCOPE = exports.AUTH_MICROSOFT_TENANT = exports.AUTH_MICROSOFT_CALLBACK_URL = exports.AUTH_MICROSOFT_CLIENT_SECRET = exports.AUTH_MICROSOFT_CLIENT_ID = exports.AUTH_GOOGLE_SCOPE = exports.AUTH_GOOGLE_CALLBACK_URL = exports.AUTH_GOOGLE_CLIENT_SECRET = exports.AUTH_GOOGLE_CLIENT_ID = exports.AUTH_MFA_PUSH_MIN_RESEND = exports.AUTH_MFA_PUSH_CODE_TTL = exports.AUTH_MFA_EMAIL_MIN_RESEND = exports.AUTH_MFA_EMAIL_CODE_TTL = exports.AUTH_MFA_SMS_MIN_RESEND = exports.AUTH_MFA_SMS_CODE_TTL = exports.AUTH_MFA_MAX_ATTEMPTS = exports.AUTH_MFA_CHALLENGE_EXPIRES_IN = exports.AUTH_MFA_ENCRYPTION_KEY = exports.AUTH_VERIFY_JWT_EXPIRES_IN = exports.AUTH_JWT_EXPIRES_IN = exports.AUTH_JWT_SECRET = void 0;
4
+ exports.PLATFORM_AUTHENTICATION_CONFIG_ENTRIES = exports.SEED_ANONYMOUS_USERNAME = exports.AUTH_GITHUB_SCOPE = exports.AUTH_GITHUB_CALLBACK_URL = exports.AUTH_GITHUB_CLIENT_SECRET = exports.AUTH_GITHUB_CLIENT_ID = exports.AUTH_APPLE_SCOPE = exports.AUTH_APPLE_CALLBACK_URL = exports.AUTH_APPLE_KEY_ID = exports.AUTH_APPLE_TEAM_ID = exports.AUTH_APPLE_CLIENT_ID = exports.AUTH_APPLE_PRIVATE_KEY = exports.AUTH_MICROSOFT_SCOPE = exports.AUTH_MICROSOFT_TENANT = exports.AUTH_MICROSOFT_CALLBACK_URL = exports.AUTH_MICROSOFT_CLIENT_SECRET = exports.AUTH_MICROSOFT_CLIENT_ID = exports.AUTH_GOOGLE_SCOPE = exports.AUTH_GOOGLE_CALLBACK_URL = exports.AUTH_GOOGLE_CLIENT_SECRET = exports.AUTH_GOOGLE_CLIENT_ID = exports.AUTH_MFA_PUSH_MIN_RESEND = exports.AUTH_MFA_PUSH_CODE_TTL = exports.AUTH_MFA_EMAIL_MIN_RESEND = exports.AUTH_MFA_EMAIL_CODE_TTL = exports.AUTH_MFA_SMS_MIN_RESEND = exports.AUTH_MFA_SMS_CODE_TTL = exports.AUTH_MFA_ISSUER = exports.AUTH_MFA_MAX_ATTEMPTS = exports.AUTH_MFA_CHALLENGE_EXPIRES_IN = exports.AUTH_MFA_ENCRYPTION_KEY = exports.AUTH_VERIFY_JWT_EXPIRES_IN = exports.AUTH_JWT_EXPIRES_IN = exports.AUTH_JWT_SECRET = void 0;
5
5
  const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
6
6
  // #endregion
7
- // ──────────────────────────────────────────────────────────────
8
- // JWT & Session
9
- // ──────────────────────────────────────────────────────────────
10
7
  /** Secret used to sign JWTs. */
11
8
  exports.AUTH_JWT_SECRET = (0, archipel_platform_core_1.createConfigKey)('AUTH_JWT_SECRET');
12
9
  /** Lifetime of access tokens (e.g. `'15m'`, `'1h'`). */
13
10
  exports.AUTH_JWT_EXPIRES_IN = (0, archipel_platform_core_1.createConfigKey)('AUTH_JWT_EXPIRES_IN');
14
11
  /** Lifetime of email-verification JWTs. */
15
12
  exports.AUTH_VERIFY_JWT_EXPIRES_IN = (0, archipel_platform_core_1.createConfigKey)('AUTH_VERIFY_JWT_EXPIRES_IN');
16
- // ──────────────────────────────────────────────────────────────
17
- // MFA — General
18
- // ──────────────────────────────────────────────────────────────
19
13
  /** AES encryption key used to encrypt MFA secrets at rest. */
20
14
  exports.AUTH_MFA_ENCRYPTION_KEY = (0, archipel_platform_core_1.createConfigKey)('AUTH_MFA_ENCRYPTION_KEY');
21
15
  /** How long an MFA challenge stays valid (e.g. `'5m'`). */
22
16
  exports.AUTH_MFA_CHALLENGE_EXPIRES_IN = (0, archipel_platform_core_1.createConfigKey)('AUTH_MFA_CHALLENGE_EXPIRES_IN');
23
17
  /** Maximum number of failed MFA attempts before lockout. */
24
18
  exports.AUTH_MFA_MAX_ATTEMPTS = (0, archipel_platform_core_1.createConfigKey)('AUTH_MFA_MAX_ATTEMPTS');
25
- // ──────────────────────────────────────────────────────────────
26
- // MFA SMS Channel
27
- // ──────────────────────────────────────────────────────────────
19
+ /** Issuer name shown in authenticator apps for TOTP MFA. */
20
+ exports.AUTH_MFA_ISSUER = (0, archipel_platform_core_1.createConfigKey)('AUTH_MFA_ISSUER');
28
21
  /** Time-to-live for SMS OTP codes (e.g. `'10m'`). */
29
22
  exports.AUTH_MFA_SMS_CODE_TTL = (0, archipel_platform_core_1.createConfigKey)('AUTH_MFA_SMS_CODE_TTL');
30
23
  /** Minimum interval between SMS resend requests (e.g. `'30s'`). */
31
24
  exports.AUTH_MFA_SMS_MIN_RESEND = (0, archipel_platform_core_1.createConfigKey)('AUTH_MFA_SMS_MIN_RESEND');
32
- // ──────────────────────────────────────────────────────────────
33
- // MFA — Email Channel
34
- // ──────────────────────────────────────────────────────────────
35
25
  /** Time-to-live for email OTP codes (e.g. `'10m'`). */
36
26
  exports.AUTH_MFA_EMAIL_CODE_TTL = (0, archipel_platform_core_1.createConfigKey)('AUTH_MFA_EMAIL_CODE_TTL');
37
27
  /** Minimum interval between email OTP resend requests (e.g. `'30s'`). */
38
28
  exports.AUTH_MFA_EMAIL_MIN_RESEND = (0, archipel_platform_core_1.createConfigKey)('AUTH_MFA_EMAIL_MIN_RESEND');
39
- // ──────────────────────────────────────────────────────────────
40
- // MFA — Push Channel
41
- // ──────────────────────────────────────────────────────────────
42
29
  /** Time-to-live for push OTP codes (e.g. `'10m'`). */
43
30
  exports.AUTH_MFA_PUSH_CODE_TTL = (0, archipel_platform_core_1.createConfigKey)('AUTH_MFA_PUSH_CODE_TTL');
44
31
  /** Minimum interval between push OTP resend requests (e.g. `'30s'`). */
45
32
  exports.AUTH_MFA_PUSH_MIN_RESEND = (0, archipel_platform_core_1.createConfigKey)('AUTH_MFA_PUSH_MIN_RESEND');
46
- // ──────────────────────────────────────────────────────────────
47
- // OAuth — Google
48
- // ──────────────────────────────────────────────────────────────
49
33
  /** Google OAuth2 client ID. */
50
34
  exports.AUTH_GOOGLE_CLIENT_ID = (0, archipel_platform_core_1.createConfigKey)('AUTH_GOOGLE_CLIENT_ID');
51
35
  /** Google OAuth2 client secret. */
@@ -54,9 +38,6 @@ exports.AUTH_GOOGLE_CLIENT_SECRET = (0, archipel_platform_core_1.createConfigKey
54
38
  exports.AUTH_GOOGLE_CALLBACK_URL = (0, archipel_platform_core_1.createConfigKey)('AUTH_GOOGLE_CALLBACK_URL');
55
39
  /** Comma-separated list of Google OAuth scopes (e.g. `'email,profile'`). */
56
40
  exports.AUTH_GOOGLE_SCOPE = (0, archipel_platform_core_1.createConfigKey)('AUTH_GOOGLE_SCOPE');
57
- // ──────────────────────────────────────────────────────────────
58
- // OAuth — Microsoft
59
- // ──────────────────────────────────────────────────────────────
60
41
  /** Microsoft OAuth2 client ID. */
61
42
  exports.AUTH_MICROSOFT_CLIENT_ID = (0, archipel_platform_core_1.createConfigKey)('AUTH_MICROSOFT_CLIENT_ID');
62
43
  /** Microsoft OAuth2 client secret. */
@@ -67,9 +48,6 @@ exports.AUTH_MICROSOFT_CALLBACK_URL = (0, archipel_platform_core_1.createConfigK
67
48
  exports.AUTH_MICROSOFT_TENANT = (0, archipel_platform_core_1.createConfigKey)('AUTH_MICROSOFT_TENANT');
68
49
  /** Comma-separated list of Microsoft OAuth scopes (e.g. `'user.read,mail.read'`). */
69
50
  exports.AUTH_MICROSOFT_SCOPE = (0, archipel_platform_core_1.createConfigKey)('AUTH_MICROSOFT_SCOPE');
70
- // ──────────────────────────────────────────────────────────────
71
- // OAuth — Apple
72
- // ──────────────────────────────────────────────────────────────
73
51
  /** Apple Sign-In private key (PEM string). */
74
52
  exports.AUTH_APPLE_PRIVATE_KEY = (0, archipel_platform_core_1.createConfigKey)('AUTH_APPLE_PRIVATE_KEY');
75
53
  /** Apple Sign-In client (service) ID. */
@@ -82,9 +60,6 @@ exports.AUTH_APPLE_KEY_ID = (0, archipel_platform_core_1.createConfigKey)('AUTH_
82
60
  exports.AUTH_APPLE_CALLBACK_URL = (0, archipel_platform_core_1.createConfigKey)('AUTH_APPLE_CALLBACK_URL');
83
61
  /** Comma-separated list of Apple Sign-In scopes (e.g. `'name,email'`). */
84
62
  exports.AUTH_APPLE_SCOPE = (0, archipel_platform_core_1.createConfigKey)('AUTH_APPLE_SCOPE');
85
- // ──────────────────────────────────────────────────────────────
86
- // OAuth — GitHub
87
- // ──────────────────────────────────────────────────────────────
88
63
  /** GitHub OAuth client ID. */
89
64
  exports.AUTH_GITHUB_CLIENT_ID = (0, archipel_platform_core_1.createConfigKey)('AUTH_GITHUB_CLIENT_ID');
90
65
  /** GitHub OAuth client secret. */
@@ -93,25 +68,30 @@ exports.AUTH_GITHUB_CLIENT_SECRET = (0, archipel_platform_core_1.createConfigKey
93
68
  exports.AUTH_GITHUB_CALLBACK_URL = (0, archipel_platform_core_1.createConfigKey)('AUTH_GITHUB_CALLBACK_URL');
94
69
  /** Comma-separated list of GitHub OAuth scopes (e.g. `'user:email,read:user'`). */
95
70
  exports.AUTH_GITHUB_SCOPE = (0, archipel_platform_core_1.createConfigKey)('AUTH_GITHUB_SCOPE');
96
- // ──────────────────────────────────────────────────────────────
97
- // Seed / Misc
98
- // ──────────────────────────────────────────────────────────────
99
71
  /** Username used for the anonymous seed user. */
100
72
  exports.SEED_ANONYMOUS_USERNAME = (0, archipel_platform_core_1.createConfigKey)('SEED_ANONYMOUS_USERNAME');
101
- // ──────────────────────────────────────────────────────────────
102
- // Registry entries
103
- // ──────────────────────────────────────────────────────────────
104
73
  /** Core configuration entries required by `platform-authentication`. */
105
74
  exports.PLATFORM_AUTHENTICATION_CONFIG_ENTRIES = [
106
75
  // JWT & Session
107
- { key: exports.AUTH_JWT_SECRET, required: true, description: 'Secret used to sign JWTs.' },
108
- { key: exports.AUTH_JWT_EXPIRES_IN, required: true, description: 'Lifetime of access tokens.' },
109
- { key: exports.AUTH_VERIFY_JWT_EXPIRES_IN, required: true, description: 'Lifetime of email-verification JWTs.' },
76
+ {
77
+ key: exports.AUTH_JWT_SECRET,
78
+ required: true,
79
+ description: 'Secret used to sign JWTs.',
80
+ },
81
+ {
82
+ key: exports.AUTH_JWT_EXPIRES_IN,
83
+ required: true,
84
+ description: 'Lifetime of access tokens.',
85
+ },
86
+ {
87
+ key: exports.AUTH_VERIFY_JWT_EXPIRES_IN,
88
+ required: true,
89
+ description: 'Lifetime of email-verification JWTs.',
90
+ },
110
91
  // MFA — General
111
92
  {
112
93
  key: exports.AUTH_MFA_ENCRYPTION_KEY,
113
- required: false,
114
- defaultValue: '',
94
+ required: true,
115
95
  description: 'AES encryption key for MFA secrets.',
116
96
  },
117
97
  {
@@ -126,8 +106,18 @@ exports.PLATFORM_AUTHENTICATION_CONFIG_ENTRIES = [
126
106
  defaultValue: '5',
127
107
  description: 'Max failed MFA attempts before lockout.',
128
108
  },
109
+ {
110
+ key: exports.AUTH_MFA_ISSUER,
111
+ required: true,
112
+ description: 'Issuer name shown in authenticator apps for TOTP MFA.',
113
+ },
129
114
  // MFA — SMS
130
- { key: exports.AUTH_MFA_SMS_CODE_TTL, required: false, defaultValue: '10m', description: 'TTL for SMS OTP codes.' },
115
+ {
116
+ key: exports.AUTH_MFA_SMS_CODE_TTL,
117
+ required: false,
118
+ defaultValue: '10m',
119
+ description: 'TTL for SMS OTP codes.',
120
+ },
131
121
  {
132
122
  key: exports.AUTH_MFA_SMS_MIN_RESEND,
133
123
  required: false,
@@ -135,7 +125,12 @@ exports.PLATFORM_AUTHENTICATION_CONFIG_ENTRIES = [
135
125
  description: 'Min interval between SMS resends.',
136
126
  },
137
127
  // MFA — Email
138
- { key: exports.AUTH_MFA_EMAIL_CODE_TTL, required: false, defaultValue: '10m', description: 'TTL for email OTP codes.' },
128
+ {
129
+ key: exports.AUTH_MFA_EMAIL_CODE_TTL,
130
+ required: false,
131
+ defaultValue: '10m',
132
+ description: 'TTL for email OTP codes.',
133
+ },
139
134
  {
140
135
  key: exports.AUTH_MFA_EMAIL_MIN_RESEND,
141
136
  required: false,
@@ -143,7 +138,12 @@ exports.PLATFORM_AUTHENTICATION_CONFIG_ENTRIES = [
143
138
  description: 'Min interval between email resends.',
144
139
  },
145
140
  // MFA — Push
146
- { key: exports.AUTH_MFA_PUSH_CODE_TTL, required: false, defaultValue: '10m', description: 'TTL for push OTP codes.' },
141
+ {
142
+ key: exports.AUTH_MFA_PUSH_CODE_TTL,
143
+ required: false,
144
+ defaultValue: '10m',
145
+ description: 'TTL for push OTP codes.',
146
+ },
147
147
  {
148
148
  key: exports.AUTH_MFA_PUSH_MIN_RESEND,
149
149
  required: false,
@@ -151,6 +151,10 @@ exports.PLATFORM_AUTHENTICATION_CONFIG_ENTRIES = [
151
151
  description: 'Min interval between push resends.',
152
152
  },
153
153
  // Seed / Misc
154
- { key: exports.SEED_ANONYMOUS_USERNAME, required: true, description: 'Username for the anonymous seed user.' },
154
+ {
155
+ key: exports.SEED_ANONYMOUS_USERNAME,
156
+ required: true,
157
+ description: 'Username for the anonymous seed user.',
158
+ },
155
159
  ];
156
160
  //# sourceMappingURL=env.js.map