@venizia/ignis 0.2.0-2 → 0.2.0-4

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 (56) hide show
  1. package/dist/base/applications/server.d.ts +1 -1
  2. package/dist/base/applications/server.d.ts.map +1 -1
  3. package/dist/base/applications/server.js +1 -1
  4. package/dist/base/applications/server.js.map +1 -1
  5. package/dist/components/api-reference/component.d.ts.map +1 -1
  6. package/dist/components/api-reference/component.js +2 -0
  7. package/dist/components/api-reference/component.js.map +1 -1
  8. package/dist/components/auth/authenticate/component.d.ts +10 -1
  9. package/dist/components/auth/authenticate/component.d.ts.map +1 -1
  10. package/dist/components/auth/authenticate/component.js +79 -25
  11. package/dist/components/auth/authenticate/component.js.map +1 -1
  12. package/dist/components/auth/authenticate/controllers/index.d.ts +1 -0
  13. package/dist/components/auth/authenticate/controllers/index.d.ts.map +1 -1
  14. package/dist/components/auth/authenticate/controllers/index.js +1 -0
  15. package/dist/components/auth/authenticate/controllers/index.js.map +1 -1
  16. package/dist/components/auth/authenticate/controllers/service-certs/controller.d.ts +10 -0
  17. package/dist/components/auth/authenticate/controllers/service-certs/controller.d.ts.map +1 -0
  18. package/dist/components/auth/authenticate/controllers/service-certs/controller.js +50 -0
  19. package/dist/components/auth/authenticate/controllers/service-certs/controller.js.map +1 -0
  20. package/dist/components/auth/authenticate/controllers/service-certs/definitions.d.ts +73 -0
  21. package/dist/components/auth/authenticate/controllers/service-certs/definitions.d.ts.map +1 -0
  22. package/dist/components/auth/authenticate/controllers/service-certs/definitions.js +34 -0
  23. package/dist/components/auth/authenticate/controllers/service-certs/definitions.js.map +1 -0
  24. package/dist/components/auth/authenticate/controllers/service-certs/index.d.ts +3 -0
  25. package/dist/components/auth/authenticate/controllers/service-certs/index.d.ts.map +1 -0
  26. package/dist/components/auth/authenticate/controllers/service-certs/index.js +19 -0
  27. package/dist/components/auth/authenticate/controllers/service-certs/index.js.map +1 -0
  28. package/dist/components/auth/authenticate/services/bearer/jwks/issuer.service.d.ts +16 -0
  29. package/dist/components/auth/authenticate/services/bearer/jwks/issuer.service.d.ts.map +1 -1
  30. package/dist/components/auth/authenticate/services/bearer/jwks/issuer.service.js +29 -0
  31. package/dist/components/auth/authenticate/services/bearer/jwks/issuer.service.js.map +1 -1
  32. package/dist/components/auth/authenticate/services/index.d.ts +1 -0
  33. package/dist/components/auth/authenticate/services/index.d.ts.map +1 -1
  34. package/dist/components/auth/authenticate/services/index.js +1 -0
  35. package/dist/components/auth/authenticate/services/index.js.map +1 -1
  36. package/dist/components/auth/authenticate/services/service/index.d.ts +3 -0
  37. package/dist/components/auth/authenticate/services/service/index.d.ts.map +1 -0
  38. package/dist/components/auth/authenticate/services/service/index.js +19 -0
  39. package/dist/components/auth/authenticate/services/service/index.js.map +1 -0
  40. package/dist/components/auth/authenticate/services/service/signer.service.d.ts +46 -0
  41. package/dist/components/auth/authenticate/services/service/signer.service.d.ts.map +1 -0
  42. package/dist/components/auth/authenticate/services/service/signer.service.js +135 -0
  43. package/dist/components/auth/authenticate/services/service/signer.service.js.map +1 -0
  44. package/dist/components/auth/authenticate/services/service/verifier.service.d.ts +40 -0
  45. package/dist/components/auth/authenticate/services/service/verifier.service.d.ts.map +1 -0
  46. package/dist/components/auth/authenticate/services/service/verifier.service.js +161 -0
  47. package/dist/components/auth/authenticate/services/service/verifier.service.js.map +1 -0
  48. package/dist/components/auth/authenticate/strategies/index.d.ts +1 -0
  49. package/dist/components/auth/authenticate/strategies/index.d.ts.map +1 -1
  50. package/dist/components/auth/authenticate/strategies/index.js +1 -0
  51. package/dist/components/auth/authenticate/strategies/index.js.map +1 -1
  52. package/dist/components/auth/authenticate/strategies/service.strategy.d.ts +19 -0
  53. package/dist/components/auth/authenticate/strategies/service.strategy.d.ts.map +1 -0
  54. package/dist/components/auth/authenticate/strategies/service.strategy.js +73 -0
  55. package/dist/components/auth/authenticate/strategies/service.strategy.js.map +1 -0
  56. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/auth/authenticate/strategies/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iGAAiG;AACjG,wDAAsC;AAEtC,mDAAiC;AACjC,iDAA+B;AAC/B,kDAAgC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/auth/authenticate/strategies/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iGAAiG;AACjG,wDAAsC;AAEtC,mDAAiC;AACjC,iDAA+B;AAC/B,kDAAgC;AAChC,qDAAmC"}
@@ -0,0 +1,19 @@
1
+ import { BaseHelper } from '@venizia/ignis-helpers/core';
2
+ import type { Env } from 'hono';
3
+ import type { IAuthUser, IAuthenticationStrategy, IServiceAuthOptions, TContext } from '@venizia/ignis-kernel';
4
+ import { ServiceAssertionVerifierService } from '../services/service/verifier.service';
5
+ /**
6
+ * Proves the CALLING SERVICE, from a per-request Ed25519 assertion verified against that caller's
7
+ * own JWKS. No identity round trip and no shared password.
8
+ *
9
+ * It proves which service called, never which user. `resolvePrincipal` is where the application
10
+ * turns a caller name into one of its own principals.
11
+ */
12
+ export declare class ServiceAuthenticationStrategy<E extends Env = Env> extends BaseHelper implements IAuthenticationStrategy<E> {
13
+ private readonly verifier;
14
+ private readonly options;
15
+ name: string;
16
+ constructor(verifier: ServiceAssertionVerifierService, options: IServiceAuthOptions<E>);
17
+ authenticate(context: TContext<E, string>): Promise<IAuthUser>;
18
+ }
19
+ //# sourceMappingURL=service.strategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.strategy.d.ts","sourceRoot":"","sources":["../../../../../src/components/auth/authenticate/strategies/service.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAY,MAAM,6BAA6B,CAAC;AAEnE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAShC,OAAO,KAAK,EACV,SAAS,EACT,uBAAuB,EACvB,mBAAmB,EACnB,QAAQ,EACT,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAEvF;;;;;;GAMG;AACH,qBAAa,6BAA6B,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG,CAC5D,SAAQ,UACR,YAAW,uBAAuB,CAAC,CAAC,CAAC;IAWnC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAEzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAX1B,IAAI,SAAmC;gBASpB,QAAQ,EAAE,+BAA+B,EAEzC,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAK5C,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;CA8BrE"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var ServiceAuthenticationStrategy_1;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ServiceAuthenticationStrategy = void 0;
17
+ const core_1 = require("@venizia/ignis-helpers/core");
18
+ const ignis_inversion_1 = require("@venizia/ignis-inversion");
19
+ const ignis_kernel_1 = require("@venizia/ignis-kernel");
20
+ const verifier_service_1 = require("../services/service/verifier.service");
21
+ /**
22
+ * Proves the CALLING SERVICE, from a per-request Ed25519 assertion verified against that caller's
23
+ * own JWKS. No identity round trip and no shared password.
24
+ *
25
+ * It proves which service called, never which user. `resolvePrincipal` is where the application
26
+ * turns a caller name into one of its own principals.
27
+ */
28
+ let ServiceAuthenticationStrategy = ServiceAuthenticationStrategy_1 = class ServiceAuthenticationStrategy extends core_1.BaseHelper {
29
+ constructor(verifier, options) {
30
+ super({ scope: ServiceAuthenticationStrategy_1.name });
31
+ this.verifier = verifier;
32
+ this.options = options;
33
+ this.name = ignis_kernel_1.Authentication.STRATEGY_SERVICE;
34
+ }
35
+ async authenticate(context) {
36
+ const token = context.req.header(ignis_kernel_1.ServiceAssertion.HEADER);
37
+ if (!token) {
38
+ throw (0, core_1.getError)({ error: ignis_kernel_1.AuthenticationErrors.ASSERTION_MISSING });
39
+ }
40
+ // The raw url, NOT `context.req.path`: Hono hands that back percent-DECODED, so a route carrying
41
+ // a space or a non-ASCII slug would never match the encoded path the caller signed.
42
+ const { issuer } = await this.verifier.verify({
43
+ token,
44
+ method: context.req.method,
45
+ path: new URL(context.req.url).pathname,
46
+ });
47
+ const principal = await this.options.resolvePrincipal({ issuer, context });
48
+ // Validated rather than trusted. `executeAnyMode` calls `setCurrentUser` unconditionally, so an
49
+ // application returning a principal without a `userId` would authenticate the request and then
50
+ // fail at the first write, far from here. `executeAllMode` already refuses it; this closes the
51
+ // gap between the two modes.
52
+ if (!principal?.userId) {
53
+ this.logger
54
+ .for(this.authenticate.name)
55
+ .warn('resolvePrincipal returned no usable principal | iss: %s', issuer);
56
+ throw (0, core_1.getError)({ error: ignis_kernel_1.AuthenticationErrors.PRINCIPAL_UNRESOLVED });
57
+ }
58
+ // Which service called is audit-relevant even when the principal is shared across callers.
59
+ return { ...principal, callerService: issuer };
60
+ }
61
+ };
62
+ exports.ServiceAuthenticationStrategy = ServiceAuthenticationStrategy;
63
+ exports.ServiceAuthenticationStrategy = ServiceAuthenticationStrategy = ServiceAuthenticationStrategy_1 = __decorate([
64
+ __param(0, (0, ignis_kernel_1.inject)({
65
+ key: ignis_inversion_1.BindingKeys.build({
66
+ namespace: ignis_kernel_1.BindingNamespaces.SERVICE,
67
+ key: verifier_service_1.ServiceAssertionVerifierService.name,
68
+ }),
69
+ })),
70
+ __param(1, (0, ignis_kernel_1.inject)({ key: ignis_kernel_1.AuthenticateBindingKeys.SERVICE_OPTIONS })),
71
+ __metadata("design:paramtypes", [verifier_service_1.ServiceAssertionVerifierService, Object])
72
+ ], ServiceAuthenticationStrategy);
73
+ //# sourceMappingURL=service.strategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.strategy.js","sourceRoot":"","sources":["../../../../../src/components/auth/authenticate/strategies/service.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAmE;AACnE,8DAAuD;AAEvD,wDAO+B;AAO/B,2EAAuF;AAEvF;;;;;;GAMG;AACH,IAAa,6BAA6B,qCAA1C,MAAa,6BACX,SAAQ,iBAAU;IAKlB,YAOE,QAA0D,EAE1D,OAAgD;QAEhD,KAAK,CAAC,EAAE,KAAK,EAAE,+BAA6B,CAAC,IAAI,EAAE,CAAC,CAAC;QAJpC,aAAQ,GAAR,QAAQ,CAAiC;QAEzC,YAAO,GAAP,OAAO,CAAwB;QAXlD,SAAI,GAAG,6BAAc,CAAC,gBAAgB,CAAC;IAcvC,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAA4B;QAC7C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,+BAAgB,CAAC,MAAM,CAAC,CAAC;QAC1D,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAA,eAAQ,EAAC,EAAE,KAAK,EAAE,mCAAoB,CAAC,iBAAiB,EAAE,CAAC,CAAC;QACpE,CAAC;QAED,iGAAiG;QACjG,oFAAoF;QACpF,MAAM,EAAE,MAAM,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  "description": "High-performance TypeScript server infrastructure combining LoopBack 4 enterprise architecture (decorator-based DI, repository pattern, component system) with Hono speed (~140k req/s). Features auto-generated OpenAPI docs, Drizzle ORM type-safe SQL, JWT/Basic authentication, Casbin authorization, convention-based bootstrapping, and pluggable components for health checks, Swagger UI, mail, Socket.IO, and static assets. Built for Bun and Node.js.",
5
5
  "keywords": [
6
6
  "access-control",
@@ -198,12 +198,12 @@
198
198
  "prepublishOnly": "bun run rebuild"
199
199
  },
200
200
  "dependencies": {
201
- "@venizia/ignis-boot": "^0.2.0-1",
202
- "@venizia/ignis-connectors": "^0.2.0-2",
201
+ "@venizia/ignis-boot": "^0.2.0-3",
202
+ "@venizia/ignis-connectors": "^0.2.0-4",
203
203
  "@venizia/ignis-filter": "^0.2.0-1",
204
- "@venizia/ignis-helpers": "^0.2.0-2",
204
+ "@venizia/ignis-helpers": "^0.2.0-4",
205
205
  "@venizia/ignis-inversion": "^0.2.0-0",
206
- "@venizia/ignis-kernel": "^0.2.0-2",
206
+ "@venizia/ignis-kernel": "^0.2.0-4",
207
207
  "lodash": "^4.18.1",
208
208
  "reflect-metadata": "^0.2.2",
209
209
  "zod": "^4.4.3"