@venizia/ignis-atlas 0.1.0-1
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.
- package/LICENSE.md +104 -0
- package/README.md +144 -0
- package/dist/cjs/cli/modes.d.ts +29 -0
- package/dist/cjs/cli/modes.d.ts.map +1 -0
- package/dist/cjs/cli/modes.js +70 -0
- package/dist/cjs/cli/modes.js.map +1 -0
- package/dist/cjs/cli.d.ts +3 -0
- package/dist/cjs/cli.d.ts.map +1 -0
- package/dist/cjs/cli.js +60 -0
- package/dist/cjs/cli.js.map +1 -0
- package/dist/cjs/common/constants.d.ts +22 -0
- package/dist/cjs/common/constants.d.ts.map +1 -0
- package/dist/cjs/common/constants.js +32 -0
- package/dist/cjs/common/constants.js.map +1 -0
- package/dist/cjs/common/index.d.ts +3 -0
- package/dist/cjs/common/index.d.ts.map +1 -0
- package/dist/cjs/common/index.js +19 -0
- package/dist/cjs/common/index.js.map +1 -0
- package/dist/cjs/common/logger.d.ts +21 -0
- package/dist/cjs/common/logger.d.ts.map +1 -0
- package/dist/cjs/common/logger.js +50 -0
- package/dist/cjs/common/logger.js.map +1 -0
- package/dist/cjs/common/types.d.ts +5 -0
- package/dist/cjs/common/types.d.ts.map +1 -0
- package/dist/cjs/common/types.js +3 -0
- package/dist/cjs/common/types.js.map +1 -0
- package/dist/cjs/corpus/chunker.d.ts +12 -0
- package/dist/cjs/corpus/chunker.d.ts.map +1 -0
- package/dist/cjs/corpus/chunker.js +298 -0
- package/dist/cjs/corpus/chunker.js.map +1 -0
- package/dist/cjs/corpus/common/index.d.ts +2 -0
- package/dist/cjs/corpus/common/index.d.ts.map +1 -0
- package/dist/cjs/corpus/common/index.js +18 -0
- package/dist/cjs/corpus/common/index.js.map +1 -0
- package/dist/cjs/corpus/common/types.d.ts +37 -0
- package/dist/cjs/corpus/common/types.d.ts.map +1 -0
- package/dist/cjs/corpus/common/types.js +3 -0
- package/dist/cjs/corpus/common/types.js.map +1 -0
- package/dist/cjs/corpus/frontmatter.d.ts +13 -0
- package/dist/cjs/corpus/frontmatter.d.ts.map +1 -0
- package/dist/cjs/corpus/frontmatter.js +31 -0
- package/dist/cjs/corpus/frontmatter.js.map +1 -0
- package/dist/cjs/corpus/index.d.ts +6 -0
- package/dist/cjs/corpus/index.d.ts.map +1 -0
- package/dist/cjs/corpus/index.js +22 -0
- package/dist/cjs/corpus/index.js.map +1 -0
- package/dist/cjs/corpus/loader.d.ts +16 -0
- package/dist/cjs/corpus/loader.d.ts.map +1 -0
- package/dist/cjs/corpus/loader.js +72 -0
- package/dist/cjs/corpus/loader.js.map +1 -0
- package/dist/cjs/corpus/roots.d.ts +9 -0
- package/dist/cjs/corpus/roots.d.ts.map +1 -0
- package/dist/cjs/corpus/roots.js +30 -0
- package/dist/cjs/corpus/roots.js.map +1 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +18 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/protocol/common/constants.d.ts +9 -0
- package/dist/cjs/protocol/common/constants.d.ts.map +1 -0
- package/dist/cjs/protocol/common/constants.js +13 -0
- package/dist/cjs/protocol/common/constants.js.map +1 -0
- package/dist/cjs/protocol/common/index.d.ts +4 -0
- package/dist/cjs/protocol/common/index.d.ts.map +1 -0
- package/dist/cjs/protocol/common/index.js +20 -0
- package/dist/cjs/protocol/common/index.js.map +1 -0
- package/dist/cjs/protocol/common/rpc-error.d.ts +9 -0
- package/dist/cjs/protocol/common/rpc-error.d.ts.map +1 -0
- package/dist/cjs/protocol/common/rpc-error.js +12 -0
- package/dist/cjs/protocol/common/rpc-error.js.map +1 -0
- package/dist/cjs/protocol/common/types.d.ts +32 -0
- package/dist/cjs/protocol/common/types.d.ts.map +1 -0
- package/dist/cjs/protocol/common/types.js +3 -0
- package/dist/cjs/protocol/common/types.js.map +1 -0
- package/dist/cjs/protocol/index.d.ts +3 -0
- package/dist/cjs/protocol/index.d.ts.map +1 -0
- package/dist/cjs/protocol/index.js +19 -0
- package/dist/cjs/protocol/index.js.map +1 -0
- package/dist/cjs/protocol/transport.d.ts +28 -0
- package/dist/cjs/protocol/transport.d.ts.map +1 -0
- package/dist/cjs/protocol/transport.js +155 -0
- package/dist/cjs/protocol/transport.js.map +1 -0
- package/dist/cjs/search/common/constants.d.ts +23 -0
- package/dist/cjs/search/common/constants.d.ts.map +1 -0
- package/dist/cjs/search/common/constants.js +56 -0
- package/dist/cjs/search/common/constants.js.map +1 -0
- package/dist/cjs/search/common/index.d.ts +3 -0
- package/dist/cjs/search/common/index.d.ts.map +1 -0
- package/dist/cjs/search/common/index.js +19 -0
- package/dist/cjs/search/common/index.js.map +1 -0
- package/dist/cjs/search/common/types.d.ts +18 -0
- package/dist/cjs/search/common/types.d.ts.map +1 -0
- package/dist/cjs/search/common/types.js +3 -0
- package/dist/cjs/search/common/types.js.map +1 -0
- package/dist/cjs/search/index.d.ts +4 -0
- package/dist/cjs/search/index.d.ts.map +1 -0
- package/dist/cjs/search/index.js +20 -0
- package/dist/cjs/search/index.js.map +1 -0
- package/dist/cjs/search/planner.d.ts +13 -0
- package/dist/cjs/search/planner.d.ts.map +1 -0
- package/dist/cjs/search/planner.js +58 -0
- package/dist/cjs/search/planner.js.map +1 -0
- package/dist/cjs/search/store.d.ts +37 -0
- package/dist/cjs/search/store.d.ts.map +1 -0
- package/dist/cjs/search/store.js +141 -0
- package/dist/cjs/search/store.js.map +1 -0
- package/dist/cjs/server/freshness.d.ts +40 -0
- package/dist/cjs/server/freshness.d.ts.map +1 -0
- package/dist/cjs/server/freshness.js +85 -0
- package/dist/cjs/server/freshness.js.map +1 -0
- package/dist/cjs/server.d.ts +12 -0
- package/dist/cjs/server.d.ts.map +1 -0
- package/dist/cjs/server.js +65 -0
- package/dist/cjs/server.js.map +1 -0
- package/dist/cjs/tools/common/index.d.ts +2 -0
- package/dist/cjs/tools/common/index.d.ts.map +1 -0
- package/dist/cjs/tools/common/index.js +18 -0
- package/dist/cjs/tools/common/index.js.map +1 -0
- package/dist/cjs/tools/common/schemas.d.ts +23 -0
- package/dist/cjs/tools/common/schemas.d.ts.map +1 -0
- package/dist/cjs/tools/common/schemas.js +37 -0
- package/dist/cjs/tools/common/schemas.js.map +1 -0
- package/dist/cjs/tools/get.tool.d.ts +6 -0
- package/dist/cjs/tools/get.tool.d.ts.map +1 -0
- package/dist/cjs/tools/get.tool.js +115 -0
- package/dist/cjs/tools/get.tool.js.map +1 -0
- package/dist/cjs/tools/index.d.ts +4 -0
- package/dist/cjs/tools/index.d.ts.map +1 -0
- package/dist/cjs/tools/index.js +20 -0
- package/dist/cjs/tools/index.js.map +1 -0
- package/dist/cjs/tools/search.tool.d.ts +6 -0
- package/dist/cjs/tools/search.tool.d.ts.map +1 -0
- package/dist/cjs/tools/search.tool.js +58 -0
- package/dist/cjs/tools/search.tool.js.map +1 -0
- package/dist/corpus/changelogs/2025-12-16-initial-architecture.md +145 -0
- package/dist/corpus/changelogs/2025-12-16-model-repo-datasource-refactor.md +300 -0
- package/dist/corpus/changelogs/2025-12-17-refactor.md +90 -0
- package/dist/corpus/changelogs/2025-12-18-performance-optimizations.md +130 -0
- package/dist/corpus/changelogs/2025-12-18-repository-validation-security.md +255 -0
- package/dist/corpus/changelogs/2025-12-26-nested-relations-and-generics.md +86 -0
- package/dist/corpus/changelogs/2025-12-26-transaction-support.md +57 -0
- package/dist/corpus/changelogs/2025-12-29-dynamic-binding-registration.md +104 -0
- package/dist/corpus/changelogs/2025-12-29-snowflake-uid-helper.md +100 -0
- package/dist/corpus/changelogs/2025-12-30-repository-enhancements.md +214 -0
- package/dist/corpus/changelogs/2025-12-31-json-path-filtering-array-operators.md +214 -0
- package/dist/corpus/changelogs/2025-12-31-string-id-custom-generator.md +137 -0
- package/dist/corpus/changelogs/2026-01-02-default-filter-and-repository-mixins.md +421 -0
- package/dist/corpus/changelogs/2026-01-05-range-queries-content-range.md +184 -0
- package/dist/corpus/changelogs/2026-01-06-basic-authentication.md +103 -0
- package/dist/corpus/changelogs/2026-01-07-controller-route-customization.md +190 -0
- package/dist/corpus/changelogs/2026-01-11-logger-optimization-hf-logger.md +254 -0
- package/dist/corpus/changelogs/2026-02-06-socket-io-integration-fix.md +541 -0
- package/dist/corpus/changelogs/2026-02-10-websocket-heartbeat-payload.md +173 -0
- package/dist/corpus/changelogs/2026-02-11-crypto-refactor-ecdh.md +217 -0
- package/dist/corpus/changelogs/2026-02-11-websocket-encrypted-delivery.md +209 -0
- package/dist/corpus/changelogs/2026-02-11-websocket-generic-types.md +134 -0
- package/dist/corpus/changelogs/2026-02-16-authorization-system.md +378 -0
- package/dist/corpus/changelogs/2026-02-26-core-helpers-decoupling.md +145 -0
- package/dist/corpus/changelogs/2026-02-27-jwks-authentication.md +391 -0
- package/dist/corpus/changelogs/2026-03-02-model-authorize-settings.md +155 -0
- package/dist/corpus/changelogs/2026-03-04-jwt-payload-field-codecs.md +219 -0
- package/dist/corpus/changelogs/2026-03-06-filter-offset-skip-fix.md +88 -0
- package/dist/corpus/changelogs/2026-03-10-kafka-helpers-refactor.md +225 -0
- package/dist/corpus/changelogs/2026-03-12-kafka-helpers-enhancement.md +169 -0
- package/dist/corpus/changelogs/2026-03-15-grpc-controller-system.md +281 -0
- package/dist/corpus/changelogs/2026-03-30-row-level-locking.md +134 -0
- package/dist/corpus/changelogs/2026-03-31-typescript-6-and-toolchain.md +100 -0
- package/dist/corpus/changelogs/2026-04-23-error-response-extra-fields.md +131 -0
- package/dist/corpus/changelogs/2026-05-05-refresh-token-endpoint.md +116 -0
- package/dist/corpus/changelogs/2026-05-08-crud-route-toggles-and-typed-responses.md +136 -0
- package/dist/corpus/changelogs/2026-05-20-relation-scope-default-limit.md +133 -0
- package/dist/corpus/changelogs/2026-05-21-mass-mutation-guards.md +102 -0
- package/dist/corpus/changelogs/2026-05-22-casbin-adapter-schema-qualification.md +72 -0
- package/dist/corpus/changelogs/2026-05-25-per-model-default-limit.md +68 -0
- package/dist/corpus/changelogs/2026-05-27-casbin-domain-matching-function.md +90 -0
- package/dist/corpus/changelogs/2026-06-02-authorize-scoped-rbac.md +105 -0
- package/dist/corpus/changelogs/2026-06-14-validation-codes-and-error-hardening.md +124 -0
- package/dist/corpus/changelogs/2026-06-18-auth-user-information-endpoint.md +69 -0
- package/dist/corpus/changelogs/2026-06-25-redis-helpers-refactor.md +199 -0
- package/dist/corpus/changelogs/2026-07-05-unified-repository-connectors.md +206 -0
- package/dist/corpus/changelogs/2026-07-08-typesense-advanced-search.md +72 -0
- package/dist/corpus/changelogs/2026-07-11-connectors-consistency-hardening.md +192 -0
- package/dist/corpus/changelogs/2026-07-11-postgres-driver-seam-supabase.md +146 -0
- package/dist/corpus/changelogs/2026-07-12-core-consolidation-dedup.md +127 -0
- package/dist/corpus/changelogs/2026-07-13-hardening-round.md +99 -0
- package/dist/corpus/changelogs/2026-07-14-driver-class-bundling.md +100 -0
- package/dist/corpus/changelogs/2026-07-16-error-catalog-and-structured-message.md +64 -0
- package/dist/corpus/changelogs/2026-07-16-secrets-vault-integration.md +72 -0
- package/dist/corpus/changelogs/2026-07-17-error-module-redesign.md +202 -0
- package/dist/corpus/changelogs/2026-07-17-logger-correctness-pass.md +46 -0
- package/dist/corpus/changelogs/2026-07-17-secrets-bundler-invisible-peers.md +30 -0
- package/dist/corpus/changelogs/2026-07-18-dependency-refresh.md +55 -0
- package/dist/corpus/changelogs/2026-07-18-logger-overhaul.md +104 -0
- package/dist/corpus/changelogs/2026-07-18-repository-read-retry.md +74 -0
- package/dist/corpus/changelogs/2026-07-20-casbin-custom-grants.md +72 -0
- package/dist/corpus/changelogs/2026-07-20-casbin-single-wave-extraction.md +58 -0
- package/dist/corpus/changelogs/2026-07-20-error-from-error-client.md +66 -0
- package/dist/corpus/changelogs/2026-07-21-casbin-connector-resolution-fix.md +36 -0
- package/dist/corpus/changelogs/2026-07-25-error-logging.md +129 -0
- package/dist/corpus/changelogs/2026-07-25-ignis-filter-package.md +75 -0
- package/dist/corpus/changelogs/2026-07-26-search-and-mail-error-codes.md +58 -0
- package/dist/corpus/changelogs/2026-08-01-relational-connector-lift.md +403 -0
- package/dist/corpus/changelogs/2026-08-02-sqlite-and-pglite-connectors.md +177 -0
- package/dist/corpus/changelogs/2026-08-05-search-dialect-relational-parity.md +90 -0
- package/dist/corpus/changelogs/2026-08-06-aes-pbkdf2-and-key-rotation.md +131 -0
- package/dist/corpus/changelogs/2026-08-07-default-query-by.md +62 -0
- package/dist/corpus/changelogs/2026-08-07-nested-fields-and-order-validation.md +75 -0
- package/dist/corpus/changelogs/2026-08-07-typesense-multi-search-transport.md +97 -0
- package/dist/corpus/changelogs/2026-08-12-json-log-arguments.md +69 -0
- package/dist/corpus/changelogs/2026-08-13-browser-pure-kernel.md +130 -0
- package/dist/corpus/changelogs/2026-08-18-esm-builds-and-one-default-stack.md +104 -0
- package/dist/corpus/changelogs/2026-08-18-opaque-uid-helper.md +43 -0
- package/dist/corpus/changelogs/2026-08-19-browser-bff-multi-tab.md +88 -0
- package/dist/corpus/changelogs/2026-08-19-service-authentication-phase-1.md +157 -0
- package/dist/corpus/changelogs/2026-08-21-service-authentication-strategy.md +127 -0
- package/dist/corpus/changelogs/2026-08-22-logger-color-off-outside-development.md +48 -0
- package/dist/corpus/changelogs/2026-08-24-query-wrapper-schemas.md +77 -0
- package/dist/corpus/changelogs/2026-08-29-casbin-domain-hierarchy.md +66 -0
- package/dist/corpus/changelogs/2026-08-30-authorize-no-enforcer-fails-closed.md +60 -0
- package/dist/corpus/changelogs/2026-08-30-crypto-hashing.md +158 -0
- package/dist/corpus/changelogs/2026-08-30-policy-definition-extra-variants.md +62 -0
- package/dist/corpus/changelogs/2026-08-30-row-scope-filter.md +221 -0
- package/dist/corpus/changelogs/2026-08-30-search-connector-health-and-import-contract.md +46 -0
- package/dist/corpus/changelogs/2026-08-30-tree-and-recursive-sql.md +188 -0
- package/dist/corpus/changelogs/2026-08-30-typed-where-clauses.md +114 -0
- package/dist/corpus/changelogs/2026-08-31-entity-id-brand.md +70 -0
- package/dist/corpus/changelogs/2026-08-31-event-bus-retry.md +143 -0
- package/dist/corpus/changelogs/2026-08-31-policy-domain-split-release-b.md +54 -0
- package/dist/corpus/changelogs/2026-08-31-policy-domain-split.md +175 -0
- package/dist/corpus/changelogs/2026-08-31-scope-filter-boot-checks.md +77 -0
- package/dist/corpus/changelogs/2026-09-02-bundle-safe-helpers.md +71 -0
- package/dist/corpus/changelogs/2026-09-02-decorator-artifact-registration.md +119 -0
- package/dist/corpus/changelogs/2026-09-03-deprecated-boot-api-removed.md +133 -0
- package/dist/corpus/changelogs/2026-09-04-dependency-floors-raised.md +61 -0
- package/dist/corpus/changelogs/2026-09-05-boot-checks.md +57 -0
- package/dist/corpus/changelogs/2026-09-05-core-drops-boot-dependency.md +44 -0
- package/dist/corpus/changelogs/2026-09-05-list-response-contract.md +74 -0
- package/dist/corpus/changelogs/2026-09-06-bun-serve-options.md +51 -0
- package/dist/corpus/changelogs/2026-09-06-ignis-atlas.md +54 -0
- package/dist/corpus/changelogs/2026-09-06-repository-inheritance-and-quiet-cli.md +46 -0
- package/dist/corpus/changelogs/2026-09-06-shared-singletons-across-module-copies.md +43 -0
- package/dist/corpus/changelogs/index.md +135 -0
- package/dist/corpus/changelogs/planned-schema-migrator.md +553 -0
- package/dist/corpus/changelogs/template.md +64 -0
- package/dist/corpus/wiki/best-practices/api-usage-examples.md +617 -0
- package/dist/corpus/wiki/best-practices/architectural-patterns.md +437 -0
- package/dist/corpus/wiki/best-practices/architecture-decisions.md +524 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/advanced-patterns.md +283 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/constants-configuration.md +240 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/control-flow.md +280 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/documentation.md +241 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/function-patterns.md +178 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/index.md +114 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/naming-conventions.md +200 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/route-definitions.md +205 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/tooling.md +168 -0
- package/dist/corpus/wiki/best-practices/code-style-standards/type-safety.md +199 -0
- package/dist/corpus/wiki/best-practices/common-pitfalls.md +447 -0
- package/dist/corpus/wiki/best-practices/contribution-workflow.md +211 -0
- package/dist/corpus/wiki/best-practices/data-modeling.md +548 -0
- package/dist/corpus/wiki/best-practices/deployment-strategies.md +736 -0
- package/dist/corpus/wiki/best-practices/error-handling.md +604 -0
- package/dist/corpus/wiki/best-practices/index.md +206 -0
- package/dist/corpus/wiki/best-practices/performance-optimization.md +437 -0
- package/dist/corpus/wiki/best-practices/security-guidelines.md +523 -0
- package/dist/corpus/wiki/best-practices/testing-strategies.md +639 -0
- package/dist/corpus/wiki/best-practices/troubleshooting-tips.md +227 -0
- package/dist/corpus/wiki/extensions/atlas/index.md +65 -0
- package/dist/corpus/wiki/extensions/components/api-reference.md +268 -0
- package/dist/corpus/wiki/extensions/components/authentication/api.md +643 -0
- package/dist/corpus/wiki/extensions/components/authentication/errors.md +211 -0
- package/dist/corpus/wiki/extensions/components/authentication/index.md +171 -0
- package/dist/corpus/wiki/extensions/components/authentication/usage.md +464 -0
- package/dist/corpus/wiki/extensions/components/authorization/api.md +1509 -0
- package/dist/corpus/wiki/extensions/components/authorization/errors.md +397 -0
- package/dist/corpus/wiki/extensions/components/authorization/getting-started.md +227 -0
- package/dist/corpus/wiki/extensions/components/authorization/index.md +155 -0
- package/dist/corpus/wiki/extensions/components/authorization/usage.md +587 -0
- package/dist/corpus/wiki/extensions/components/health-check.md +227 -0
- package/dist/corpus/wiki/extensions/components/index.md +26 -0
- package/dist/corpus/wiki/extensions/components/mail/api.md +773 -0
- package/dist/corpus/wiki/extensions/components/mail/errors.md +190 -0
- package/dist/corpus/wiki/extensions/components/mail/index.md +182 -0
- package/dist/corpus/wiki/extensions/components/mail/usage.md +370 -0
- package/dist/corpus/wiki/extensions/components/request-tracker.md +152 -0
- package/dist/corpus/wiki/extensions/components/socket-io/api.md +728 -0
- package/dist/corpus/wiki/extensions/components/socket-io/errors.md +119 -0
- package/dist/corpus/wiki/extensions/components/socket-io/index.md +116 -0
- package/dist/corpus/wiki/extensions/components/socket-io/usage.md +429 -0
- package/dist/corpus/wiki/extensions/components/static-asset/api.md +593 -0
- package/dist/corpus/wiki/extensions/components/static-asset/errors.md +159 -0
- package/dist/corpus/wiki/extensions/components/static-asset/index.md +160 -0
- package/dist/corpus/wiki/extensions/components/static-asset/usage.md +253 -0
- package/dist/corpus/wiki/extensions/components/template/api-page.md +125 -0
- package/dist/corpus/wiki/extensions/components/template/errors-page.md +100 -0
- package/dist/corpus/wiki/extensions/components/template/index.md +104 -0
- package/dist/corpus/wiki/extensions/components/template/setup-page.md +134 -0
- package/dist/corpus/wiki/extensions/components/template/single-page.md +132 -0
- package/dist/corpus/wiki/extensions/components/template/usage-page.md +127 -0
- package/dist/corpus/wiki/extensions/components/websocket/api.md +416 -0
- package/dist/corpus/wiki/extensions/components/websocket/errors.md +128 -0
- package/dist/corpus/wiki/extensions/components/websocket/index.md +127 -0
- package/dist/corpus/wiki/extensions/components/websocket/usage.md +257 -0
- package/dist/corpus/wiki/extensions/helpers/cron/index.md +116 -0
- package/dist/corpus/wiki/extensions/helpers/crypto/index.md +136 -0
- package/dist/corpus/wiki/extensions/helpers/crypto/reference.md +544 -0
- package/dist/corpus/wiki/extensions/helpers/env/index.md +119 -0
- package/dist/corpus/wiki/extensions/helpers/error/index.md +373 -0
- package/dist/corpus/wiki/extensions/helpers/index.md +63 -0
- package/dist/corpus/wiki/extensions/helpers/inversion/index.md +142 -0
- package/dist/corpus/wiki/extensions/helpers/inversion/reference.md +531 -0
- package/dist/corpus/wiki/extensions/helpers/kafka/admin.md +210 -0
- package/dist/corpus/wiki/extensions/helpers/kafka/compile-binary.md +125 -0
- package/dist/corpus/wiki/extensions/helpers/kafka/consumer.md +422 -0
- package/dist/corpus/wiki/extensions/helpers/kafka/examples.md +154 -0
- package/dist/corpus/wiki/extensions/helpers/kafka/index.md +84 -0
- package/dist/corpus/wiki/extensions/helpers/kafka/producer.md +408 -0
- package/dist/corpus/wiki/extensions/helpers/kafka/schema-registry.md +194 -0
- package/dist/corpus/wiki/extensions/helpers/logger/hf-logger.md +220 -0
- package/dist/corpus/wiki/extensions/helpers/logger/index.md +156 -0
- package/dist/corpus/wiki/extensions/helpers/logger/pino.md +107 -0
- package/dist/corpus/wiki/extensions/helpers/logger/reference.md +938 -0
- package/dist/corpus/wiki/extensions/helpers/network/api.md +1067 -0
- package/dist/corpus/wiki/extensions/helpers/network/index.md +189 -0
- package/dist/corpus/wiki/extensions/helpers/queue/index.md +165 -0
- package/dist/corpus/wiki/extensions/helpers/queue/reference.md +490 -0
- package/dist/corpus/wiki/extensions/helpers/redis/index.md +159 -0
- package/dist/corpus/wiki/extensions/helpers/redis/reference.md +784 -0
- package/dist/corpus/wiki/extensions/helpers/secrets/index.md +136 -0
- package/dist/corpus/wiki/extensions/helpers/socket-io/api.md +618 -0
- package/dist/corpus/wiki/extensions/helpers/socket-io/index.md +167 -0
- package/dist/corpus/wiki/extensions/helpers/storage/api.md +1021 -0
- package/dist/corpus/wiki/extensions/helpers/storage/index.md +162 -0
- package/dist/corpus/wiki/extensions/helpers/template/index.md +69 -0
- package/dist/corpus/wiki/extensions/helpers/template/single-page.md +126 -0
- package/dist/corpus/wiki/extensions/helpers/types/index.md +143 -0
- package/dist/corpus/wiki/extensions/helpers/types/reference.md +708 -0
- package/dist/corpus/wiki/extensions/helpers/uid/index.md +259 -0
- package/dist/corpus/wiki/extensions/helpers/websocket/api.md +888 -0
- package/dist/corpus/wiki/extensions/helpers/websocket/index.md +139 -0
- package/dist/corpus/wiki/extensions/helpers/worker-thread/index.md +142 -0
- package/dist/corpus/wiki/extensions/helpers/worker-thread/reference.md +434 -0
- package/dist/corpus/wiki/extensions/index.md +46 -0
- package/dist/corpus/wiki/guides/core-concepts/application/bootstrapping.md +274 -0
- package/dist/corpus/wiki/guides/core-concepts/application/index.md +239 -0
- package/dist/corpus/wiki/guides/core-concepts/components-guide.md +513 -0
- package/dist/corpus/wiki/guides/core-concepts/components.md +155 -0
- package/dist/corpus/wiki/guides/core-concepts/dependency-injection.md +336 -0
- package/dist/corpus/wiki/guides/core-concepts/grpc-controllers.md +296 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/datasources.md +195 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/index.md +132 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/models.md +331 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/pglite.md +218 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/postgres-drivers.md +207 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/repositories.md +311 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/search-meilisearch.md +195 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/search-typesense.md +443 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/sqlite.md +296 -0
- package/dist/corpus/wiki/guides/core-concepts/persistent/transactions.md +238 -0
- package/dist/corpus/wiki/guides/core-concepts/rest-controllers.md +465 -0
- package/dist/corpus/wiki/guides/core-concepts/secrets-vault.md +177 -0
- package/dist/corpus/wiki/guides/core-concepts/services.md +389 -0
- package/dist/corpus/wiki/guides/get-started/5-minute-quickstart.md +163 -0
- package/dist/corpus/wiki/guides/get-started/philosophy.md +135 -0
- package/dist/corpus/wiki/guides/get-started/setup.md +136 -0
- package/dist/corpus/wiki/guides/index.md +82 -0
- package/dist/corpus/wiki/guides/migrations/boot-api-removal-migration.md +79 -0
- package/dist/corpus/wiki/guides/migrations/redis-helpers-migration.md +178 -0
- package/dist/corpus/wiki/guides/migrations/scoped-rbac-migration.md +300 -0
- package/dist/corpus/wiki/guides/migrations/unified-connectors-migration.md +114 -0
- package/dist/corpus/wiki/guides/reference/glossary.md +250 -0
- package/dist/corpus/wiki/guides/tutorials/building-a-crud-api.md +704 -0
- package/dist/corpus/wiki/guides/tutorials/complete-installation.md +440 -0
- package/dist/corpus/wiki/guides/tutorials/ecommerce-api.md +1442 -0
- package/dist/corpus/wiki/guides/tutorials/realtime-chat.md +1571 -0
- package/dist/corpus/wiki/guides/tutorials/testing.md +264 -0
- package/dist/corpus/wiki/index.md +5 -0
- package/dist/corpus/wiki/public/apple-touch-icon.png +0 -0
- package/dist/corpus/wiki/public/logo.svg +1 -0
- package/dist/corpus/wiki/public/og-image.png +0 -0
- package/dist/corpus/wiki/public/site.webmanifest +11 -0
- package/dist/corpus/wiki/references/base/application.md +482 -0
- package/dist/corpus/wiki/references/base/bootstrapping.md +351 -0
- package/dist/corpus/wiki/references/base/components.md +883 -0
- package/dist/corpus/wiki/references/base/connectors.md +121 -0
- package/dist/corpus/wiki/references/base/controllers.md +1022 -0
- package/dist/corpus/wiki/references/base/datasources-reference.md +598 -0
- package/dist/corpus/wiki/references/base/datasources.md +165 -0
- package/dist/corpus/wiki/references/base/dependency-injection.md +423 -0
- package/dist/corpus/wiki/references/base/filter-system/application-usage.md +215 -0
- package/dist/corpus/wiki/references/base/filter-system/array-operators.md +135 -0
- package/dist/corpus/wiki/references/base/filter-system/comparison-operators.md +110 -0
- package/dist/corpus/wiki/references/base/filter-system/default-filter.md +267 -0
- package/dist/corpus/wiki/references/base/filter-system/fields-order-pagination.md +244 -0
- package/dist/corpus/wiki/references/base/filter-system/index.md +149 -0
- package/dist/corpus/wiki/references/base/filter-system/json-filtering.md +122 -0
- package/dist/corpus/wiki/references/base/filter-system/list-operators.md +56 -0
- package/dist/corpus/wiki/references/base/filter-system/logical-operators.md +148 -0
- package/dist/corpus/wiki/references/base/filter-system/null-operators.md +80 -0
- package/dist/corpus/wiki/references/base/filter-system/pattern-matching.md +105 -0
- package/dist/corpus/wiki/references/base/filter-system/quick-reference.md +172 -0
- package/dist/corpus/wiki/references/base/filter-system/range-operators.md +53 -0
- package/dist/corpus/wiki/references/base/filter-system/tips.md +154 -0
- package/dist/corpus/wiki/references/base/filter-system/use-cases.md +394 -0
- package/dist/corpus/wiki/references/base/grpc-controllers.md +1020 -0
- package/dist/corpus/wiki/references/base/index.md +112 -0
- package/dist/corpus/wiki/references/base/middlewares.md +543 -0
- package/dist/corpus/wiki/references/base/models-reference.md +886 -0
- package/dist/corpus/wiki/references/base/models.md +154 -0
- package/dist/corpus/wiki/references/base/providers.md +728 -0
- package/dist/corpus/wiki/references/base/repositories/advanced.md +627 -0
- package/dist/corpus/wiki/references/base/repositories/index.md +152 -0
- package/dist/corpus/wiki/references/base/repositories/mixins.md +103 -0
- package/dist/corpus/wiki/references/base/repositories/relations.md +379 -0
- package/dist/corpus/wiki/references/base/repositories/soft-deletable.md +307 -0
- package/dist/corpus/wiki/references/base/secrets.md +267 -0
- package/dist/corpus/wiki/references/base/services.md +417 -0
- package/dist/corpus/wiki/references/configuration/environment-variables.md +498 -0
- package/dist/corpus/wiki/references/configuration/index.md +132 -0
- package/dist/corpus/wiki/references/index.md +172 -0
- package/dist/corpus/wiki/references/quick-reference.md +594 -0
- package/dist/corpus/wiki/references/utilities/date.md +50 -0
- package/dist/corpus/wiki/references/utilities/duration.md +85 -0
- package/dist/corpus/wiki/references/utilities/index.md +81 -0
- package/dist/corpus/wiki/references/utilities/jsx-reference.md +298 -0
- package/dist/corpus/wiki/references/utilities/jsx.md +131 -0
- package/dist/corpus/wiki/references/utilities/module.md +110 -0
- package/dist/corpus/wiki/references/utilities/parse.md +55 -0
- package/dist/corpus/wiki/references/utilities/performance.md +54 -0
- package/dist/corpus/wiki/references/utilities/promise.md +54 -0
- package/dist/corpus/wiki/references/utilities/request.md +85 -0
- package/dist/corpus/wiki/references/utilities/retry.md +148 -0
- package/dist/corpus/wiki/references/utilities/schema.md +69 -0
- package/dist/corpus/wiki/references/utilities/statuses-reference.md +360 -0
- package/dist/corpus/wiki/references/utilities/statuses.md +122 -0
- package/package.json +74 -0
|
@@ -0,0 +1,643 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Authentication Reference
|
|
3
|
+
description: Full option tables, binding keys, service class hierarchy, strategy registry, and controller factory for the Authentication component
|
|
4
|
+
difficulty: intermediate
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Authentication Reference
|
|
8
|
+
|
|
9
|
+
Every option, binding key, class, and method the Authentication component exposes. See the [Overview](./) for the guided introduction.
|
|
10
|
+
|
|
11
|
+
**Files:**
|
|
12
|
+
|
|
13
|
+
- [`packages/core-server/src/components/auth/authenticate/`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core-server/src/components/auth/authenticate) - component, services, strategies, controllers
|
|
14
|
+
- [`packages/core-server/src/components/auth/models/`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core-server/src/components/auth/models) - entity column helpers + request schemas
|
|
15
|
+
- [`packages/kernel/src/base/auth/base/abstract-auth-registry.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/kernel/src/base/auth/base/abstract-auth-registry.ts) - `AbstractAuthRegistry`
|
|
16
|
+
|
|
17
|
+
## Find what you need
|
|
18
|
+
|
|
19
|
+
| You want to | Go to |
|
|
20
|
+
|---|---|
|
|
21
|
+
| See how the pieces fit together | [Architecture](#architecture) |
|
|
22
|
+
| Look up a binding key or option field | [Binding keys](#binding-keys), [Option interfaces](#option-interfaces) |
|
|
23
|
+
| Check what `IAuthUser` / `IAuthService` require | [IAuthUser / IJWTTokenPayload](#iauthuser-ijwttokenpayload), [IAuthService](#iauthservice) |
|
|
24
|
+
| Understand the JWS/JWKS/Basic class hierarchy | [Service class hierarchy](#service-class-hierarchy) |
|
|
25
|
+
| Register or resolve a strategy programmatically | [Strategy registry](#strategy-registry) |
|
|
26
|
+
| See exactly what the built-in `/auth` controller builds | [Controller factory](#controller-factory) |
|
|
27
|
+
| Find a file on disk | [File structure](#file-structure) |
|
|
28
|
+
|
|
29
|
+
## Import paths
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import {
|
|
33
|
+
// Component + registry
|
|
34
|
+
AuthenticateComponent,
|
|
35
|
+
AuthenticateBindingKeys,
|
|
36
|
+
Authentication,
|
|
37
|
+
AuthenticationFieldCodecs,
|
|
38
|
+
AuthenticationModes,
|
|
39
|
+
AuthenticationTokenTypes,
|
|
40
|
+
AuthenticationStrategyRegistry,
|
|
41
|
+
ServiceAssertion,
|
|
42
|
+
|
|
43
|
+
// JOSE standards + constants
|
|
44
|
+
JOSEStandards,
|
|
45
|
+
JWKSModes,
|
|
46
|
+
JWKSKeyDrivers,
|
|
47
|
+
JWKSKeyFormats,
|
|
48
|
+
|
|
49
|
+
// Strategies
|
|
50
|
+
JWSAuthenticationStrategy,
|
|
51
|
+
JWKSIssuerAuthenticationStrategy,
|
|
52
|
+
JWKSVerifierAuthenticationStrategy,
|
|
53
|
+
BasicAuthenticationStrategy,
|
|
54
|
+
ServiceAuthenticationStrategy,
|
|
55
|
+
|
|
56
|
+
// Services
|
|
57
|
+
AbstractBearerTokenService,
|
|
58
|
+
JWSTokenService,
|
|
59
|
+
JWKSIssuerTokenService,
|
|
60
|
+
JWKSVerifierTokenService,
|
|
61
|
+
BasicTokenService,
|
|
62
|
+
|
|
63
|
+
// Controllers
|
|
64
|
+
defineAuthController,
|
|
65
|
+
JWKSController,
|
|
66
|
+
authenticate,
|
|
67
|
+
|
|
68
|
+
// Entity column helpers
|
|
69
|
+
extraUserColumns,
|
|
70
|
+
extraRoleColumns,
|
|
71
|
+
extraPermissionColumns,
|
|
72
|
+
extraPolicyDefinitionColumns,
|
|
73
|
+
UserStatuses,
|
|
74
|
+
UserTypes,
|
|
75
|
+
RoleStatuses,
|
|
76
|
+
} from '@venizia/ignis';
|
|
77
|
+
|
|
78
|
+
import type {
|
|
79
|
+
TAuthenticationRestOptions,
|
|
80
|
+
TJWTTokenServiceOptions,
|
|
81
|
+
IJWSTokenServiceOptions,
|
|
82
|
+
IJWKSIssuerOptions,
|
|
83
|
+
IJWKSVerifierOptions,
|
|
84
|
+
TJWKSTokenServiceOptions,
|
|
85
|
+
TBasicTokenServiceOptions,
|
|
86
|
+
IServiceAuthOptions,
|
|
87
|
+
IServiceAssertionClaims,
|
|
88
|
+
TServiceCallerEntry,
|
|
89
|
+
IAuthenticateOptions,
|
|
90
|
+
IAuthUser,
|
|
91
|
+
IJWTTokenPayload,
|
|
92
|
+
IPayloadFieldCodec,
|
|
93
|
+
IAuthService,
|
|
94
|
+
IAuthenticationStrategy,
|
|
95
|
+
TDefineAuthControllerOpts,
|
|
96
|
+
TAuthStrategy,
|
|
97
|
+
TAuthMode,
|
|
98
|
+
TGetTokenExpiresFn,
|
|
99
|
+
TJWKSAlgorithm,
|
|
100
|
+
TJWKSKeyDriver,
|
|
101
|
+
TJWKSKeyFormat,
|
|
102
|
+
TJOSEStandard,
|
|
103
|
+
TJWKSMode,
|
|
104
|
+
TPermissionOptions,
|
|
105
|
+
TPermissionCommonColumns,
|
|
106
|
+
TPolicyDefinitionOptions,
|
|
107
|
+
TPolicyDefinitionCommonColumns,
|
|
108
|
+
} from '@venizia/ignis';
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Architecture
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
Application.preConfigure()
|
|
115
|
+
├── bind JWT_OPTIONS (TJWTTokenServiceOptions, discriminated on `standard`)
|
|
116
|
+
├── bind BASIC_OPTIONS / REST_OPTIONS
|
|
117
|
+
├── this.component(AuthenticateComponent)
|
|
118
|
+
└── AuthenticationStrategyRegistry.register() -- manual, after the component
|
|
119
|
+
|
|
120
|
+
AuthenticateComponent.binding()
|
|
121
|
+
├── switch on jwtOptions.standard
|
|
122
|
+
│ ├── JWS -> defineJWSAuth() -> registers JWSTokenService
|
|
123
|
+
│ └── JWKS -> defineJWKSAuth() -> switch on mode
|
|
124
|
+
│ ├── issuer -> JWKSIssuerTokenService + JWKSController (/certs)
|
|
125
|
+
│ └── verifier -> JWKSVerifierTokenService
|
|
126
|
+
├── defineBasicAuth() -> registers BasicTokenService (if basicOptions bound)
|
|
127
|
+
├── defineControllers() -> registers AuthController (if useAuthController: true)
|
|
128
|
+
└── defineOAuth2() -> stub, not implemented
|
|
129
|
+
|
|
130
|
+
Bearer token service hierarchy:
|
|
131
|
+
AbstractBearerTokenService (extractCredentials, verify, generate, encryptPayload/decryptPayload)
|
|
132
|
+
├── JWSTokenService (symmetric HS256)
|
|
133
|
+
└── AbstractJWKSTokenService (lazy ensureInitialized() + retry-on-failure)
|
|
134
|
+
├── JWKSIssuerTokenService (sign + verify + getJWKS/getJWKSAsync)
|
|
135
|
+
└── JWKSVerifierTokenService (verify only, via createRemoteJWKSet())
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Tech stack**
|
|
139
|
+
|
|
140
|
+
| Technology | Purpose |
|
|
141
|
+
|------------|---------|
|
|
142
|
+
| `jose` | JWT signing (`SignJWT`), verification (`jwtVerify`), JWKS (`createRemoteJWKSet`, `exportJWK`, `importPKCS8`, `importSPKI`, `importJWK`) |
|
|
143
|
+
| `@venizia/ignis-helpers` | `AES` payload encryption, `BaseHelper`/`BaseService`, `getError`, `HTTP` result codes |
|
|
144
|
+
| Hono middleware | Route-level integration via `createMiddleware` from `hono/factory` |
|
|
145
|
+
| `node:fs/promises` | Async key file reads for JWKS |
|
|
146
|
+
|
|
147
|
+
## Component methods
|
|
148
|
+
|
|
149
|
+
`AuthenticateComponent.binding()` runs four private configuration methods and one public stub:
|
|
150
|
+
|
|
151
|
+
| Method | Purpose |
|
|
152
|
+
|--------|---------|
|
|
153
|
+
| `defineJWSAuth(opts)` | Validates `jwtSecret` and `getTokenExpiresFn`, binds `IJWSTokenServiceOptions` to `JWT_OPTIONS`, registers `JWSTokenService` |
|
|
154
|
+
| `defineJWKSAuth(opts)` | Switches on `mode`.<br>**Issuer:** validates keys/format/kid/getTokenExpiresFn, binds to `JWKS_OPTIONS`, registers `JWKSIssuerTokenService` + `JWKSController`.<br>**Verifier:** validates `jwksUrl`, binds to `JWKS_OPTIONS`, registers `JWKSVerifierTokenService` |
|
|
155
|
+
| `defineServiceAuth(opts)` | Validates `name` and `resolvePrincipal`, registers the verifier and the `service` strategy. With `keys` present it also registers the signer and mounts the certs route. Absent options: does nothing |
|
|
156
|
+
| `defineBasicAuth(opts)` | Validates `verifyCredentials` presence, registers `BasicTokenService`. Skips (debug log) if `basicOptions` not bound |
|
|
157
|
+
| `defineControllers(opts)` | Requires `jwtOptions` when `useAuthController: true`. Calls `defineAuthController()` and registers the generated controller |
|
|
158
|
+
| `defineOAuth2()` | Public stub, called during `binding()`, performs no action - not yet implemented |
|
|
159
|
+
|
|
160
|
+
> [!NOTE]
|
|
161
|
+
> The component reads the discriminated union from `JWT_OPTIONS`. It then re-binds only the inner options object - `IJWSTokenServiceOptions`, or `IJWKSIssuerOptions`/`IJWKSVerifierOptions` - to `JWKS_OPTIONS` or back to `JWT_OPTIONS`. The token service resolves it with a plain `@inject`.
|
|
162
|
+
|
|
163
|
+
## Binding keys
|
|
164
|
+
|
|
165
|
+
| Constant | Key string | Type | Required | Default |
|
|
166
|
+
|----------|-----------|------|----------|---------|
|
|
167
|
+
| `AuthenticateBindingKeys.REST_OPTIONS` | `@app/authenticate/rest-options` | `TAuthenticationRestOptions` | No | <code v-pre>{ useAuthController: false }</code> |
|
|
168
|
+
| `AuthenticateBindingKeys.JWT_OPTIONS` | `@app/authenticate/jwt-options` | `TJWTTokenServiceOptions` | Conditional | -- |
|
|
169
|
+
| `AuthenticateBindingKeys.JWKS_OPTIONS` | `@app/authenticate/jwks-options` | `IJWKSIssuerOptions \| IJWKSVerifierOptions` | Internal | Bound by the component from `JWT_OPTIONS` |
|
|
170
|
+
| `AuthenticateBindingKeys.BASIC_OPTIONS` | `@app/authenticate/basic-options` | `TBasicTokenServiceOptions` | Conditional | -- |
|
|
171
|
+
| `AuthenticateBindingKeys.SERVICE_OPTIONS` | `@app/authenticate/service-options` | `IServiceAuthOptions` | Conditional | -- |
|
|
172
|
+
| `AuthenticateBindingKeys.SERVICE_CERTS_PATH` | `@app/authenticate/service-certs-path` | `string` | Internal | Bound by the component from `serviceOptions.rest.path` |
|
|
173
|
+
|
|
174
|
+
> [!IMPORTANT]
|
|
175
|
+
> At least one of `JWT_OPTIONS`, `BASIC_OPTIONS` or `SERVICE_OPTIONS` must be bound, or `AuthenticateComponent.binding()` throws. A service that only VERIFIES assertions needs neither jwt nor basic.
|
|
176
|
+
|
|
177
|
+
## Option interfaces
|
|
178
|
+
|
|
179
|
+
### TJWTTokenServiceOptions
|
|
180
|
+
|
|
181
|
+
Discriminated union on `standard`:
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
type TJWTTokenServiceOptions =
|
|
185
|
+
| { standard: typeof JOSEStandards.JWS; options: IJWSTokenServiceOptions }
|
|
186
|
+
| { standard: typeof JOSEStandards.JWKS; options: TJWKSTokenServiceOptions };
|
|
187
|
+
|
|
188
|
+
type TJWKSTokenServiceOptions = IJWKSIssuerOptions | IJWKSVerifierOptions; // discriminated on `mode`
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### IJWSTokenServiceOptions
|
|
192
|
+
|
|
193
|
+
| Option | Type | Default | Required | Description |
|
|
194
|
+
|--------|------|---------|----------|-------------|
|
|
195
|
+
| `jwtSecret` | `string` | -- | Yes | Secret for signing and verifying the JWT signature |
|
|
196
|
+
| `getTokenExpiresFn` | `TGetTokenExpiresFn` | -- | Yes | Returns token expiration in seconds |
|
|
197
|
+
| `applicationSecret` | `string` | -- | No | Enables AES payload field encryption when set |
|
|
198
|
+
| `aesAlgorithm` | `AESAlgorithmType` | `'aes-256-cbc'` | No | AES algorithm for payload encryption |
|
|
199
|
+
| `headerAlgorithm` | `string` | `'HS256'` | No | JWT signing algorithm |
|
|
200
|
+
| `fieldCodecs` | `IPayloadFieldCodec[]` | `[]` | No | Custom serialize/deserialize per field name |
|
|
201
|
+
| `verify` | `IJWTVerifyOptions` | -- | No | Claim checks on verify: `audience`, `issuer`, `subject`, `algorithms`, `clockTolerance`, `maxTokenAge`, `typ`, `requiredClaims`. Unset means signature and time claims only |
|
|
202
|
+
| `sign` | `{ issuer?, audience? }` | -- | No | Claims stamped on every issued token. A configured value WINS over one supplied in the payload |
|
|
203
|
+
|
|
204
|
+
> [!WARNING]
|
|
205
|
+
> `jwtSecret` is mandatory - the component throws if it's missing or equals the placeholder `'unknown_secret'`. `applicationSecret` is optional. When you omit it, the JWT payload stays standard plaintext. Standard fields (`iss`, `sub`, `aud`, `jti`, `nbf`, `exp`, `iat`) are never encrypted either way.
|
|
206
|
+
|
|
207
|
+
### IJWKSIssuerOptions
|
|
208
|
+
|
|
209
|
+
| Option | Type | Default | Required | Description |
|
|
210
|
+
|--------|------|---------|----------|-------------|
|
|
211
|
+
| `mode` | `typeof JWKSModes.ISSUER` | -- | Yes | Must be `'issuer'` |
|
|
212
|
+
| `algorithm` | `TJWKSAlgorithm` | -- | Yes | `'ES256'`, `'RS256'`, or `'EdDSA'` |
|
|
213
|
+
| `keys.driver` | `TJWKSKeyDriver` | -- | Yes | `'text'` (inline) or `'file'` (path) |
|
|
214
|
+
| `keys.format` | `TJWKSKeyFormat` | -- | Yes | `'pem'` or `'jwk'` |
|
|
215
|
+
| `keys.private` | `string` | -- | Yes | Private key content or file path |
|
|
216
|
+
| `keys.public` | `string` | -- | Yes | Public key content or file path |
|
|
217
|
+
| `kid` | `string` | -- | Yes | Key ID exposed in the JWKS endpoint and JWT header |
|
|
218
|
+
| `getTokenExpiresFn` | `TGetTokenExpiresFn` | -- | Yes | Returns token expiration in seconds |
|
|
219
|
+
| `rest.path` | `string` | `'/certs'` | No | Path of the generated `JWKSController` |
|
|
220
|
+
| `aesAlgorithm` | `AESAlgorithmType` | `'aes-256-cbc'` | No | AES algorithm for payload encryption |
|
|
221
|
+
| `applicationSecret` | `string` | -- | No | Enables AES payload field encryption when set |
|
|
222
|
+
| `fieldCodecs` | `IPayloadFieldCodec[]` | `[]` | No | Custom serialize/deserialize per field name |
|
|
223
|
+
| `verify` | `IJWTVerifyOptions` | -- | No | Claim checks on verify: `audience`, `issuer`, `subject`, `algorithms`, `clockTolerance`, `maxTokenAge`, `typ`, `requiredClaims`. Unset means signature and time claims only |
|
|
224
|
+
| `sign` | `{ issuer?, audience? }` | -- | No | Claims stamped on every issued token. A configured value WINS over one supplied in the payload |
|
|
225
|
+
|
|
226
|
+
### IJWKSVerifierOptions
|
|
227
|
+
|
|
228
|
+
| Option | Type | Default | Required | Description |
|
|
229
|
+
|--------|------|---------|----------|-------------|
|
|
230
|
+
| `mode` | `typeof JWKSModes.VERIFIER` | -- | Yes | Must be `'verifier'` |
|
|
231
|
+
| `jwksUrl` | `string` | -- | Yes | URL of the issuer's JWKS endpoint |
|
|
232
|
+
| `cacheTtlMs` | `number` | `43_200_000` (12h) | No | `createRemoteJWKSet` `cacheMaxAge` |
|
|
233
|
+
| `cooldownMs` | `number` | `30_000` (30s) | No | `createRemoteJWKSet` `cooldownDuration` |
|
|
234
|
+
| `aesAlgorithm` | `AESAlgorithmType` | `'aes-256-cbc'` | No | AES algorithm for payload decryption |
|
|
235
|
+
| `applicationSecret` | `string` | -- | No | Must match the issuer's secret to decrypt payloads |
|
|
236
|
+
| `fieldCodecs` | `IPayloadFieldCodec[]` | `[]` | No | Must match the issuer's codecs to decrypt custom fields |
|
|
237
|
+
| `verify` | `IJWTVerifyOptions` | -- | No | Claim checks on verify: `audience`, `issuer`, `subject`, `algorithms`, `clockTolerance`, `maxTokenAge`, `typ`, `requiredClaims`. Unset means signature and time claims only |
|
|
238
|
+
|
|
239
|
+
> [!IMPORTANT]
|
|
240
|
+
> `JWKSVerifierTokenService` cannot sign tokens - `getSigner()`, `getSigningKey()`, and `getDefaultTokenExpiresFn()` all throw. Only `verify()` and `extractCredentials()` are functional.
|
|
241
|
+
|
|
242
|
+
### TBasicTokenServiceOptions
|
|
243
|
+
|
|
244
|
+
| Option | Type | Description |
|
|
245
|
+
|--------|------|-------------|
|
|
246
|
+
| `verifyCredentials` | <code v-pre>(opts: { credentials: { username: string; password: string }; context: TContext }) => Promise<IAuthUser \| null></code> | Callback that validates Basic credentials and returns the authenticated user, or `null` |
|
|
247
|
+
|
|
248
|
+
### TAuthenticationRestOptions
|
|
249
|
+
|
|
250
|
+
Discriminated union on `useAuthController` - when `true`, `controllerOpts` becomes required:
|
|
251
|
+
|
|
252
|
+
```typescript
|
|
253
|
+
type TAuthenticationRestOptions = {} & (
|
|
254
|
+
| { useAuthController?: false | undefined }
|
|
255
|
+
| { useAuthController: true; controllerOpts: TDefineAuthControllerOpts }
|
|
256
|
+
);
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### TDefineAuthControllerOpts
|
|
260
|
+
|
|
261
|
+
| Option | Type | Default | Description |
|
|
262
|
+
|--------|------|---------|-------------|
|
|
263
|
+
| `restPath` | `string` | `'/auth'` | Base path for the generated controller |
|
|
264
|
+
| `serviceKey` | `string` | -- | DI key for the `IAuthService` implementation (required) |
|
|
265
|
+
| `requireAuthenticatedSignUp` | `boolean` | `false` | Whether `POST /sign-up` requires a valid JWT |
|
|
266
|
+
| `payload.signIn` | `{ request: { schema }, response: { schema } }` | Built-in schemas | Custom Zod schemas for `/sign-in` |
|
|
267
|
+
| `payload.signUp` | `{ request: { schema }, response: { schema } }` | Built-in schemas | Custom Zod schemas for `/sign-up` |
|
|
268
|
+
| `payload.changePassword` | `{ request: { schema? }, response: { schema } }` | Built-in schemas | Custom Zod schemas for `/change-password` |
|
|
269
|
+
| `payload.refreshToken` | `{ response: { schema } }` | `AnyObjectSchema` | Custom response schema for `/token/refresh` |
|
|
270
|
+
| `payload.getUserInformation` | `{ response: { schema } }` | `AnyObjectSchema` | Custom response schema for `/me` and the `who-am-i` `userInformation` field |
|
|
271
|
+
|
|
272
|
+
### Route authenticate config
|
|
273
|
+
|
|
274
|
+
```typescript
|
|
275
|
+
type TRouteAuthenticateConfig =
|
|
276
|
+
| { skip: true }
|
|
277
|
+
| { skip?: false; strategies?: TAuthStrategy[]; mode?: TAuthMode };
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
| Field | Type | Default | Description |
|
|
281
|
+
|-------|------|---------|-------------|
|
|
282
|
+
| `authenticate.strategies` | `TAuthStrategy[]` | -- | Strategy names to try - for example, `['jwt']` or `['jwt', 'basic']`. Any name you register works too; `'jwt'` and `'basic'` are the ones the framework ships |
|
|
283
|
+
| `authenticate.mode` | `'any' \| 'all'` | `'any'` | `'any'`: first success wins. `'all'`: every strategy must pass |
|
|
284
|
+
| `authenticate.skip` | `true` | -- | Skips authentication for this route entirely |
|
|
285
|
+
|
|
286
|
+
### IAuthUser / IJWTTokenPayload
|
|
287
|
+
|
|
288
|
+
```typescript
|
|
289
|
+
interface IAuthUser {
|
|
290
|
+
userId: IdType;
|
|
291
|
+
[extra: string | symbol]: any;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
interface IJWTTokenPayload extends JWTPayload, IAuthUser {
|
|
295
|
+
userId: IdType;
|
|
296
|
+
roles: { id: IdType; identifier: string; priority: number }[];
|
|
297
|
+
clientId?: string;
|
|
298
|
+
provider?: string;
|
|
299
|
+
email?: string;
|
|
300
|
+
name?: string;
|
|
301
|
+
[extra: string | symbol]: any;
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
> [!TIP]
|
|
306
|
+
> `IAuthUser` is intentionally minimal. Your `IAuthService` can return extra fields (roles, email, provider) - they pass through JWT generation and are available on `Authentication.CURRENT_USER` after authentication.
|
|
307
|
+
|
|
308
|
+
### IAuthService
|
|
309
|
+
|
|
310
|
+
```typescript
|
|
311
|
+
interface IAuthService<
|
|
312
|
+
E extends Env = Env,
|
|
313
|
+
SIRQ extends TSignInRequest = TSignInRequest, SIRS = AnyObject,
|
|
314
|
+
SURQ extends TSignUpRequest = TSignUpRequest, SURS = AnyObject,
|
|
315
|
+
CPRQ extends TChangePasswordRequest = TChangePasswordRequest, CPRS = AnyObject,
|
|
316
|
+
UIRQ = AnyObject, UIRS = AnyObject,
|
|
317
|
+
RTRS = AnyObject,
|
|
318
|
+
> {
|
|
319
|
+
signIn(context: TContext<E>, opts: SIRQ): Promise<SIRS>;
|
|
320
|
+
signUp(context: TContext<E>, opts: SURQ): Promise<SURS>;
|
|
321
|
+
changePassword(context: TContext<E>, opts: CPRQ): Promise<CPRS>;
|
|
322
|
+
getUserInformation?(context: TContext<E>, opts: UIRQ): Promise<UIRS>;
|
|
323
|
+
refreshToken?(context: TContext<E>): Promise<RTRS>;
|
|
324
|
+
}
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
> [!NOTE]
|
|
328
|
+
> `getUserInformation` and `refreshToken` are optional. The generated auth controller returns `501` for `/me`, `/token/refresh`, or `?withUserInformation=true` on `/who-am-i` if the bound service doesn't implement the corresponding method.
|
|
329
|
+
|
|
330
|
+
### Field codecs
|
|
331
|
+
|
|
332
|
+
```typescript
|
|
333
|
+
interface IPayloadFieldCodec<T = unknown> {
|
|
334
|
+
key: string;
|
|
335
|
+
serialize(opts: { value: T }): string;
|
|
336
|
+
deserialize(opts: { raw: string }): T;
|
|
337
|
+
}
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
`AuthenticationFieldCodecs.ROLES_CODEC` is a ready-made codec for the `roles` field (pipe-separated `id|identifier|priority` strings). It is **not applied automatically** - pass it explicitly via `fieldCodecs: [AuthenticationFieldCodecs.ROLES_CODEC]` in the JWS/JWKS options. Without it, `roles` (and every other non-standard field) is serialized with plain `JSON.stringify` before AES encryption.
|
|
341
|
+
|
|
342
|
+
```typescript
|
|
343
|
+
class AuthenticationFieldCodecs {
|
|
344
|
+
static readonly ROLES_CODEC: IPayloadFieldCodec<IJWTTokenPayload['roles']>;
|
|
345
|
+
static build<T>(opts: { key: string; serialize; deserialize }): IPayloadFieldCodec<T>;
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
## Context variables
|
|
350
|
+
|
|
351
|
+
Set on the Hono `Context` during authentication, readable via `context.get()`:
|
|
352
|
+
|
|
353
|
+
| Constant | Key string | Type | Description |
|
|
354
|
+
|----------|-----------|------|-------------|
|
|
355
|
+
| `Authentication.CURRENT_USER` | `auth.current.user` | `IAuthUser` | Authenticated user payload |
|
|
356
|
+
| `Authentication.AUDIT_USER_ID` | `audit.user.id` | `IdType` | Authenticated user's ID |
|
|
357
|
+
| `Authentication.SKIP_AUTHENTICATION` | `authentication.skip` | `boolean` | Set `true` in a preceding middleware to bypass auth |
|
|
358
|
+
|
|
359
|
+
## Constants
|
|
360
|
+
|
|
361
|
+
**Authentication**
|
|
362
|
+
|
|
363
|
+
| Constant | Value | Description |
|
|
364
|
+
|----------|-------|-------------|
|
|
365
|
+
| `Authentication.STRATEGY_JWT` | `'jwt'` | JWT strategy name |
|
|
366
|
+
| `Authentication.STRATEGY_BASIC` | `'basic'` | Basic strategy name |
|
|
367
|
+
| `Authentication.TYPE_BEARER` | `'Bearer'` | Bearer token type prefix |
|
|
368
|
+
| `Authentication.TYPE_BASIC` | `'Basic'` | Basic token type prefix |
|
|
369
|
+
| `Authentication.AUTHENTICATION_STRATEGY` | `'authentication.strategy'` | Binding key prefix for registered strategies |
|
|
370
|
+
|
|
371
|
+
**AuthenticationTokenTypes**
|
|
372
|
+
|
|
373
|
+
| Constant | Value |
|
|
374
|
+
|----------|-------|
|
|
375
|
+
| `TYPE_AUTHORIZATION_CODE` | `'000_AUTHORIZATION_CODE'` |
|
|
376
|
+
| `TYPE_ACCESS_TOKEN` | `'100_ACCESS_TOKEN'` |
|
|
377
|
+
| `TYPE_REFRESH_TOKEN` | `'200_REFRESH_TOKEN'` |
|
|
378
|
+
|
|
379
|
+
**JOSE / JWKS constants** - each class also exposes `SCHEME_SET: Set<string>` and `isValid(input): boolean`
|
|
380
|
+
|
|
381
|
+
| Class | Members |
|
|
382
|
+
|-------|---------|
|
|
383
|
+
| `JOSEStandards` | `JWS` (`'JWS'`), `JWKS` (`'JWKS'`) |
|
|
384
|
+
| `JWKSModes` | `ISSUER` (`'issuer'`), `VERIFIER` (`'verifier'`) |
|
|
385
|
+
| `JWKSKeyDrivers` | `TEXT` (`'text'`), `FILE` (`'file'`) |
|
|
386
|
+
| `JWKSKeyFormats` | `PEM` (`'pem'`), `JWK` (`'jwk'`) |
|
|
387
|
+
| `AuthenticateStrategy` | `BASIC` (`'basic'`), `JWT` (`'jwt'`) - same values as `Authentication.STRATEGY_*` |
|
|
388
|
+
| `AuthenticationModes` | `ANY` (`'any'`), `ALL` (`'all'`) |
|
|
389
|
+
|
|
390
|
+
## Strategy registry
|
|
391
|
+
|
|
392
|
+
`AuthenticationStrategyRegistry` is a singleton extending `AbstractAuthRegistry<IAuthenticationStrategy>`.
|
|
393
|
+
|
|
394
|
+
| Method | Signature | Description |
|
|
395
|
+
|--------|-----------|--------------|
|
|
396
|
+
| `getInstance()` | `static (): AuthenticationStrategyRegistry` | Returns (creating if needed) the singleton |
|
|
397
|
+
| `register` | <code v-pre>(opts: { container: Container; strategies: { name: string; strategy: TClass<IAuthenticationStrategy> }[] }) => this</code> | Binds each strategy into the container as a singleton under `authentication.strategy.<name>`. Returns `this` |
|
|
398
|
+
| `resolveStrategy` | `(opts: { name: string }) => IAuthenticationStrategy` | Resolves a registered strategy instance by name |
|
|
399
|
+
|
|
400
|
+
```typescript
|
|
401
|
+
AuthenticationStrategyRegistry.getInstance().register({
|
|
402
|
+
container: this,
|
|
403
|
+
strategies: [
|
|
404
|
+
{ name: Authentication.STRATEGY_JWT, strategy: JWKSIssuerAuthenticationStrategy },
|
|
405
|
+
{ name: Authentication.STRATEGY_BASIC, strategy: BasicAuthenticationStrategy },
|
|
406
|
+
],
|
|
407
|
+
});
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
**Standalone `authenticate()` function** - the primary export for creating middleware outside the route-config `authenticate` field:
|
|
411
|
+
|
|
412
|
+
```typescript
|
|
413
|
+
const authenticationProvider = new AuthenticationProvider();
|
|
414
|
+
const authenticateFn = authenticationProvider.value();
|
|
415
|
+
|
|
416
|
+
export const authenticate = (opts: { strategies: string[]; mode?: TAuthMode }) => authenticateFn(opts);
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
**`AuthenticationProvider` middleware behavior:**
|
|
420
|
+
|
|
421
|
+
1. If `Authentication.SKIP_AUTHENTICATION` is set on context, skips entirely (debug log)
|
|
422
|
+
2. If `Authentication.CURRENT_USER` is already set, skips (already authenticated)
|
|
423
|
+
3. Runs strategies per `mode` (`'any'` or `'all'`)
|
|
424
|
+
4. On success, sets `Authentication.CURRENT_USER` and `Authentication.AUDIT_USER_ID`
|
|
425
|
+
5. On failure, throws `401`
|
|
426
|
+
|
|
427
|
+
> [!NOTE]
|
|
428
|
+
> `'any'` mode logs each failing strategy at debug and discards the error. It only throws once every strategy is exhausted. `'all'` mode uses the **first** strategy's user payload as the identity source. If that payload has no `userId`, it throws `401` even though every strategy technically passed.
|
|
429
|
+
|
|
430
|
+
## Service class hierarchy
|
|
431
|
+
|
|
432
|
+
```
|
|
433
|
+
AbstractBearerTokenService<E> (extends BaseService)
|
|
434
|
+
#aes, #applicationSecret, #fieldCodecs
|
|
435
|
+
+extractCredentials(context) Extract Bearer token from Authorization header
|
|
436
|
+
+verify(opts) Template method -> doVerify()
|
|
437
|
+
+generate(opts) Template method -> getSigner() + getSigningKey()
|
|
438
|
+
+encryptPayload(payload) / decryptPayload(opts)
|
|
439
|
+
#doVerify(token)* +getSigner(opts)* #getSigningKey()* #getDefaultTokenExpiresFn()*
|
|
440
|
+
|
|
441
|
+
JWSTokenService Symmetric HS256, shared secret
|
|
442
|
+
used by JWSAuthenticationStrategy
|
|
443
|
+
|
|
444
|
+
AbstractJWKSTokenService Lazy ensureInitialized() + retry-on-failure
|
|
445
|
+
#initialized, #initPromise
|
|
446
|
+
+ensureInitialized() #initialize()*
|
|
447
|
+
|
|
448
|
+
JWKSIssuerTokenService Sign with private key, verify with public key
|
|
449
|
+
+getJWKS() (sync, throws if uninitialized) +getJWKSAsync()
|
|
450
|
+
used by JWKSIssuerAuthenticationStrategy
|
|
451
|
+
|
|
452
|
+
JWKSVerifierTokenService Verify only, via remote JWKS
|
|
453
|
+
used by JWKSVerifierAuthenticationStrategy
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
### AbstractBearerTokenService
|
|
457
|
+
|
|
458
|
+
**File:** [`packages/core-server/src/components/auth/authenticate/services/bearer/abstract.service.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core-server/src/components/auth/authenticate/services/bearer/abstract.service.ts)
|
|
459
|
+
|
|
460
|
+
| Method | Signature | Description |
|
|
461
|
+
|--------|-----------|-------------|
|
|
462
|
+
| `configurePayloadEncryption` | <code v-pre>(opts: { aesAlgorithm?; applicationSecret?; fieldCodecs?: IPayloadFieldCodec[] }) => void</code> | Sets up AES + field codecs. AES only activates if `applicationSecret` is provided |
|
|
463
|
+
| `extractCredentials` | `(context) => { type: string; token: string }` | Parses `Authorization: Bearer <token>` |
|
|
464
|
+
| `verify` | `(opts: { type, token }) => Promise<IJWTTokenPayload>` | Calls `doVerify()`, wraps errors as sanitized `401` |
|
|
465
|
+
| `generate` | `(opts: { payload, getTokenExpiresFn? }) => Promise<string>` | Calls `getSigner()` then signs with `getSigningKey()` |
|
|
466
|
+
| `serializeField` / `deserializeField` | `(opts) => string` / `any` | Per-field codec lookup, `JSON.stringify`/`JSON.parse` fallback |
|
|
467
|
+
| `encryptPayload` | `(payload) => Record<string, any>` | AES-encrypts non-standard fields (keys and values). No-op if AES not configured |
|
|
468
|
+
| `decryptPayload` | `(opts: { result }) => IJWTTokenPayload` | Reverses `encryptPayload`. No-op if AES not configured |
|
|
469
|
+
|
|
470
|
+
Static: `JWT_COMMON_FIELDS: Set<'iss'|'sub'|'aud'|'jti'|'nbf'|'exp'|'iat'>` - never encrypted or touched by field codecs.
|
|
471
|
+
|
|
472
|
+
### JWSTokenService
|
|
473
|
+
|
|
474
|
+
**File:** [`packages/core-server/src/components/auth/authenticate/services/bearer/jws.service.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core-server/src/components/auth/authenticate/services/bearer/jws.service.ts)
|
|
475
|
+
|
|
476
|
+
The constructor validates `jwtSecret` and `getTokenExpiresFn`, throwing `500` if either is missing. It encodes the secret to `Uint8Array` and calls `configurePayloadEncryption()`. `doVerify` calls `jose.jwtVerify()` with the shared secret. `getSigner` signs with header `HS256`, or `headerAlgorithm` if you set one.
|
|
477
|
+
|
|
478
|
+
### AbstractJWKSTokenService
|
|
479
|
+
|
|
480
|
+
**File:** [`packages/core-server/src/components/auth/authenticate/services/bearer/jwks/abstract.service.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core-server/src/components/auth/authenticate/services/bearer/jwks/abstract.service.ts)
|
|
481
|
+
|
|
482
|
+
`ensureInitialized()` lazily runs `initialize()` on the first call. Concurrent callers share the pending promise. If `initialize()` rejects, the promise resets - the next call retries instead of caching the failure.
|
|
483
|
+
|
|
484
|
+
### JWKSIssuerTokenService
|
|
485
|
+
|
|
486
|
+
**File:** [`packages/core-server/src/components/auth/authenticate/services/bearer/jwks/issuer.service.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core-server/src/components/auth/authenticate/services/bearer/jwks/issuer.service.ts)
|
|
487
|
+
|
|
488
|
+
`initialize()` runs in order:
|
|
489
|
+
|
|
490
|
+
1. Reads the key content - `readFile` for `keys.driver: 'file'`, inline text for `'text'`.
|
|
491
|
+
2. Imports it - `importPKCS8`/`importSPKI` for PEM, `importJWK` for JWK.
|
|
492
|
+
3. Exports the public JWK with `kid`, `alg`, and `use: 'sig'` set.
|
|
493
|
+
4. Caches the result as `{ keys: [publicJWK] }`.
|
|
494
|
+
|
|
495
|
+
| Method | Signature | Description |
|
|
496
|
+
|--------|-----------|-------------|
|
|
497
|
+
| `getJWKS` | `() => { keys: JWK[] }` | Synchronous, returns the cached JWKS. Throws if called before `initialize()` completes |
|
|
498
|
+
| `getJWKSAsync` | `() => Promise<{ keys: JWK[] }>` | Calls `ensureInitialized()` first |
|
|
499
|
+
|
|
500
|
+
### JWKSVerifierTokenService
|
|
501
|
+
|
|
502
|
+
**File:** [`packages/core-server/src/components/auth/authenticate/services/bearer/jwks/verifier.service.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core-server/src/components/auth/authenticate/services/bearer/jwks/verifier.service.ts)
|
|
503
|
+
|
|
504
|
+
`initialize()` calls `createRemoteJWKSet(jwksUrl, { cacheMaxAge: cacheTtlMs ?? 43_200_000, cooldownDuration: cooldownMs ?? 30_000 })`. `getSigner`/`getSigningKey`/`getDefaultTokenExpiresFn` all throw - this service is verify-only.
|
|
505
|
+
|
|
506
|
+
### BasicTokenService
|
|
507
|
+
|
|
508
|
+
**File:** [`packages/core-server/src/components/auth/authenticate/services/basic/service.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core-server/src/components/auth/authenticate/services/basic/service.ts)
|
|
509
|
+
|
|
510
|
+
| Method | Signature | Description |
|
|
511
|
+
|--------|-----------|-------------|
|
|
512
|
+
| `extractCredentials` | `(context) => { username: string; password: string }` | Decodes `Authorization: Basic <base64>` |
|
|
513
|
+
| `verify` | `(opts: { credentials, context }) => Promise<IAuthUser>` | Calls the user-provided `verifyCredentials` |
|
|
514
|
+
|
|
515
|
+
Constructor throws `500` if `verifyCredentials` is missing from the injected options.
|
|
516
|
+
|
|
517
|
+
## Strategy classes
|
|
518
|
+
|
|
519
|
+
All four strategies extend `BaseHelper` and implement `IAuthenticationStrategy<E>`. Each one carries:
|
|
520
|
+
|
|
521
|
+
- A `name` field.
|
|
522
|
+
- A `standard` field (Bearer strategies only).
|
|
523
|
+
- One injected token service.
|
|
524
|
+
- An `authenticate(context)` method that calls `extractCredentials()`, then `verify()`.
|
|
525
|
+
|
|
526
|
+
| Strategy | `name` | Injects | File |
|
|
527
|
+
|----------|--------|---------|------|
|
|
528
|
+
| `JWSAuthenticationStrategy` | `Authentication.STRATEGY_JWT` | `JWSTokenService` | [`strategies/jws.strategy.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core-server/src/components/auth/authenticate/strategies/jws.strategy.ts) |
|
|
529
|
+
| `JWKSIssuerAuthenticationStrategy` | `Authentication.STRATEGY_JWT` | `JWKSIssuerTokenService` | [`strategies/jwks/issuer.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core-server/src/components/auth/authenticate/strategies/jwks/issuer.ts) |
|
|
530
|
+
| `JWKSVerifierAuthenticationStrategy` | `Authentication.STRATEGY_JWT` | `JWKSVerifierTokenService` | [`strategies/jwks/verifier.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core-server/src/components/auth/authenticate/strategies/jwks/verifier.ts) |
|
|
531
|
+
| `BasicAuthenticationStrategy` | `Authentication.STRATEGY_BASIC` | `BasicTokenService` | [`strategies/basic.strategy.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core-server/src/components/auth/authenticate/strategies/basic.strategy.ts) |
|
|
532
|
+
|
|
533
|
+
> [!NOTE]
|
|
534
|
+
> Choose the strategy class that matches your JOSE standard. `JWKSIssuerAuthenticationStrategy` and `JWKSVerifierAuthenticationStrategy` both register under the same `'jwt'` name - use only one of the two per service.
|
|
535
|
+
|
|
536
|
+
## JWKSController
|
|
537
|
+
|
|
538
|
+
Serves the JWKS endpoint (default path `/certs`, configurable via `rest.path`). Intentionally unauthenticated - it serves the public keys external verifiers need.
|
|
539
|
+
|
|
540
|
+
**File:** [`packages/core-server/src/components/auth/authenticate/controllers/jwks/controller.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core-server/src/components/auth/authenticate/controllers/jwks/controller.ts)
|
|
541
|
+
|
|
542
|
+
```typescript
|
|
543
|
+
class JWKSController extends BaseRestController {
|
|
544
|
+
constructor(@inject(...) private jwksService: JWKSIssuerTokenService) {
|
|
545
|
+
super({ scope: JWKSController.name, path: '/certs', isStrict: true });
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
override binding() {
|
|
549
|
+
this.defineRoute({
|
|
550
|
+
configs: RouteConfigs.GET_JWKS_CERTS, // GET '/'
|
|
551
|
+
handler: async context => {
|
|
552
|
+
const jwks = await this.jwksService.getJWKSAsync();
|
|
553
|
+
context.header('Cache-Control', 'public, max-age=3600, stale-while-revalidate=86400');
|
|
554
|
+
return context.json(jwks, HTTP.ResultCodes.RS_2.Ok);
|
|
555
|
+
},
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
The component applies `@controller({ path })` to `JWKSController` dynamically at binding time (via `Reflect.decorate`), since the path depends on a runtime option.
|
|
562
|
+
|
|
563
|
+
## Controller factory
|
|
564
|
+
|
|
565
|
+
`defineAuthController(opts: TDefineAuthControllerOpts): typeof AuthController` builds a `BaseRestController` subclass at runtime.
|
|
566
|
+
|
|
567
|
+
**File:** [`packages/core-server/src/components/auth/authenticate/controllers/factory.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core-server/src/components/auth/authenticate/controllers/factory.ts)
|
|
568
|
+
|
|
569
|
+
**How it works:**
|
|
570
|
+
|
|
571
|
+
1. **Class creation.** `class AuthController extends BaseRestController {}` inside the factory closure, decorated with `@controller({ path: restPath })`, `isStrict: true`.
|
|
572
|
+
2. **Service injection.** `inject({ key: serviceKey })(AuthController, undefined, 0)` is applied *after* class definition - the programmatic equivalent of decorating constructor parameter 0. The constructor throws `400` if the resolved service is falsy.
|
|
573
|
+
3. **Routes.** Defined in `binding()` via `this.defineRoute()` - see the endpoint table in [Usage & Examples](./usage#api-endpoints).
|
|
574
|
+
4. **Schemas.** Each endpoint uses `payload.<name>.{request,response}.schema` if you provide it. Otherwise it falls back to a built-in default, or `AnyObjectSchema` where there's no built-in schema for that response.
|
|
575
|
+
|
|
576
|
+
Also exports `JWTTokenPayloadSchema`, the Zod schema backing `/who-am-i`'s response. It's extended at runtime with an optional `userInformation` field, typed from `payload.getUserInformation.response.schema` (or `AnyObjectSchema` if you don't provide one).
|
|
577
|
+
|
|
578
|
+
## Entity column helper types
|
|
579
|
+
|
|
580
|
+
Exported for extending the auth entity column helpers - see [Usage & Examples](./usage#entity-column-helpers) for the columns themselves.
|
|
581
|
+
|
|
582
|
+
```typescript
|
|
583
|
+
type TPermissionOptions = { idType?: 'string' | 'number' };
|
|
584
|
+
type TPermissionCommonColumns = {
|
|
585
|
+
code: NotNull<PgTextBuilderInitial<...>>;
|
|
586
|
+
name: NotNull<PgTextBuilderInitial<...>>;
|
|
587
|
+
subject: NotNull<PgTextBuilderInitial<...>>;
|
|
588
|
+
method: NotNull<PgTextBuilderInitial<...>>;
|
|
589
|
+
action: NotNull<PgTextBuilderInitial<...>>;
|
|
590
|
+
scope: NotNull<PgTextBuilderInitial<...>>;
|
|
591
|
+
description: PgTextBuilderInitial<...>;
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
type TPolicyDefinitionOptions = { idType?: 'string' | 'number' };
|
|
595
|
+
type TPolicyDefinitionCommonColumns = {
|
|
596
|
+
variant: ReturnType<typeof text>;
|
|
597
|
+
subjectType: ReturnType<typeof text>;
|
|
598
|
+
targetType: ReturnType<typeof text>;
|
|
599
|
+
action: ReturnType<typeof text>;
|
|
600
|
+
effect: ReturnType<typeof text>;
|
|
601
|
+
domain: ReturnType<typeof text>;
|
|
602
|
+
metadata: ReturnType<typeof jsonb>;
|
|
603
|
+
};
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
## File structure
|
|
607
|
+
|
|
608
|
+
```
|
|
609
|
+
packages/core-server/src/components/auth/
|
|
610
|
+
├── authenticate/
|
|
611
|
+
│ ├── common/
|
|
612
|
+
│ │ ├── codecs.ts # AuthenticationFieldCodecs (ROLES_CODEC, build() factory)
|
|
613
|
+
│ │ ├── constants.ts # AuthenticateStrategy, JOSEStandards, JWKSModes, JWKSKeyDrivers, JWKSKeyFormats, Authentication, AuthenticationTokenTypes, AuthenticationModes
|
|
614
|
+
│ │ ├── keys.ts # AuthenticateBindingKeys
|
|
615
|
+
│ │ ├── types.ts # Option interfaces, discriminated unions, IAuthUser, IJWTTokenPayload, IAuthService
|
|
616
|
+
│ │ └── index.ts
|
|
617
|
+
│ ├── controllers/
|
|
618
|
+
│ │ ├── factory.ts # defineAuthController() + JWTTokenPayloadSchema
|
|
619
|
+
│ │ └── jwks/ # JWKSController + route config
|
|
620
|
+
│ ├── middlewares/
|
|
621
|
+
│ │ └── authenticate.middleware.ts # Standalone authenticate() function
|
|
622
|
+
│ ├── providers/
|
|
623
|
+
│ │ └── authentication.provider.ts # AuthenticationProvider
|
|
624
|
+
│ ├── services/
|
|
625
|
+
│ │ ├── basic/service.ts # BasicTokenService
|
|
626
|
+
│ │ └── bearer/
|
|
627
|
+
│ │ ├── abstract.service.ts # AbstractBearerTokenService
|
|
628
|
+
│ │ ├── jws.service.ts # JWSTokenService
|
|
629
|
+
│ │ └── jwks/ # AbstractJWKSTokenService, JWKSIssuerTokenService, JWKSVerifierTokenService
|
|
630
|
+
│ ├── strategies/ # JWSAuthenticationStrategy, JWKS*, BasicAuthenticationStrategy, AuthenticationStrategyRegistry
|
|
631
|
+
│ └── component.ts # AuthenticateComponent
|
|
632
|
+
├── base/
|
|
633
|
+
│ └── abstract-auth-registry.ts # AbstractAuthRegistry (shared by authenticate + authorize)
|
|
634
|
+
└── models/
|
|
635
|
+
├── entities/ # extraUserColumns, extraRoleColumns, extraPermissionColumns, extraPolicyDefinitionColumns
|
|
636
|
+
└── requests/ # SignInRequestSchema, SignUpRequestSchema, ChangePasswordRequestSchema
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
## See also
|
|
640
|
+
|
|
641
|
+
- [Overview](./) - guided introduction and common tasks
|
|
642
|
+
- [Usage & Examples](./usage) - securing routes, auth flows, JWKS microservice patterns, API endpoints
|
|
643
|
+
- [Error Reference](./errors) - every error message and how to fix it
|