@venizia/ignis-kernel 0.2.0-1 → 0.2.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 (87) hide show
  1. package/dist/cjs/base/auth/authenticate/common/constants.d.ts +28 -1
  2. package/dist/cjs/base/auth/authenticate/common/constants.d.ts.map +1 -1
  3. package/dist/cjs/base/auth/authenticate/common/constants.js +29 -2
  4. package/dist/cjs/base/auth/authenticate/common/constants.js.map +1 -1
  5. package/dist/cjs/base/auth/authenticate/common/errors.d.ts +40 -1
  6. package/dist/cjs/base/auth/authenticate/common/errors.d.ts.map +1 -1
  7. package/dist/cjs/base/auth/authenticate/common/errors.js +41 -1
  8. package/dist/cjs/base/auth/authenticate/common/errors.js.map +1 -1
  9. package/dist/cjs/base/auth/authenticate/common/keys.d.ts +2 -0
  10. package/dist/cjs/base/auth/authenticate/common/keys.d.ts.map +1 -1
  11. package/dist/cjs/base/auth/authenticate/common/keys.js +2 -0
  12. package/dist/cjs/base/auth/authenticate/common/keys.js.map +1 -1
  13. package/dist/cjs/base/auth/authenticate/common/types.d.ts +138 -1
  14. package/dist/cjs/base/auth/authenticate/common/types.d.ts.map +1 -1
  15. package/dist/cjs/base/auth/authenticate/strategies/strategy-registry.d.ts +37 -0
  16. package/dist/cjs/base/auth/authenticate/strategies/strategy-registry.d.ts.map +1 -1
  17. package/dist/cjs/base/auth/authenticate/strategies/strategy-registry.js +54 -0
  18. package/dist/cjs/base/auth/authenticate/strategies/strategy-registry.js.map +1 -1
  19. package/dist/cjs/base/auth/authorize/enforcers/enforcer-registry.d.ts +10 -0
  20. package/dist/cjs/base/auth/authorize/enforcers/enforcer-registry.d.ts.map +1 -1
  21. package/dist/cjs/base/auth/authorize/enforcers/enforcer-registry.js +28 -3
  22. package/dist/cjs/base/auth/authorize/enforcers/enforcer-registry.js.map +1 -1
  23. package/dist/cjs/base/auth/authorize/providers/authorization.provider.d.ts.map +1 -1
  24. package/dist/cjs/base/auth/authorize/providers/authorization.provider.js +24 -8
  25. package/dist/cjs/base/auth/authorize/providers/authorization.provider.js.map +1 -1
  26. package/dist/cjs/base/auth/base/abstract-auth-registry.d.ts +10 -0
  27. package/dist/cjs/base/auth/base/abstract-auth-registry.d.ts.map +1 -1
  28. package/dist/cjs/base/auth/base/abstract-auth-registry.js +12 -0
  29. package/dist/cjs/base/auth/base/abstract-auth-registry.js.map +1 -1
  30. package/dist/cjs/base/auth/context-variables.d.ts +7 -1
  31. package/dist/cjs/base/auth/context-variables.d.ts.map +1 -1
  32. package/dist/cjs/base/controllers/factory/controller.d.ts +1 -1
  33. package/dist/cjs/base/controllers/factory/controller.d.ts.map +1 -1
  34. package/dist/cjs/base/controllers/rest/abstract.d.ts.map +1 -1
  35. package/dist/cjs/base/controllers/rest/abstract.js +10 -0
  36. package/dist/cjs/base/controllers/rest/abstract.js.map +1 -1
  37. package/dist/cjs/base/middlewares/not-found/not-found.middleware.d.ts.map +1 -1
  38. package/dist/cjs/base/middlewares/not-found/not-found.middleware.js +4 -1
  39. package/dist/cjs/base/middlewares/not-found/not-found.middleware.js.map +1 -1
  40. package/dist/cjs/base/repositories/core/abstract.d.ts +29 -0
  41. package/dist/cjs/base/repositories/core/abstract.d.ts.map +1 -1
  42. package/dist/cjs/base/repositories/core/abstract.js +70 -0
  43. package/dist/cjs/base/repositories/core/abstract.js.map +1 -1
  44. package/dist/esm/base/auth/authenticate/common/constants.d.ts +28 -1
  45. package/dist/esm/base/auth/authenticate/common/constants.d.ts.map +1 -1
  46. package/dist/esm/base/auth/authenticate/common/constants.js +27 -1
  47. package/dist/esm/base/auth/authenticate/common/constants.js.map +1 -1
  48. package/dist/esm/base/auth/authenticate/common/errors.d.ts +40 -1
  49. package/dist/esm/base/auth/authenticate/common/errors.d.ts.map +1 -1
  50. package/dist/esm/base/auth/authenticate/common/errors.js +41 -1
  51. package/dist/esm/base/auth/authenticate/common/errors.js.map +1 -1
  52. package/dist/esm/base/auth/authenticate/common/keys.d.ts +2 -0
  53. package/dist/esm/base/auth/authenticate/common/keys.d.ts.map +1 -1
  54. package/dist/esm/base/auth/authenticate/common/keys.js +2 -0
  55. package/dist/esm/base/auth/authenticate/common/keys.js.map +1 -1
  56. package/dist/esm/base/auth/authenticate/common/types.d.ts +138 -1
  57. package/dist/esm/base/auth/authenticate/common/types.d.ts.map +1 -1
  58. package/dist/esm/base/auth/authenticate/strategies/strategy-registry.d.ts +37 -0
  59. package/dist/esm/base/auth/authenticate/strategies/strategy-registry.d.ts.map +1 -1
  60. package/dist/esm/base/auth/authenticate/strategies/strategy-registry.js +54 -0
  61. package/dist/esm/base/auth/authenticate/strategies/strategy-registry.js.map +1 -1
  62. package/dist/esm/base/auth/authorize/enforcers/enforcer-registry.d.ts +10 -0
  63. package/dist/esm/base/auth/authorize/enforcers/enforcer-registry.d.ts.map +1 -1
  64. package/dist/esm/base/auth/authorize/enforcers/enforcer-registry.js +28 -3
  65. package/dist/esm/base/auth/authorize/enforcers/enforcer-registry.js.map +1 -1
  66. package/dist/esm/base/auth/authorize/providers/authorization.provider.d.ts.map +1 -1
  67. package/dist/esm/base/auth/authorize/providers/authorization.provider.js +24 -8
  68. package/dist/esm/base/auth/authorize/providers/authorization.provider.js.map +1 -1
  69. package/dist/esm/base/auth/base/abstract-auth-registry.d.ts +10 -0
  70. package/dist/esm/base/auth/base/abstract-auth-registry.d.ts.map +1 -1
  71. package/dist/esm/base/auth/base/abstract-auth-registry.js +12 -0
  72. package/dist/esm/base/auth/base/abstract-auth-registry.js.map +1 -1
  73. package/dist/esm/base/auth/context-variables.d.ts +7 -1
  74. package/dist/esm/base/auth/context-variables.d.ts.map +1 -1
  75. package/dist/esm/base/controllers/factory/controller.d.ts +1 -1
  76. package/dist/esm/base/controllers/factory/controller.d.ts.map +1 -1
  77. package/dist/esm/base/controllers/rest/abstract.d.ts.map +1 -1
  78. package/dist/esm/base/controllers/rest/abstract.js +10 -0
  79. package/dist/esm/base/controllers/rest/abstract.js.map +1 -1
  80. package/dist/esm/base/middlewares/not-found/not-found.middleware.d.ts.map +1 -1
  81. package/dist/esm/base/middlewares/not-found/not-found.middleware.js +4 -1
  82. package/dist/esm/base/middlewares/not-found/not-found.middleware.js.map +1 -1
  83. package/dist/esm/base/repositories/core/abstract.d.ts +29 -0
  84. package/dist/esm/base/repositories/core/abstract.d.ts.map +1 -1
  85. package/dist/esm/base/repositories/core/abstract.js +71 -1
  86. package/dist/esm/base/repositories/core/abstract.js.map +1 -1
  87. package/package.json +3 -3
@@ -2,10 +2,12 @@ import type { TConstValue } from '@venizia/ignis-helpers/common';
2
2
  export declare class AuthenticateStrategy {
3
3
  static readonly BASIC = "basic";
4
4
  static readonly JWT = "jwt";
5
+ static readonly SERVICE = "service";
6
+ /** The strategies the FRAMEWORK ships. An application registers its own beyond these. */
5
7
  static readonly SCHEME_SET: Set<string>;
6
8
  static isValid(input: string): boolean;
7
9
  }
8
- export type TAuthStrategy = TConstValue<typeof AuthenticateStrategy>;
10
+ export type TAuthStrategy = TConstValue<typeof AuthenticateStrategy> | (string & {});
9
11
  export declare class JOSEStandards {
10
12
  static readonly JWS = "JWS";
11
13
  static readonly JWKS = "JWKS";
@@ -16,6 +18,7 @@ export type TJOSEStandard = TConstValue<typeof JOSEStandards>;
16
18
  export declare class Authentication {
17
19
  static readonly STRATEGY_BASIC = "basic";
18
20
  static readonly STRATEGY_JWT = "jwt";
21
+ static readonly STRATEGY_SERVICE = "service";
19
22
  static readonly TYPE_BASIC = "Basic";
20
23
  static readonly TYPE_BEARER = "Bearer";
21
24
  static readonly AUTHENTICATION_STRATEGY = "authentication.strategy";
@@ -56,4 +59,28 @@ export declare class JWKSKeyFormats {
56
59
  static isValid(input: string): boolean;
57
60
  }
58
61
  export type TJWKSKeyFormat = TConstValue<typeof JWKSKeyFormats>;
62
+ /**
63
+ * Wire-level constants of the service assertion. Fixed rather than configurable: both ends of a
64
+ * call must agree on them, and a knob here would let two services disagree silently.
65
+ */
66
+ export declare class ServiceAssertion {
67
+ /** Its own header, so the end user's token keeps `Authorization` on the same request. */
68
+ static readonly HEADER = "x-service-assertion";
69
+ /** The JWS `typ`. What stops a user token being replayed as an assertion when one JWKS serves both. */
70
+ static readonly TYP = "svc+jwt";
71
+ static readonly ALGORITHM = "EdDSA";
72
+ static readonly DEFAULT_REST_PATH = "/svc-certs";
73
+ /** How long a minted assertion stays valid. */
74
+ static readonly DEFAULT_SIGN_LIFETIME_SECONDS = 60;
75
+ /** The oldest assertion a callee accepts, measured from `iat`. Its own decision, not the caller's. */
76
+ static readonly DEFAULT_ACCEPT_MAX_AGE_SECONDS = 60;
77
+ static readonly DEFAULT_CLOCK_TOLERANCE_SECONDS = 5;
78
+ /** Resolves the accepted age for one caller: its own override, then the service default. */
79
+ static resolveAcceptMaxAge(opts: {
80
+ callerOverride?: number;
81
+ serviceDefault?: number;
82
+ }): number;
83
+ static readonly DEFAULT_JWKS_CACHE_MAX_AGE_MS: number;
84
+ static readonly DEFAULT_JWKS_COOLDOWN_MS: number;
85
+ }
59
86
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../src/base/auth/authenticate/common/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE,qBAAa,oBAAoB;IAC/B,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAW;IAChC,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS;IAE5B,MAAM,CAAC,QAAQ,CAAC,UAAU,cAAmC;IAE7D,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;CAGvC;AACD,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAErE,qBAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS;IAC5B,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAE9B,MAAM,CAA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BAAmB,CAAC,IAAI,EAAE;QAAE,cAAc,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM;IAM9F,MAAM,CAAC,QAAQ,CAAC,6BAA6B,SAAkB;IAC/D,MAAM,CAAC,QAAQ,CAAC,wBAAwB,SAAa;CACtD"}
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.JWKSKeyFormats = exports.JWKSKeyDrivers = exports.JWKSModes = exports.AuthenticationModes = exports.AuthenticationTokenTypes = exports.Authentication = exports.JOSEStandards = exports.AuthenticateStrategy = void 0;
3
+ exports.ServiceAssertion = exports.JWKSKeyFormats = exports.JWKSKeyDrivers = exports.JWKSModes = exports.AuthenticationModes = exports.AuthenticationTokenTypes = exports.Authentication = exports.JOSEStandards = exports.AuthenticateStrategy = void 0;
4
4
  class AuthenticateStrategy {
5
5
  static { this.BASIC = 'basic'; }
6
6
  static { this.JWT = 'jwt'; }
7
- static { this.SCHEME_SET = new Set([this.BASIC, this.JWT]); }
7
+ static { this.SERVICE = 'service'; }
8
+ /** The strategies the FRAMEWORK ships. An application registers its own beyond these. */
9
+ static { this.SCHEME_SET = new Set([this.BASIC, this.JWT, this.SERVICE]); }
8
10
  static isValid(input) {
9
11
  return this.SCHEME_SET.has(input);
10
12
  }
@@ -23,6 +25,7 @@ class Authentication {
23
25
  // Strategy
24
26
  static { this.STRATEGY_BASIC = AuthenticateStrategy.BASIC; }
25
27
  static { this.STRATEGY_JWT = AuthenticateStrategy.JWT; }
28
+ static { this.STRATEGY_SERVICE = AuthenticateStrategy.SERVICE; }
26
29
  // Token type
27
30
  static { this.TYPE_BASIC = 'Basic'; }
28
31
  static { this.TYPE_BEARER = 'Bearer'; }
@@ -74,4 +77,28 @@ class JWKSKeyFormats {
74
77
  }
75
78
  }
76
79
  exports.JWKSKeyFormats = JWKSKeyFormats;
80
+ /**
81
+ * Wire-level constants of the service assertion. Fixed rather than configurable: both ends of a
82
+ * call must agree on them, and a knob here would let two services disagree silently.
83
+ */
84
+ class ServiceAssertion {
85
+ /** Its own header, so the end user's token keeps `Authorization` on the same request. */
86
+ static { this.HEADER = 'x-service-assertion'; }
87
+ /** The JWS `typ`. What stops a user token being replayed as an assertion when one JWKS serves both. */
88
+ static { this.TYP = 'svc+jwt'; }
89
+ static { this.ALGORITHM = 'EdDSA'; }
90
+ static { this.DEFAULT_REST_PATH = '/svc-certs'; }
91
+ /** How long a minted assertion stays valid. */
92
+ static { this.DEFAULT_SIGN_LIFETIME_SECONDS = 60; }
93
+ /** The oldest assertion a callee accepts, measured from `iat`. Its own decision, not the caller's. */
94
+ static { this.DEFAULT_ACCEPT_MAX_AGE_SECONDS = 60; }
95
+ static { this.DEFAULT_CLOCK_TOLERANCE_SECONDS = 5; }
96
+ /** Resolves the accepted age for one caller: its own override, then the service default. */
97
+ static resolveAcceptMaxAge(opts) {
98
+ return (opts.callerOverride ?? opts.serviceDefault ?? ServiceAssertion.DEFAULT_ACCEPT_MAX_AGE_SECONDS);
99
+ }
100
+ static { this.DEFAULT_JWKS_CACHE_MAX_AGE_MS = 10 * 60 * 1000; }
101
+ static { this.DEFAULT_JWKS_COOLDOWN_MS = 30 * 1000; }
102
+ }
103
+ exports.ServiceAssertion = ServiceAssertion;
77
104
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../src/base/auth/authenticate/common/constants.ts"],"names":[],"mappings":";;;AAEA,MAAa,oBAAoB;aACf,UAAK,GAAG,OAAO,CAAC;aAChB,QAAG,GAAG,KAAK,CAAC;aAEZ,eAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAE7D,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC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,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEnE,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AARH,8BASC;AAID,MAAa,cAAc;aACT,SAAI,GAAG,MAAM,CAAC;aACd,SAAI,GAAG,MAAM,CAAC;aAEd,eAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAE7D,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AARH,wCASC;AAID,MAAa,cAAc;aACT,QAAG,GAAG,KAAK,CAAC;aACZ,QAAG,GAAG,KAAK,CAAC;aAEZ,eAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAE3D,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AARH,wCASC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../src/base/auth/authenticate/common/constants.ts"],"names":[],"mappings":";;;AAEA,MAAa,oBAAoB;aACf,UAAK,GAAG,OAAO,CAAC;aAChB,QAAG,GAAG,KAAK,CAAC;aACZ,YAAO,GAAG,SAAS,CAAC;IAEpC,yFAAyF;aACzE,eAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAE3E,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,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AC;IAEpD,4FAA4F;IAC5F,MAAM,CAAC,mBAAmB,CAAC,IAA0D;QACnF,OAAO,CACL,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc,IAAI,gBAAgB,CAAC,8BAA8B,CAC9F,CAAC;IACJ,CAAC;aAEe,kCAA6B,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;aAC/C,6BAAwB,GAAG,EAAE,GAAG,IAAI,CAAC;;AAzBvD,4CA0BC"}
@@ -82,8 +82,47 @@ export declare const AuthenticationErrors: {
82
82
  readonly statusCode: 401;
83
83
  readonly category: "auth";
84
84
  };
85
+ readonly ASSERTION_MISSING: {
86
+ readonly message: {
87
+ readonly text: "Missing service assertion";
88
+ readonly code: "core.authentication.service.assertion_missing";
89
+ };
90
+ readonly statusCode: 401;
91
+ readonly category: "auth";
92
+ };
93
+ readonly ASSERTION_INVALID: {
94
+ readonly message: {
95
+ readonly text: "Invalid service assertion";
96
+ readonly code: "core.authentication.service.assertion_invalid";
97
+ };
98
+ readonly statusCode: 401;
99
+ readonly category: "auth";
100
+ };
101
+ readonly CALLER_NOT_ALLOWED: {
102
+ readonly message: {
103
+ readonly text: "Service caller is not allowed";
104
+ readonly code: "core.authentication.service.caller_not_allowed";
105
+ };
106
+ readonly statusCode: 401;
107
+ readonly category: "auth";
108
+ };
109
+ readonly REQUEST_BINDING_MISMATCH: {
110
+ readonly message: {
111
+ readonly text: "Service assertion does not match this request";
112
+ readonly code: "core.authentication.service.request_binding_mismatch";
113
+ };
114
+ readonly statusCode: 401;
115
+ readonly category: "auth";
116
+ };
117
+ readonly PRINCIPAL_UNRESOLVED: {
118
+ readonly message: {
119
+ readonly text: "Service caller resolved to no principal";
120
+ readonly code: "core.authentication.service.principal_unresolved";
121
+ };
122
+ readonly statusCode: 401;
123
+ readonly category: "auth";
124
+ };
85
125
  };
86
- /** Registers these codes with the shared key registry so a consumer gets autocomplete on `messageCode`. Augments the `/core` subpath, not the root barrel - kernel never imports the bare package, so nothing else in this program would make the root specifier resolvable for the merge. */
87
126
  declare module '@venizia/ignis-helpers/core' {
88
127
  interface IErrorKeyRegistry extends TRegisterErrors<typeof AuthenticationErrors> {
89
128
  }
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../../src/base/auth/authenticate/common/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAIrF,kJAAkJ;AAClJ,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8B/B,iIAAiI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2C9E,CAAC;AAEtD,8RAA8R;AAC9R,OAAO,QAAQ,6BAA6B,CAAC;IAC3C,UAAU,iBAAkB,SAAQ,eAAe,CAAC,OAAO,oBAAoB,CAAC;KAAG;CACpF"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../../src/base/auth/authenticate/common/errors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGrF,kJAAkJ;AAClJ,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8B/B,iIAAiI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmF9E,CAAC;AAEtD,OAAO,QAAQ,6BAA6B,CAAC;IAC3C,UAAU,iBAAkB,SAAQ,eAAe,CAAC,OAAO,oBAAoB,CAAC;KAAG;CACpF"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AuthenticationErrors = void 0;
4
- const core_1 = require("@venizia/ignis-helpers/core");
5
4
  const common_1 = require("@venizia/ignis-helpers/common");
5
+ const core_1 = require("@venizia/ignis-helpers/core");
6
6
  /** Codes a client branches on for a failed authentication. A throw site may override `message` for detail; the code and status come from here. */
7
7
  exports.AuthenticationErrors = {
8
8
  HEADER_MISSING: {
@@ -77,5 +77,45 @@ exports.AuthenticationErrors = {
77
77
  statusCode: common_1.HTTP.ResultCodes.RS_4.Unauthorized,
78
78
  category: core_1.ErrorScopes.AUTH,
79
79
  },
80
+ ASSERTION_MISSING: {
81
+ message: {
82
+ text: 'Missing service assertion',
83
+ code: 'core.authentication.service.assertion_missing',
84
+ },
85
+ statusCode: common_1.HTTP.ResultCodes.RS_4.Unauthorized,
86
+ category: core_1.ErrorScopes.AUTH,
87
+ },
88
+ ASSERTION_INVALID: {
89
+ message: {
90
+ text: 'Invalid service assertion',
91
+ code: 'core.authentication.service.assertion_invalid',
92
+ },
93
+ statusCode: common_1.HTTP.ResultCodes.RS_4.Unauthorized,
94
+ category: core_1.ErrorScopes.AUTH,
95
+ },
96
+ CALLER_NOT_ALLOWED: {
97
+ message: {
98
+ text: 'Service caller is not allowed',
99
+ code: 'core.authentication.service.caller_not_allowed',
100
+ },
101
+ statusCode: common_1.HTTP.ResultCodes.RS_4.Unauthorized,
102
+ category: core_1.ErrorScopes.AUTH,
103
+ },
104
+ REQUEST_BINDING_MISMATCH: {
105
+ message: {
106
+ text: 'Service assertion does not match this request',
107
+ code: 'core.authentication.service.request_binding_mismatch',
108
+ },
109
+ statusCode: common_1.HTTP.ResultCodes.RS_4.Unauthorized,
110
+ category: core_1.ErrorScopes.AUTH,
111
+ },
112
+ PRINCIPAL_UNRESOLVED: {
113
+ message: {
114
+ text: 'Service caller resolved to no principal',
115
+ code: 'core.authentication.service.principal_unresolved',
116
+ },
117
+ statusCode: common_1.HTTP.ResultCodes.RS_4.Unauthorized,
118
+ category: core_1.ErrorScopes.AUTH,
119
+ },
80
120
  };
81
121
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../../../src/base/auth/authen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B,EAAE;QACxB,OAAO,EAAE;YACP,IAAI,EAAE,+CAA+C;YACrD,IAAI,EAAE,sDAAsD;SAC7D;QACD,UAAU,EAAE,aAAI,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY;QAC9C,QAAQ,EAAE,kBAAW,CAAC,IAAI;KAC3B;IACD,oBAAoB,EAAE;QACpB,OAAO,EAAE;YACP,IAAI,EAAE,yCAAyC;YAC/C,IAAI,EAAE,kDAAkD;SACzD;QACD,UAAU,EAAE,aAAI,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY;QAC9C,QAAQ,EAAE,kBAAW,CAAC,IAAI;KAC3B;CACkD,CAAC"}
@@ -3,5 +3,7 @@ export declare class AuthenticateBindingKeys {
3
3
  static readonly JWT_OPTIONS = "@app/authenticate/jwt-options";
4
4
  static readonly JWKS_OPTIONS = "@app/authenticate/jwks-options";
5
5
  static readonly BASIC_OPTIONS = "@app/authenticate/basic-options";
6
+ static readonly SERVICE_OPTIONS = "@app/authenticate/service-options";
7
+ static readonly SERVICE_CERTS_PATH = "@app/authenticate/service-certs-path";
6
8
  }
7
9
  //# sourceMappingURL=keys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../../../../src/base/auth/authenticate/common/keys.ts"],"names":[],"mappings":"AAAA,qBAAa,uBAAuB;IAClC,MAAM,CAAC,QAAQ,CAAC,YAAY,oCAAoC;IAChE,MAAM,CAAC,QAAQ,CAAC,WAAW,mCAAmC;IAC9D,MAAM,CAAC,QAAQ,CAAC,YAAY,oCAAoC;IAChE,MAAM,CAAC,QAAQ,CAAC,aAAa,qCAAqC;CACnE"}
1
+ {"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../../../../src/base/auth/authenticate/common/keys.ts"],"names":[],"mappings":"AAAA,qBAAa,uBAAuB;IAClC,MAAM,CAAC,QAAQ,CAAC,YAAY,oCAAoC;IAChE,MAAM,CAAC,QAAQ,CAAC,WAAW,mCAAmC;IAC9D,MAAM,CAAC,QAAQ,CAAC,YAAY,oCAAoC;IAChE,MAAM,CAAC,QAAQ,CAAC,aAAa,qCAAqC;IAClE,MAAM,CAAC,QAAQ,CAAC,eAAe,uCAAuC;IACtE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,0CAA0C;CAC7E"}
@@ -6,6 +6,8 @@ class AuthenticateBindingKeys {
6
6
  static { this.JWT_OPTIONS = '@app/authenticate/jwt-options'; }
7
7
  static { this.JWKS_OPTIONS = '@app/authenticate/jwks-options'; }
8
8
  static { this.BASIC_OPTIONS = '@app/authenticate/basic-options'; }
9
+ static { this.SERVICE_OPTIONS = '@app/authenticate/service-options'; }
10
+ static { this.SERVICE_CERTS_PATH = '@app/authenticate/service-certs-path'; }
9
11
  }
10
12
  exports.AuthenticateBindingKeys = AuthenticateBindingKeys;
11
13
  //# sourceMappingURL=keys.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../../../../src/base/auth/authenticate/common/keys.ts"],"names":[],"mappings":";;;AAAA,MAAa,uBAAuB;aAClB,iBAAY,GAAG,gCAAgC,CAAC;aAChD,gBAAW,GAAG,+BAA+B,CAAC;aAC9C,iBAAY,GAAG,gCAAgC,CAAC;aAChD,kBAAa,GAAG,iCAAiC,CAAC;;AAJpE,0DAKC"}
1
+ {"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../../../../src/base/auth/authenticate/common/keys.ts"],"names":[],"mappings":";;;AAAA,MAAa,uBAAuB;aAClB,iBAAY,GAAG,gCAAgC,CAAC;aAChD,gBAAW,GAAG,+BAA+B,CAAC;aAC9C,iBAAY,GAAG,gCAAgC,CAAC;aAChD,kBAAa,GAAG,iCAAiC,CAAC;aAClD,oBAAe,GAAG,mCAAmC,CAAC;aACtD,uBAAkB,GAAG,sCAAsC,CAAC;;AAN9E,0DAOC"}
@@ -1,7 +1,7 @@
1
1
  import type { TContext } from '../../../../base/controllers/common/types';
2
2
  import type { IdType } from '../../../../base/models/common/types';
3
3
  import type { TAnyObjectSchema } from '../../../../utilities/schema.utility';
4
- import type { AnyObject, ValueOrPromise } from '@venizia/ignis-helpers/common';
4
+ import type { AnyObject, TNullable, ValueOrPromise } from '@venizia/ignis-helpers/common';
5
5
  import type { AESAlgorithmType, IPayloadCipher } from '@venizia/ignis-helpers/core';
6
6
  import type { Env } from 'hono';
7
7
  import { type MiddlewareHandler } from 'hono';
@@ -56,6 +56,53 @@ export type TAuthenticationRestOptions = {} & ({
56
56
  useAuthController: true;
57
57
  controllerOpts: TDefineAuthControllerOpts;
58
58
  });
59
+ /**
60
+ * Claim checks applied when VERIFYING a JWT. Field names and types mirror jose's `JWTVerifyOptions`
61
+ * exactly, so this is a pass-through with no translation layer.
62
+ *
63
+ * Every field is optional and unset by default, which is today's behaviour: nothing is checked
64
+ * beyond the signature and the time claims. In a fleet where every verifier points at the same
65
+ * issuer JWKS, that means a token minted for one service is accepted verbatim by every other -
66
+ * `audience` is what makes "this token was meant for me" a cryptographic statement rather than a
67
+ * convention.
68
+ */
69
+ export interface IJWTVerifyOptions {
70
+ /** Expected `aud`. Setting it makes the claim required. Matching is jose's OVERLAP semantics, not equality: a token carrying `['a','b']` satisfies `audience: 'a'`. Enforce single-valued audiences at issue time if that matters. */
71
+ audience?: string | string[];
72
+ /** Expected `iss`. Setting it makes the claim required. */
73
+ issuer?: string | string[];
74
+ /** Expected `sub`. Setting it makes the claim required. */
75
+ subject?: string;
76
+ /** Clock skew tolerance: seconds, or a jose duration string such as `'30 seconds'`. */
77
+ clockTolerance?: string | number;
78
+ /** Accepted JWS `alg` header values. Unset means the accepted algorithm is decided entirely by what the JWKS serves. */
79
+ algorithms?: string[];
80
+ /** Caps elapsed time since `iat`. The real replay window for a short-lived assertion, independent of whatever `exp` the caller chose to stamp. */
81
+ maxTokenAge?: string | number;
82
+ /** Expected JWS `typ` header. The standard defence against cross-token-type confusion when one JWKS serves more than one kind of token. */
83
+ typ?: string;
84
+ /** Claims that must be present, beyond those implied by the checks above. */
85
+ requiredClaims?: string[];
86
+ }
87
+ /** Default `iss` / `aud` stamped on every issued token. Configured values are AUTHORITATIVE - see {@link IJWTIssueClaims}. */
88
+ export interface IJWTSignOptions {
89
+ issuer?: string;
90
+ audience?: string | string[];
91
+ }
92
+ /**
93
+ * Per-token registered claims, passed to `generate()`.
94
+ *
95
+ * This is the supported way to vary `aud` or `sub` per token. Putting them on the payload used to
96
+ * work by accident - `iss`, `aud`, `sub` and `jti` ride through the AES envelope in the clear
97
+ * because they are standard JWT fields - but a claim the payload can set is a claim any caller who
98
+ * shapes the payload can forge. These win over {@link IJWTSignOptions}; the payload never does.
99
+ */
100
+ export interface IJWTIssueClaims {
101
+ issuer?: string;
102
+ audience?: string | string[];
103
+ subject?: string;
104
+ jwtId?: string;
105
+ }
59
106
  export interface IJWSTokenServiceOptions {
60
107
  headerAlgorithm?: string;
61
108
  jwtSecret: string;
@@ -65,6 +112,10 @@ export interface IJWSTokenServiceOptions {
65
112
  fieldCodecs?: IPayloadFieldCodec[];
66
113
  /** Overrides the payload cipher - pass `LegacyAES` to keep reading tokens issued before the PBKDF2 envelope. */
67
114
  cipher?: IPayloadCipher;
115
+ /** Claim checks applied on verify. Unset means signature and time claims only. */
116
+ verify?: IJWTVerifyOptions;
117
+ /** Claims stamped on every issued token. A configured value WINS over one supplied in the payload. */
118
+ sign?: IJWTSignOptions;
68
119
  }
69
120
  export type TJWKSAlgorithm = 'ES256' | 'RS256' | 'EdDSA';
70
121
  export interface IJWKSIssuerOptions {
@@ -86,6 +137,10 @@ export interface IJWKSIssuerOptions {
86
137
  fieldCodecs?: IPayloadFieldCodec[];
87
138
  /** Overrides the payload cipher - pass `LegacyAES` to keep reading tokens issued before the PBKDF2 envelope. */
88
139
  cipher?: IPayloadCipher;
140
+ /** Claim checks applied on verify. Unset means signature and time claims only. */
141
+ verify?: IJWTVerifyOptions;
142
+ /** Claims stamped on every issued token. A configured value WINS over one supplied in the payload. */
143
+ sign?: IJWTSignOptions;
89
144
  }
90
145
  export interface IJWKSVerifierOptions {
91
146
  mode: typeof JWKSModes.VERIFIER;
@@ -97,6 +152,8 @@ export interface IJWKSVerifierOptions {
97
152
  fieldCodecs?: IPayloadFieldCodec[];
98
153
  /** Overrides the payload cipher - pass `LegacyAES` to keep reading tokens issued before the PBKDF2 envelope. */
99
154
  cipher?: IPayloadCipher;
155
+ /** Claim checks applied on verify. Unset means signature and time claims only. */
156
+ verify?: IJWTVerifyOptions;
100
157
  }
101
158
  export type TJWKSTokenServiceOptions = IJWKSIssuerOptions | IJWKSVerifierOptions;
102
159
  export type TJWTTokenServiceOptions = {
@@ -106,6 +163,85 @@ export type TJWTTokenServiceOptions = {
106
163
  standard: typeof JOSEStandards.JWKS;
107
164
  options: TJWKSTokenServiceOptions;
108
165
  };
166
+ /**
167
+ * The request binding, following RFC 9449's `htm`/`htu`. A captured assertion cannot be replayed
168
+ * against a different method or path.
169
+ *
170
+ * `htu` is the percent-ENCODED pathname on both ends. Compare it against
171
+ * `new URL(context.req.url).pathname`, never `context.req.path` - Hono hands that one back DECODED,
172
+ * so any route carrying a space or a non-ASCII slug would never match what the caller signed.
173
+ */
174
+ export interface IServiceAssertionClaims extends JWTPayload {
175
+ htm: string;
176
+ htu: string;
177
+ }
178
+ /**
179
+ * One entry in the caller allowlist: the JWKS url, or that url plus settings for this caller alone.
180
+ */
181
+ export type TServiceCallerEntry = string | {
182
+ jwksUrl: string;
183
+ /** Widens the accepted age for THIS caller only. Falls back to the service-wide setting. */
184
+ acceptMaxAgeSeconds?: number;
185
+ };
186
+ /** Service-to-service authentication: an Ed25519 assertion per request, verified against the caller's JWKS. */
187
+ export interface IServiceAuthOptions<E extends Env = Env> {
188
+ /** What this service calls itself: the `iss` it stamps, and the `aud` it demands. */
189
+ name: string;
190
+ /**
191
+ * Present only on a service that CALLS OUT. Absent means verify-only, and no certs route is
192
+ * mounted - which is the common case, since most services are called and never call.
193
+ */
194
+ keys?: {
195
+ driver: TJWKSKeyDriver;
196
+ format: TJWKSKeyFormat;
197
+ /** PEM or JWK by `format`; content for the `text` driver, a path for `file`. */
198
+ private: string;
199
+ public: string;
200
+ kid?: string;
201
+ };
202
+ /**
203
+ * Caller name to its JWKS url. THIS IS ALSO THE ALLOWLIST - a name absent from the map cannot
204
+ * call, and an empty map correctly allows nobody.
205
+ *
206
+ * The bare-string form is the common case. The object form exists to widen the accepted age for
207
+ * ONE caller: a nightly batch may legitimately need more slack than an interactive service, and
208
+ * granting it per caller keeps the concession named and visible in config.
209
+ */
210
+ callers?: Record<string, TServiceCallerEntry>;
211
+ /** Where the certs route is mounted. Defaults to `ServiceAssertion.DEFAULT_REST_PATH`. */
212
+ rest?: {
213
+ path: string;
214
+ };
215
+ /**
216
+ * How long the assertions this service MINTS stay valid. Only meaningful where `keys` is set.
217
+ */
218
+ signLifetimeSeconds?: number;
219
+ /**
220
+ * The oldest assertion this service ACCEPTS, measured from `iat`.
221
+ *
222
+ * Deliberately separate from `signLifetimeSeconds`, and deliberately not requestable by the
223
+ * caller. The caller already controls `exp` - it signs the token - so this is the only bound that
224
+ * survives a compromised caller. A per-caller override belongs in {@link callers}, never in the
225
+ * assertion.
226
+ *
227
+ * Composes with `clockToleranceSeconds`: the real acceptance window is the sum of the two.
228
+ */
229
+ acceptMaxAgeSeconds?: number;
230
+ clockToleranceSeconds?: number;
231
+ jwks?: {
232
+ cacheMaxAgeMs?: number;
233
+ cooldownMs?: number;
234
+ };
235
+ /**
236
+ * WHO a verified assertion acts as. The framework has already proven the caller; this only maps a
237
+ * caller name onto an application principal. Return `null` to refuse a caller the allowlist
238
+ * admits but the application does not recognise.
239
+ */
240
+ resolvePrincipal: (opts: {
241
+ issuer: string;
242
+ context: TContext<E, string>;
243
+ }) => ValueOrPromise<TNullable<IAuthUser>>;
244
+ }
109
245
  export type TBasicTokenServiceOptions<E extends Env = Env> = {
110
246
  /** Callback to verify basic auth credentials. Returns IAuthUser if valid, null otherwise. */
111
247
  verifyCredentials: (opts: {
@@ -120,6 +256,7 @@ export interface IAuthenticateOptions {
120
256
  restOptions?: TAuthenticationRestOptions;
121
257
  jwtOptions?: TJWTTokenServiceOptions;
122
258
  basicOptions?: TBasicTokenServiceOptions;
259
+ serviceOptions?: IServiceAuthOptions;
123
260
  }
124
261
  export interface IAuthUser {
125
262
  userId: IdType;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/base/auth/authenticate/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACpG,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAEvF,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE;YACP,OAAO,EAAE;gBAAE,MAAM,EAAE,gBAAgB,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,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,YAAY,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD"}
@@ -17,5 +17,42 @@ export declare class AuthenticationStrategyRegistry extends AbstractAuthRegistry
17
17
  resolveStrategy(opts: {
18
18
  name: string;
19
19
  }): IAuthenticationStrategy;
20
+ /**
21
+ * The names on this list that no registered strategy answers to.
22
+ *
23
+ * An EMPTY list yields nothing - it is the framework's own encoding of
24
+ * `authenticate: { skip: true }`, so treating it as a problem would flag every public route.
25
+ *
26
+ * Nothing is reported while the registry is empty. Route configs are built during
27
+ * `registerControllers()`, after `preConfigure()` and `registerComponents()`, so a real
28
+ * application has registered by then; an empty registry means this is running outside that
29
+ * lifecycle - a unit test on a controller - where no name could resolve either way.
30
+ */
31
+ findUnregistered(opts: {
32
+ names: string[];
33
+ }): string[];
34
+ /**
35
+ * Refuses to continue past an unregistered name. For an APPLICATION's own startup check.
36
+ *
37
+ * The framework does NOT call this - it reports instead. A hard failure cannot be the default
38
+ * here: a route listing several strategies in ANY mode tolerates one that does not resolve, and
39
+ * `defineAuthController` hard-codes `'jwt'` on four of its routes, so an application that
40
+ * registers its JWT strategy under a different name works today and would stop booting.
41
+ */
42
+ assertRegistered(opts: {
43
+ names: string[];
44
+ scope?: string;
45
+ }): void;
46
+ /**
47
+ * Names an unregistered strategy at boot, at a level someone sees. Never throws.
48
+ *
49
+ * This is what replaces the guard the open `TAuthStrategy` gave up: `resolveStrategy` throws at
50
+ * request time, the provider's ANY mode swallows it at DEBUG, and the route 401s with nothing to
51
+ * explain why.
52
+ */
53
+ reportUnregistered(opts: {
54
+ names: string[];
55
+ scope?: string;
56
+ }): void;
20
57
  }
21
58
  //# sourceMappingURL=strategy-registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"strategy-registry.d.ts","sourceRoot":"","sources":["../../../../../../src/base/auth/authenticate/strategies/strategy-registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAGzD,qBAAa,8BAA+B,SAAQ,oBAAoB,CAAC,uBAAuB,CAAC;IAC/F,MAAM,CAAC,QAAQ,CAAC,kBAAkB,sCAAsC;;IAMxE,MAAM,CAAC,WAAW;IAOlB,SAAS,CAAC,gBAAgB,IAAI,MAAM;IAIpC,QAAQ,CAAC,IAAI,EAAE;QACb,SAAS,EAAE,SAAS,CAAC;QACrB,UAAU,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAC,uBAAuB,CAAC,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KAC3E;IAUD,eAAe,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,uBAAuB;CAGjE"}
1
+ {"version":3,"file":"strategy-registry.d.ts","sourceRoot":"","sources":["../../../../../../src/base/auth/authenticate/strategies/strategy-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAGzD,qBAAa,8BAA+B,SAAQ,oBAAoB,CAAC,uBAAuB,CAAC;IAC/F,MAAM,CAAC,QAAQ,CAAC,kBAAkB,sCAAsC;;IAMxE,MAAM,CAAC,WAAW;IAOlB,SAAS,CAAC,gBAAgB,IAAI,MAAM;IAIpC,QAAQ,CAAC,IAAI,EAAE;QACb,SAAS,EAAE,SAAS,CAAC;QACrB,UAAU,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAC,uBAAuB,CAAC,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KAC3E;IAUD,eAAe,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,uBAAuB;IAIhE;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,MAAM,EAAE;IAUrD;;;;;;;OAOG;IACH,gBAAgB,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAajE;;;;;;OAMG;IACH,kBAAkB,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;CAiBpE"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AuthenticationStrategyRegistry = void 0;
4
4
  const singleton_realm_1 = require("../../../../helpers/singleton-realm");
5
+ const core_1 = require("@venizia/ignis-helpers/core");
5
6
  const base_1 = require("../../base");
6
7
  const common_1 = require("../common");
7
8
  class AuthenticationStrategyRegistry extends base_1.AbstractAuthRegistry {
@@ -28,6 +29,59 @@ class AuthenticationStrategyRegistry extends base_1.AbstractAuthRegistry {
28
29
  resolveStrategy(opts) {
29
30
  return this.resolveDescriptor(opts);
30
31
  }
32
+ /**
33
+ * The names on this list that no registered strategy answers to.
34
+ *
35
+ * An EMPTY list yields nothing - it is the framework's own encoding of
36
+ * `authenticate: { skip: true }`, so treating it as a problem would flag every public route.
37
+ *
38
+ * Nothing is reported while the registry is empty. Route configs are built during
39
+ * `registerControllers()`, after `preConfigure()` and `registerComponents()`, so a real
40
+ * application has registered by then; an empty registry means this is running outside that
41
+ * lifecycle - a unit test on a controller - where no name could resolve either way.
42
+ */
43
+ findUnregistered(opts) {
44
+ const { names } = opts;
45
+ if (names.length === 0 || this.descriptors.size === 0) {
46
+ return [];
47
+ }
48
+ return names.filter(name => !this.has({ name }));
49
+ }
50
+ /**
51
+ * Refuses to continue past an unregistered name. For an APPLICATION's own startup check.
52
+ *
53
+ * The framework does NOT call this - it reports instead. A hard failure cannot be the default
54
+ * here: a route listing several strategies in ANY mode tolerates one that does not resolve, and
55
+ * `defineAuthController` hard-codes `'jwt'` on four of its routes, so an application that
56
+ * registers its JWT strategy under a different name works today and would stop booting.
57
+ */
58
+ assertRegistered(opts) {
59
+ const { names, scope = 'route' } = opts;
60
+ const unregistered = this.findUnregistered({ names });
61
+ if (unregistered.length === 0) {
62
+ return;
63
+ }
64
+ throw (0, core_1.getError)({
65
+ message: `[${scope}] Unknown authentication strategy | unregistered: ${unregistered.join(', ')} | registered: ${this.getNames().join(', ')} | register it with AuthenticationStrategyRegistry.register() before controllers are bound`,
66
+ });
67
+ }
68
+ /**
69
+ * Names an unregistered strategy at boot, at a level someone sees. Never throws.
70
+ *
71
+ * This is what replaces the guard the open `TAuthStrategy` gave up: `resolveStrategy` throws at
72
+ * request time, the provider's ANY mode swallows it at DEBUG, and the route 401s with nothing to
73
+ * explain why.
74
+ */
75
+ reportUnregistered(opts) {
76
+ const { names, scope = 'route' } = opts;
77
+ const unregistered = this.findUnregistered({ names });
78
+ if (unregistered.length === 0) {
79
+ return;
80
+ }
81
+ this.logger
82
+ .for(this.reportUnregistered.name)
83
+ .error('[%s] Unknown authentication strategy - requests relying on it cannot authenticate | unregistered: %s | registered: %s', scope, unregistered.join(', '), this.getNames().join(', '));
84
+ }
31
85
  }
32
86
  exports.AuthenticationStrategyRegistry = AuthenticationStrategyRegistry;
33
87
  //# sourceMappingURL=strategy-registry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"strategy-registry.js","sourceRoot":"","sources":["../../../../../../src/base/auth/authenticate/strategies/strategy-registry.ts"],"names":[],"mappings":";;;AAAA,+DAA2D;AAG3D,qCAAkD;AAElD,sCAA2C;AAE3C,MAAa,8BAA+B,SAAQ,2BAA6C;aAC/E,uBAAkB,GAAG,kCAAkC,CAAC;IAExE;QACE,KAAK,CAAC,EAAE,KAAK,EAAE,8BAA8B,CAAC,IAAI,EAAE,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,CAAC,WAAW;QAChB,OAAO,gCAAc,CAAC,OAAO,CAAC;YAC5B,GAAG,EAAE,8BAA8B,CAAC,kBAAkB;YACtD,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,8BAA8B,EAAE;SACnD,CAAC,CAAC;IACL,CAAC;IAES,gBAAgB;QACxB,OAAO,uBAAc,CAAC,uBAAuB,CAAC;IAChD,CAAC;IAED,QAAQ,CAAC,IAGR;QACC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;QAEvC,KAAK,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,UAAU,EAAE,CAAC;YAC5C,IAAI,CAAC,kBAAkB,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QACjE,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,eAAe,CAAC,IAAsB;QACpC,OAAO,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;;AAjCH,wEAkCC"}
1
+ {"version":3,"file":"strategy-registry.js","sourceRoot":"","sources":["../../../../../../src/base/auth/authenticate/strategies/strategy-registry.ts"],"names":[],"mappings":";;;AACA,+DAA2D;AAE3D,sDAAuD;AACvD,qCAAkD;AAElD,sCAA2C;AAE3C,MAAa,8BAA+B,SAAQ,2BAA6C;aAC/E,uBAAkB,GAAG,kCAAkC,CAAC;IAExE;QACE,KAAK,CAAC,EAAE,KAAK,EAAE,8BAA8B,CAAC,IAAI,EAAE,CAAC,CAAC;IACxD,CAAC;IAED,MA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