@venizia/ignis 0.2.0-5 → 0.2.0-50
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 +0 -1
- package/README.md +118 -158
- package/dist/base/applications/base.d.ts +19 -13
- package/dist/base/applications/base.d.ts.map +1 -1
- package/dist/base/applications/base.js +95 -74
- package/dist/base/applications/base.js.map +1 -1
- package/dist/base/applications/boot-steps.d.ts +13 -0
- package/dist/base/applications/boot-steps.d.ts.map +1 -0
- package/dist/base/applications/boot-steps.js +23 -0
- package/dist/base/applications/boot-steps.js.map +1 -0
- package/dist/base/applications/common/index.d.ts +2 -0
- package/dist/base/applications/common/index.d.ts.map +1 -0
- package/dist/base/applications/common/index.js +18 -0
- package/dist/base/applications/common/index.js.map +1 -0
- package/dist/base/applications/{types.d.ts → common/types.d.ts} +11 -0
- package/dist/base/applications/common/types.d.ts.map +1 -0
- package/dist/base/applications/common/types.js.map +1 -0
- package/dist/base/applications/index.d.ts +2 -1
- package/dist/base/applications/index.d.ts.map +1 -1
- package/dist/base/applications/index.js +2 -1
- package/dist/base/applications/index.js.map +1 -1
- package/dist/base/applications/server.d.ts +6 -2
- package/dist/base/applications/server.d.ts.map +1 -1
- package/dist/base/applications/server.js +34 -2
- package/dist/base/applications/server.js.map +1 -1
- package/dist/base/controllers/grpc/adapter.d.ts +2 -1
- package/dist/base/controllers/grpc/adapter.d.ts.map +1 -1
- package/dist/base/controllers/grpc/adapter.js +4 -3
- package/dist/base/controllers/grpc/adapter.js.map +1 -1
- package/dist/base/middlewares/app-error/app-error.middleware.d.ts +3 -2
- package/dist/base/middlewares/app-error/app-error.middleware.d.ts.map +1 -1
- package/dist/base/middlewares/app-error/app-error.middleware.js +4 -3
- package/dist/base/middlewares/app-error/app-error.middleware.js.map +1 -1
- package/dist/base/middlewares/request-spy/request-spy.middleware.d.ts +1 -1
- package/dist/base/middlewares/request-spy/request-spy.middleware.d.ts.map +1 -1
- package/dist/base/middlewares/request-spy/request-spy.middleware.js +13 -4
- package/dist/base/middlewares/request-spy/request-spy.middleware.js.map +1 -1
- package/dist/common/constants.d.ts.map +1 -1
- package/dist/common/constants.js +2 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/environments.d.ts +31 -10
- package/dist/common/environments.d.ts.map +1 -1
- package/dist/common/environments.js +33 -10
- package/dist/common/environments.js.map +1 -1
- package/dist/components/api-reference/component.d.ts.map +1 -1
- package/dist/components/api-reference/component.js +4 -3
- package/dist/components/api-reference/component.js.map +1 -1
- package/dist/components/api-reference/index.d.ts +1 -1
- package/dist/components/api-reference/index.d.ts.map +1 -1
- package/dist/components/api-reference/index.js +1 -1
- package/dist/components/api-reference/index.js.map +1 -1
- package/dist/components/api-reference/ui/factory.d.ts +14 -0
- package/dist/components/api-reference/ui/factory.d.ts.map +1 -0
- package/dist/components/api-reference/{ui-factory.js → ui/factory.js} +12 -25
- package/dist/components/api-reference/ui/factory.js.map +1 -0
- package/dist/components/api-reference/ui/index.d.ts +4 -0
- package/dist/components/api-reference/ui/index.d.ts.map +1 -0
- package/dist/components/api-reference/ui/index.js +20 -0
- package/dist/components/api-reference/ui/index.js.map +1 -0
- package/dist/components/api-reference/ui/scalar.d.ts +8 -0
- package/dist/components/api-reference/ui/scalar.d.ts.map +1 -0
- package/dist/components/api-reference/ui/scalar.js +28 -0
- package/dist/components/api-reference/ui/scalar.js.map +1 -0
- package/dist/components/api-reference/ui/swagger.d.ts +8 -0
- package/dist/components/api-reference/ui/swagger.d.ts.map +1 -0
- package/dist/components/api-reference/ui/swagger.js +28 -0
- package/dist/components/api-reference/ui/swagger.js.map +1 -0
- package/dist/components/auth/authenticate/component.d.ts +5 -0
- package/dist/components/auth/authenticate/component.d.ts.map +1 -1
- package/dist/components/auth/authenticate/component.js +23 -0
- package/dist/components/auth/authenticate/component.js.map +1 -1
- package/dist/components/auth/authenticate/controllers/factory.d.ts +35 -3
- package/dist/components/auth/authenticate/controllers/factory.d.ts.map +1 -1
- package/dist/components/auth/authenticate/controllers/jwks/definitions.d.ts +40 -20
- package/dist/components/auth/authenticate/controllers/jwks/definitions.d.ts.map +1 -1
- package/dist/components/auth/authenticate/controllers/service-certs/definitions.d.ts +40 -20
- package/dist/components/auth/authenticate/controllers/service-certs/definitions.d.ts.map +1 -1
- package/dist/components/auth/authenticate/services/bearer/jwks/issuer.service.d.ts +2 -2
- package/dist/components/auth/authenticate/services/bearer/jwks/issuer.service.d.ts.map +1 -1
- package/dist/components/auth/authenticate/services/bearer/jwks/issuer.service.js +12 -8
- package/dist/components/auth/authenticate/services/bearer/jwks/issuer.service.js.map +1 -1
- package/dist/components/auth/authenticate/services/bearer/jwks/verifier.service.d.ts +1 -1
- package/dist/components/auth/authenticate/services/bearer/jwks/verifier.service.d.ts.map +1 -1
- package/dist/components/auth/authenticate/services/bearer/jwks/verifier.service.js +5 -3
- package/dist/components/auth/authenticate/services/bearer/jwks/verifier.service.js.map +1 -1
- package/dist/components/auth/authenticate/services/bearer/jws.service.d.ts +1 -2
- package/dist/components/auth/authenticate/services/bearer/jws.service.d.ts.map +1 -1
- package/dist/components/auth/authenticate/services/bearer/jws.service.js +5 -3
- package/dist/components/auth/authenticate/services/bearer/jws.service.js.map +1 -1
- package/dist/components/auth/authenticate/services/jose-loader.d.ts +16 -0
- package/dist/components/auth/authenticate/services/jose-loader.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/jose-loader.js +25 -0
- package/dist/components/auth/authenticate/services/jose-loader.js.map +1 -0
- package/dist/components/auth/authenticate/services/service/signer.service.d.ts.map +1 -1
- package/dist/components/auth/authenticate/services/service/signer.service.js +8 -5
- package/dist/components/auth/authenticate/services/service/signer.service.js.map +1 -1
- package/dist/components/auth/authenticate/services/service/verifier.service.d.ts.map +1 -1
- package/dist/components/auth/authenticate/services/service/verifier.service.js +19 -14
- package/dist/components/auth/authenticate/services/service/verifier.service.js.map +1 -1
- package/dist/components/auth/authenticate/strategies/index.d.ts +1 -1
- package/dist/components/auth/authenticate/strategies/index.d.ts.map +1 -1
- package/dist/components/auth/authenticate/strategies/index.js +1 -1
- package/dist/components/auth/authenticate/strategies/index.js.map +1 -1
- package/dist/components/auth/authenticate/strategies/jwks/index.d.ts +3 -0
- package/dist/components/auth/authenticate/strategies/jwks/index.d.ts.map +1 -0
- package/dist/components/auth/authenticate/strategies/jwks/index.js +19 -0
- package/dist/components/auth/authenticate/strategies/jwks/index.js.map +1 -0
- package/dist/components/auth/authenticate/strategies/jwks/issuer.d.ts +13 -0
- package/dist/components/auth/authenticate/strategies/jwks/issuer.d.ts.map +1 -0
- package/dist/components/auth/authenticate/strategies/{jwks.strategy.js → jwks/issuer.js} +4 -27
- package/dist/components/auth/authenticate/strategies/jwks/issuer.js.map +1 -0
- package/dist/components/auth/authenticate/strategies/{jwks.strategy.d.ts → jwks/verifier.d.ts} +2 -10
- package/dist/components/auth/authenticate/strategies/jwks/verifier.d.ts.map +1 -0
- package/dist/components/auth/authenticate/strategies/jwks/verifier.js +45 -0
- package/dist/components/auth/authenticate/strategies/jwks/verifier.js.map +1 -0
- package/dist/components/auth/authorize/adapters/base-filtered.d.ts +1 -1
- package/dist/components/auth/authorize/adapters/base-filtered.d.ts.map +1 -1
- package/dist/components/auth/authorize/adapters/base-filtered.js +5 -8
- package/dist/components/auth/authorize/adapters/base-filtered.js.map +1 -1
- package/dist/components/auth/authorize/adapters/common/index.d.ts +2 -0
- package/dist/components/auth/authorize/adapters/common/index.d.ts.map +1 -0
- package/dist/components/auth/authorize/adapters/common/index.js +18 -0
- package/dist/components/auth/authorize/adapters/common/index.js.map +1 -0
- package/dist/components/auth/authorize/adapters/{types.d.ts → common/types.d.ts} +1 -1
- package/dist/components/auth/authorize/adapters/common/types.d.ts.map +1 -0
- package/dist/components/auth/authorize/adapters/common/types.js.map +1 -0
- package/dist/components/auth/authorize/adapters/connector.d.ts +10 -0
- package/dist/components/auth/authorize/adapters/connector.d.ts.map +1 -0
- package/dist/components/auth/authorize/adapters/connector.js +20 -0
- package/dist/components/auth/authorize/adapters/connector.js.map +1 -0
- package/dist/components/auth/authorize/adapters/custom-grant-expander.d.ts +52 -0
- package/dist/components/auth/authorize/adapters/custom-grant-expander.d.ts.map +1 -0
- package/dist/components/auth/authorize/adapters/custom-grant-expander.js +111 -0
- package/dist/components/auth/authorize/adapters/custom-grant-expander.js.map +1 -0
- package/dist/components/auth/authorize/adapters/index.d.ts +4 -2
- package/dist/components/auth/authorize/adapters/index.d.ts.map +1 -1
- package/dist/components/auth/authorize/adapters/index.js +4 -2
- package/dist/components/auth/authorize/adapters/index.js.map +1 -1
- package/dist/components/auth/authorize/adapters/scoped-casbin/adapter.d.ts +93 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/adapter.d.ts.map +1 -0
- package/dist/components/auth/authorize/adapters/{scoped-casbin.adapter.js → scoped-casbin/adapter.js} +95 -97
- package/dist/components/auth/authorize/adapters/scoped-casbin/adapter.js.map +1 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/common/constants.d.ts +2 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/common/constants.d.ts.map +1 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/common/constants.js +5 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/common/constants.js.map +1 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/common/index.d.ts +3 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/common/index.d.ts.map +1 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/common/index.js +19 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/common/index.js.map +1 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/common/types.d.ts +50 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/common/types.d.ts.map +1 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/common/types.js +3 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/common/types.js.map +1 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/index.d.ts +4 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/index.d.ts.map +1 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/index.js +19 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/index.js.map +1 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/policy-edges.d.ts +17 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/policy-edges.d.ts.map +1 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/policy-edges.js +11 -0
- package/dist/components/auth/authorize/adapters/scoped-casbin/policy-edges.js.map +1 -0
- package/dist/components/auth/authorize/component.d.ts.map +1 -1
- package/dist/components/auth/authorize/component.js +3 -0
- package/dist/components/auth/authorize/component.js.map +1 -1
- package/dist/components/auth/authorize/enforcers/casbin.enforcer.d.ts +7 -36
- package/dist/components/auth/authorize/enforcers/casbin.enforcer.d.ts.map +1 -1
- package/dist/components/auth/authorize/enforcers/casbin.enforcer.js +48 -117
- package/dist/components/auth/authorize/enforcers/casbin.enforcer.js.map +1 -1
- package/dist/components/auth/authorize/enforcers/index.d.ts +2 -1
- package/dist/components/auth/authorize/enforcers/index.d.ts.map +1 -1
- package/dist/components/auth/authorize/enforcers/index.js +2 -1
- package/dist/components/auth/authorize/enforcers/index.js.map +1 -1
- package/dist/components/auth/authorize/enforcers/policy-line-codec.d.ts +26 -0
- package/dist/components/auth/authorize/enforcers/policy-line-codec.d.ts.map +1 -0
- package/dist/components/auth/authorize/enforcers/policy-line-codec.js +59 -0
- package/dist/components/auth/authorize/enforcers/policy-line-codec.js.map +1 -0
- package/dist/components/auth/authorize/enforcers/user-policy-line-cache.d.ts +46 -0
- package/dist/components/auth/authorize/enforcers/user-policy-line-cache.d.ts.map +1 -0
- package/dist/components/auth/authorize/enforcers/user-policy-line-cache.js +98 -0
- package/dist/components/auth/authorize/enforcers/user-policy-line-cache.js.map +1 -0
- package/dist/components/auth/authorize/index.d.ts +1 -0
- package/dist/components/auth/authorize/index.d.ts.map +1 -1
- package/dist/components/auth/authorize/index.js +1 -0
- package/dist/components/auth/authorize/index.js.map +1 -1
- package/dist/components/auth/authorize/role-managers/base.d.ts +34 -0
- package/dist/components/auth/authorize/role-managers/base.d.ts.map +1 -0
- package/dist/components/auth/authorize/role-managers/base.js +77 -0
- package/dist/components/auth/authorize/role-managers/base.js.map +1 -0
- package/dist/components/auth/authorize/role-managers/domain-hierarchy.d.ts +28 -0
- package/dist/components/auth/authorize/role-managers/domain-hierarchy.d.ts.map +1 -0
- package/dist/components/auth/authorize/role-managers/domain-hierarchy.js +77 -0
- package/dist/components/auth/authorize/role-managers/domain-hierarchy.js.map +1 -0
- package/dist/components/auth/authorize/role-managers/index.d.ts +5 -0
- package/dist/components/auth/authorize/role-managers/index.d.ts.map +1 -0
- package/dist/components/auth/authorize/role-managers/index.js +21 -0
- package/dist/components/auth/authorize/role-managers/index.js.map +1 -0
- package/dist/components/auth/authorize/role-managers/membership.d.ts +21 -0
- package/dist/components/auth/authorize/role-managers/membership.d.ts.map +1 -0
- package/dist/components/auth/authorize/role-managers/membership.js +69 -0
- package/dist/components/auth/authorize/role-managers/membership.js.map +1 -0
- package/dist/components/auth/authorize/{enforcers/resource-role-manager.d.ts → role-managers/resource.d.ts} +3 -9
- package/dist/components/auth/authorize/role-managers/resource.d.ts.map +1 -0
- package/dist/components/auth/authorize/{enforcers/resource-role-manager.js → role-managers/resource.js} +9 -21
- package/dist/components/auth/authorize/role-managers/resource.js.map +1 -0
- package/dist/components/auth/models/entities/policy-definition.model.d.ts +49 -14
- package/dist/components/auth/models/entities/policy-definition.model.d.ts.map +1 -1
- package/dist/components/auth/models/entities/policy-definition.model.js +45 -11
- package/dist/components/auth/models/entities/policy-definition.model.js.map +1 -1
- package/dist/components/auth/models/entities/user.model.d.ts +2 -2
- package/dist/components/controller/grpc/grpc.component.d.ts.map +1 -1
- package/dist/components/controller/grpc/grpc.component.js +1 -5
- package/dist/components/controller/grpc/grpc.component.js.map +1 -1
- package/dist/components/health-check/common/constants.d.ts +5 -0
- package/dist/components/health-check/common/constants.d.ts.map +1 -0
- package/dist/components/health-check/common/constants.js +9 -0
- package/dist/components/health-check/common/constants.js.map +1 -0
- package/dist/components/health-check/common/index.d.ts +1 -0
- package/dist/components/health-check/common/index.d.ts.map +1 -1
- package/dist/components/health-check/common/index.js +1 -0
- package/dist/components/health-check/common/index.js.map +1 -1
- package/dist/components/health-check/common/keys.d.ts +2 -0
- package/dist/components/health-check/common/keys.d.ts.map +1 -1
- package/dist/components/health-check/common/keys.js +2 -0
- package/dist/components/health-check/common/keys.js.map +1 -1
- package/dist/components/health-check/common/rest-paths.d.ts +1 -0
- package/dist/components/health-check/common/rest-paths.d.ts.map +1 -1
- package/dist/components/health-check/common/rest-paths.js +1 -0
- package/dist/components/health-check/common/rest-paths.js.map +1 -1
- package/dist/components/health-check/common/types.d.ts +22 -0
- package/dist/components/health-check/common/types.d.ts.map +1 -1
- package/dist/components/health-check/component.d.ts +9 -3
- package/dist/components/health-check/component.d.ts.map +1 -1
- package/dist/components/health-check/component.js +38 -1
- package/dist/components/health-check/component.js.map +1 -1
- package/dist/components/health-check/controller.d.ts +10 -2
- package/dist/components/health-check/controller.d.ts.map +1 -1
- package/dist/components/health-check/controller.js +79 -13
- package/dist/components/health-check/controller.js.map +1 -1
- package/dist/components/health-check/index.d.ts +1 -0
- package/dist/components/health-check/index.d.ts.map +1 -1
- package/dist/components/health-check/index.js +1 -0
- package/dist/components/health-check/index.js.map +1 -1
- package/dist/components/health-check/reporter.d.ts +98 -0
- package/dist/components/health-check/reporter.d.ts.map +1 -0
- package/dist/components/health-check/reporter.js +138 -0
- package/dist/components/health-check/reporter.js.map +1 -0
- package/dist/components/mail/common/constants.d.ts +8 -0
- package/dist/components/mail/common/constants.d.ts.map +1 -1
- package/dist/components/mail/common/constants.js +9 -1
- package/dist/components/mail/common/constants.js.map +1 -1
- package/dist/components/mail/common/types/index.d.ts +6 -0
- package/dist/components/mail/common/types/index.d.ts.map +1 -0
- package/dist/components/mail/common/types/index.js +22 -0
- package/dist/components/mail/common/types/index.js.map +1 -0
- package/dist/components/mail/common/types/message.d.ts +49 -0
- package/dist/components/mail/common/types/message.d.ts.map +1 -0
- package/dist/components/mail/common/types/message.js +3 -0
- package/dist/components/mail/common/types/message.js.map +1 -0
- package/dist/components/mail/common/types/options.d.ts +65 -0
- package/dist/components/mail/common/types/options.d.ts.map +1 -0
- package/dist/components/mail/common/types/options.js +3 -0
- package/dist/components/mail/common/types/options.js.map +1 -0
- package/dist/components/mail/common/types/queue.d.ts +56 -0
- package/dist/components/mail/common/types/queue.d.ts.map +1 -0
- package/dist/components/mail/common/types/queue.js +3 -0
- package/dist/components/mail/common/types/queue.js.map +1 -0
- package/dist/components/mail/common/types/template.d.ts +33 -0
- package/dist/components/mail/common/types/template.d.ts.map +1 -0
- package/dist/components/mail/common/types/template.js +3 -0
- package/dist/components/mail/common/types/template.js.map +1 -0
- package/dist/components/mail/common/types/verification.d.ts +26 -0
- package/dist/components/mail/common/types/verification.d.ts.map +1 -0
- package/dist/components/mail/common/types/verification.js +3 -0
- package/dist/components/mail/common/types/verification.js.map +1 -0
- package/dist/components/mail/component.d.ts +4 -1
- package/dist/components/mail/component.d.ts.map +1 -1
- package/dist/components/mail/component.js +12 -0
- package/dist/components/mail/component.js.map +1 -1
- package/dist/components/mail/helpers/executors/bull-mq-executor.helper.d.ts +1 -0
- package/dist/components/mail/helpers/executors/bull-mq-executor.helper.d.ts.map +1 -1
- package/dist/components/mail/helpers/executors/bull-mq-executor.helper.js +3 -0
- package/dist/components/mail/helpers/executors/bull-mq-executor.helper.js.map +1 -1
- package/dist/components/mail/helpers/executors/internal-queue-executor.helper.d.ts.map +1 -1
- package/dist/components/mail/helpers/executors/internal-queue-executor.helper.js +2 -1
- package/dist/components/mail/helpers/executors/internal-queue-executor.helper.js.map +1 -1
- package/dist/components/mail/helpers/transporters/amazon-ses-transporter.helper.d.ts +19 -0
- package/dist/components/mail/helpers/transporters/amazon-ses-transporter.helper.d.ts.map +1 -0
- package/dist/components/mail/helpers/transporters/amazon-ses-transporter.helper.js +112 -0
- package/dist/components/mail/helpers/transporters/amazon-ses-transporter.helper.js.map +1 -0
- package/dist/components/mail/helpers/transporters/index.d.ts +2 -1
- package/dist/components/mail/helpers/transporters/index.d.ts.map +1 -1
- package/dist/components/mail/helpers/transporters/index.js +2 -1
- package/dist/components/mail/helpers/transporters/index.js.map +1 -1
- package/dist/components/mail/helpers/transporters/mailgun-transporter.helper.d.ts.map +1 -1
- package/dist/components/mail/helpers/transporters/mailgun-transporter.helper.js +4 -3
- package/dist/components/mail/helpers/transporters/mailgun-transporter.helper.js.map +1 -1
- package/dist/components/mail/providers/mail-transporter.provider.d.ts +2 -0
- package/dist/components/mail/providers/mail-transporter.provider.d.ts.map +1 -1
- package/dist/components/mail/providers/mail-transporter.provider.js +35 -17
- package/dist/components/mail/providers/mail-transporter.provider.js.map +1 -1
- package/dist/components/mail/services/generators/index.d.ts +4 -0
- package/dist/components/mail/services/generators/index.d.ts.map +1 -0
- package/dist/components/mail/services/generators/index.js +20 -0
- package/dist/components/mail/services/generators/index.js.map +1 -0
- package/dist/components/mail/services/generators/numeric-code.d.ts +7 -0
- package/dist/components/mail/services/generators/numeric-code.d.ts.map +1 -0
- package/dist/components/mail/services/generators/numeric-code.js +20 -0
- package/dist/components/mail/services/generators/numeric-code.js.map +1 -0
- package/dist/components/mail/services/generators/random-token.d.ts +7 -0
- package/dist/components/mail/services/generators/random-token.d.ts.map +1 -0
- package/dist/components/mail/services/generators/random-token.js +18 -0
- package/dist/components/mail/services/generators/random-token.js.map +1 -0
- package/dist/components/mail/services/generators/verification-data.d.ts +9 -0
- package/dist/components/mail/services/generators/verification-data.d.ts.map +1 -0
- package/dist/components/mail/services/{generator.service.js → generators/verification-data.js} +10 -25
- package/dist/components/mail/services/generators/verification-data.js.map +1 -0
- package/dist/components/mail/services/index.d.ts +1 -1
- package/dist/components/mail/services/index.d.ts.map +1 -1
- package/dist/components/mail/services/index.js +1 -1
- package/dist/components/mail/services/index.js.map +1 -1
- package/dist/components/mail/services/mail.service.d.ts.map +1 -1
- package/dist/components/mail/services/mail.service.js +18 -17
- package/dist/components/mail/services/mail.service.js.map +1 -1
- package/dist/components/mail/utilities/address.utility.d.ts +9 -0
- package/dist/components/mail/utilities/address.utility.d.ts.map +1 -0
- package/dist/components/mail/utilities/address.utility.js +36 -0
- package/dist/components/mail/utilities/address.utility.js.map +1 -0
- package/dist/components/mail/utilities/index.d.ts +2 -0
- package/dist/components/mail/utilities/index.d.ts.map +1 -1
- package/dist/components/mail/utilities/index.js +2 -0
- package/dist/components/mail/utilities/index.js.map +1 -1
- package/dist/components/mail/utilities/mime.utility.d.ts +19 -0
- package/dist/components/mail/utilities/mime.utility.d.ts.map +1 -0
- package/dist/components/mail/utilities/mime.utility.js +414 -0
- package/dist/components/mail/utilities/mime.utility.js.map +1 -0
- package/dist/components/static-asset/common/commit-token.d.ts +23 -0
- package/dist/components/static-asset/common/commit-token.d.ts.map +1 -0
- package/dist/components/static-asset/common/commit-token.js +40 -0
- package/dist/components/static-asset/common/commit-token.js.map +1 -0
- package/dist/components/static-asset/common/constants.d.ts +13 -1
- package/dist/components/static-asset/common/constants.d.ts.map +1 -1
- package/dist/components/static-asset/common/constants.js +29 -2
- package/dist/components/static-asset/common/constants.js.map +1 -1
- package/dist/components/static-asset/common/errors.d.ts +43 -0
- package/dist/components/static-asset/common/errors.d.ts.map +1 -1
- package/dist/components/static-asset/common/errors.js +37 -0
- package/dist/components/static-asset/common/errors.js.map +1 -1
- package/dist/components/static-asset/common/index.d.ts +1 -0
- package/dist/components/static-asset/common/index.d.ts.map +1 -1
- package/dist/components/static-asset/common/index.js +1 -0
- package/dist/components/static-asset/common/index.js.map +1 -1
- package/dist/components/static-asset/common/keys.d.ts +1 -0
- package/dist/components/static-asset/common/keys.d.ts.map +1 -1
- package/dist/components/static-asset/common/keys.js +1 -0
- package/dist/components/static-asset/common/keys.js.map +1 -1
- package/dist/components/static-asset/common/types.d.ts +87 -30
- package/dist/components/static-asset/common/types.d.ts.map +1 -1
- package/dist/components/static-asset/component.d.ts +4 -1
- package/dist/components/static-asset/component.d.ts.map +1 -1
- package/dist/components/static-asset/component.js +21 -10
- package/dist/components/static-asset/component.js.map +1 -1
- package/dist/components/static-asset/controller/base.definition.d.ts +27 -554
- package/dist/components/static-asset/controller/base.definition.d.ts.map +1 -1
- package/dist/components/static-asset/controller/base.definition.js +250 -286
- package/dist/components/static-asset/controller/base.definition.js.map +1 -1
- package/dist/components/static-asset/controller/factory.d.ts +76 -7
- package/dist/components/static-asset/controller/factory.d.ts.map +1 -1
- package/dist/components/static-asset/controller/factory.js +565 -138
- package/dist/components/static-asset/controller/factory.js.map +1 -1
- package/dist/components/static-asset/index.d.ts +1 -0
- package/dist/components/static-asset/index.d.ts.map +1 -1
- package/dist/components/static-asset/index.js +1 -0
- package/dist/components/static-asset/index.js.map +1 -1
- package/dist/components/static-asset/ingest.d.ts +58 -0
- package/dist/components/static-asset/ingest.d.ts.map +1 -0
- package/dist/components/static-asset/ingest.js +82 -0
- package/dist/components/static-asset/ingest.js.map +1 -0
- package/dist/components/static-asset/models/base.model.d.ts +44 -6
- package/dist/components/static-asset/models/base.model.d.ts.map +1 -1
- package/dist/components/static-asset/models/base.model.js +7 -1
- package/dist/components/static-asset/models/base.model.js.map +1 -1
- package/dist/components/websocket/handlers/bun.handler.d.ts.map +1 -1
- package/dist/components/websocket/handlers/bun.handler.js +2 -1
- package/dist/components/websocket/handlers/bun.handler.js.map +1 -1
- package/dist/connectors/postgres/drivers/postgres-js.d.mts +3 -0
- package/dist/connectors/postgres/drivers/postgres-js.d.mts.map +1 -0
- package/dist/connectors/postgres/drivers/postgres-js.mjs +3 -0
- package/dist/connectors/postgres/drivers/postgres-js.mjs.map +1 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +29 -26
- package/dist/base/applications/types.d.ts.map +0 -1
- package/dist/base/applications/types.js.map +0 -1
- package/dist/components/api-reference/ui-factory.d.ts +0 -21
- package/dist/components/api-reference/ui-factory.d.ts.map +0 -1
- package/dist/components/api-reference/ui-factory.js.map +0 -1
- package/dist/components/auth/authenticate/strategies/jwks.strategy.d.ts.map +0 -1
- package/dist/components/auth/authenticate/strategies/jwks.strategy.js.map +0 -1
- package/dist/components/auth/authorize/adapters/scoped-casbin.adapter.d.ts +0 -121
- package/dist/components/auth/authorize/adapters/scoped-casbin.adapter.d.ts.map +0 -1
- package/dist/components/auth/authorize/adapters/scoped-casbin.adapter.js.map +0 -1
- package/dist/components/auth/authorize/adapters/types.d.ts.map +0 -1
- package/dist/components/auth/authorize/adapters/types.js.map +0 -1
- package/dist/components/auth/authorize/enforcers/resource-role-manager.d.ts.map +0 -1
- package/dist/components/auth/authorize/enforcers/resource-role-manager.js.map +0 -1
- package/dist/components/mail/common/types.d.ts +0 -201
- package/dist/components/mail/common/types.d.ts.map +0 -1
- package/dist/components/mail/common/types.js +0 -10
- package/dist/components/mail/common/types.js.map +0 -1
- package/dist/components/mail/services/generator.service.d.ts +0 -14
- package/dist/components/mail/services/generator.service.d.ts.map +0 -1
- package/dist/components/mail/services/generator.service.js.map +0 -1
- /package/dist/base/applications/{types.js → common/types.js} +0 -0
- /package/dist/components/auth/authorize/adapters/{types.js → common/types.js} +0 -0
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BaseFilteredAdapter = void 0;
|
|
4
4
|
const utilities_1 = require("../../../../utilities");
|
|
5
5
|
const core_1 = require("@venizia/ignis-helpers/core");
|
|
6
|
+
const connector_1 = require("./connector");
|
|
6
7
|
/** Read-only base for casbin FilteredAdapters backed by a datasource - owns connector plumbing and no-op write methods; subclasses implement {@link loadFilteredPolicy} per principal. */
|
|
7
8
|
class BaseFilteredAdapter extends core_1.BaseHelper {
|
|
8
9
|
constructor(opts) {
|
|
@@ -10,14 +11,10 @@ class BaseFilteredAdapter extends core_1.BaseHelper {
|
|
|
10
11
|
this.dataSource = opts.dataSource;
|
|
11
12
|
}
|
|
12
13
|
get connector() {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
message: '[BaseFilteredAdapter] datasource exposes neither a getConnector() accessor nor a wired connector - pass a datasource whose getConnector() lazily wires the driver.',
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return resolved;
|
|
14
|
+
return connector_1.PolicyConnectorResolver.resolve({
|
|
15
|
+
source: this.dataSource,
|
|
16
|
+
caller: 'BaseFilteredAdapter',
|
|
17
|
+
});
|
|
21
18
|
}
|
|
22
19
|
/** Runs a raw statement and returns its rows. Drizzle's `execute()` shape differs per driver (node-postgres `{ rows }`, postgres-js the row list itself) - never read `.rows` directly. */
|
|
23
20
|
async query(opts) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-filtered.js","sourceRoot":"","sources":["../../../../../src/components/auth/authorize/adapters/base-filtered.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAC7C,
|
|
1
|
+
{"version":3,"file":"base-filtered.js","sourceRoot":"","sources":["../../../../../src/components/auth/authorize/adapters/base-filtered.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAC7C,sDAAyD;AAGzD,2CAAsD;AAGtD,0LAA0L;AAC1L,MAAsB,mBACpB,SAAQ,iBAAU;IAKlB,YAAY,IAAwD;QAClE,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACpC,CAAC;IAED,IAAc,SAAS;QACrB,OAAO,mCAAuB,CAAC,OAAO,CAAC;YACrC,MAAM,EAAE,IAAI,CAAC,UAAU;YACvB,MAAM,EAAE,qBAAqB;SAC9B,CAAC,CAAC;IACL,CAAC;IAED,2LAA2L;IACjL,KAAK,CAAC,KAAK,CAAO,IAAwB;QAClD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC5D,OAAO,IAAA,0BAAc,EAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAC1C,CAAC;IAKD,UAAU;QACR,OAAO,IAAI,CAAC;IACd,CAAC;IAED,4DAA4D;IAC5D,KAAK,CAAC,UAAU,KAAmB,CAAC;IACpC,KAAK,CAAC,UAAU;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IACD,KAAK,CAAC,SAAS,KAAmB,CAAC;IACnC,KAAK,CAAC,YAAY,KAAmB,CAAC;IACtC,KAAK,CAAC,oBAAoB,KAAmB,CAAC;IAE9C,+FAA+F;IACrF,KAAK,CAAC,SAAS,CAAC,IAAuC;QAC/D,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC1C,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC9B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;CACF;AA/CD,kDA+CC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/auth/authorize/adapters/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/auth/authorize/adapters/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IdType } from '
|
|
1
|
+
import type { IdType } from '../../../../../base';
|
|
2
2
|
import type { AnyType } from '@venizia/ignis-helpers/common';
|
|
3
3
|
import type { PgDatabase, PgQueryResultHKT } from 'drizzle-orm/pg-core';
|
|
4
4
|
/** Filter passed to loadFilteredPolicy: which principal's policies to load. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/auth/authorize/adapters/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAExE,+EAA+E;AAC/E,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CACzC;AAED,oPAAoP;AACpP,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAE3F,0FAA0F;AAC1F,MAAM,WAAW,mBAAmB;IAClC,2GAA2G;IAC3G,YAAY,CAAC,IAAI,sBAAsB,CAAC;IAExC,oFAAoF;IACpF,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACpC;AAED,4DAA4D;AAC5D,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wGAAwG;AACxG,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,EAAE,kBAAkB,GAAG;QACrC,QAAQ,CAAC,EAAE;YAAE,UAAU,EAAE,MAAM,CAAA;SAAE,CAAC;KACnC,CAAC;IAEF,0CAA0C;IAC1C,UAAU,EAAE,kBAAkB,CAAC;IAE/B,0DAA0D;IAC1D,UAAU,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAE3C,2DAA2D;IAC3D,WAAW,EAAE,MAAM,EAAE,CAAC;IAEtB,4CAA4C;IAC5C,UAAU,CAAC,EAAE;QAAE,GAAG,EAAE,KAAK,CAAA;KAAE,GAAG;QAAE,GAAG,EAAE,IAAI,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;CACjE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/components/auth/authorize/adapters/common/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ICasbinPolicySource, TCasbinPolicyConnector } from './common';
|
|
2
|
+
/** Connector-resolution logic shared by every adapter/loader reading the casbin policy store. */
|
|
3
|
+
export declare class PolicyConnectorResolver {
|
|
4
|
+
/** Resolve the wired connector off a policy datasource. */
|
|
5
|
+
static resolve(opts: {
|
|
6
|
+
source: ICasbinPolicySource;
|
|
7
|
+
caller: string;
|
|
8
|
+
}): TCasbinPolicyConnector;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=connector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../../../src/components/auth/authorize/adapters/connector.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAE5E,iGAAiG;AACjG,qBAAa,uBAAuB;IAClC,2DAA2D;IAC3D,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,mBAAmB,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,sBAAsB;CAY9F"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PolicyConnectorResolver = void 0;
|
|
4
|
+
const core_1 = require("@venizia/ignis-helpers/core");
|
|
5
|
+
/** Connector-resolution logic shared by every adapter/loader reading the casbin policy store. */
|
|
6
|
+
class PolicyConnectorResolver {
|
|
7
|
+
/** Resolve the wired connector off a policy datasource. */
|
|
8
|
+
static resolve(opts) {
|
|
9
|
+
const { source, caller } = opts;
|
|
10
|
+
const resolved = source.getConnector?.() ?? source.connector;
|
|
11
|
+
if (!resolved) {
|
|
12
|
+
throw (0, core_1.getError)({
|
|
13
|
+
message: `[${caller}] datasource exposes neither a getConnector() accessor nor a wired connector - pass a datasource whose getConnector() lazily wires the driver.`,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return resolved;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.PolicyConnectorResolver = PolicyConnectorResolver;
|
|
20
|
+
//# sourceMappingURL=connector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connector.js","sourceRoot":"","sources":["../../../../../src/components/auth/authorize/adapters/connector.ts"],"names":[],"mappings":";;;AAAA,sDAAuD;AAGvD,iGAAiG;AACjG,MAAa,uBAAuB;IAClC,2DAA2D;IAC3D,MAAM,CAAC,OAAO,CAAC,IAAqD;QAClE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAChC,MAAM,QAAQ,GAAG,MAAM,CAAC,YAAY,EAAE,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC;QAE7D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAA,eAAQ,EAAC;gBACb,OAAO,EAAE,IAAI,MAAM,gJAAgJ;aACpK,CAAC,CAAC;QACL,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAdD,0DAcC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { IdType } from '../../../../base';
|
|
2
|
+
import { BaseHelper } from '@venizia/ignis-helpers/core';
|
|
3
|
+
import { type TCustomGrantMetadata } from '@venizia/ignis-kernel';
|
|
4
|
+
import type { ICasbinPolicySource, IScopedCasbinEntities } from './common';
|
|
5
|
+
/** A custom row that survived {@link CustomGrantExpander.rejectCustomRow}, ready for op-to-catalog resolution. */
|
|
6
|
+
export type TCustomGrantRow = {
|
|
7
|
+
subjectId: IdType;
|
|
8
|
+
objectSubject: string;
|
|
9
|
+
ops: string[];
|
|
10
|
+
domain: string;
|
|
11
|
+
effect: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Expands "custom" operation-subset grants (`metadata.ops`) into one casbin line per catalogued
|
|
15
|
+
* operation. Isolated from the filtered-policy loader on purpose: it owns its own SQL
|
|
16
|
+
* (`queryOperationCatalog`) and error vocabulary, and never reaches back into ScopedCasbinAdapter.
|
|
17
|
+
*/
|
|
18
|
+
export declare class CustomGrantExpander extends BaseHelper {
|
|
19
|
+
protected readonly dataSource: ICasbinPolicySource;
|
|
20
|
+
protected readonly permission: IScopedCasbinEntities['permission'];
|
|
21
|
+
protected readonly softDelete: IScopedCasbinEntities['softDelete'];
|
|
22
|
+
constructor(opts: {
|
|
23
|
+
dataSource: ICasbinPolicySource;
|
|
24
|
+
entities: Pick<IScopedCasbinEntities, 'permission' | 'softDelete'>;
|
|
25
|
+
});
|
|
26
|
+
/** Why a custom-looking grant row cannot be honoured, or null when it is well formed. */
|
|
27
|
+
rejectCustomRow(opts: {
|
|
28
|
+
row: {
|
|
29
|
+
subjectId: IdType;
|
|
30
|
+
objectCode: string;
|
|
31
|
+
objectMethod: string;
|
|
32
|
+
};
|
|
33
|
+
parsed: TCustomGrantMetadata | null;
|
|
34
|
+
isCustomAction: boolean;
|
|
35
|
+
metadataColumnName?: string;
|
|
36
|
+
}): string | null;
|
|
37
|
+
/** Resolve every custom row's ops in one catalog query, then emit one line per resolved operation. Unresolvable ops come back as `rejections` rather than being logged here - the caller owns the logger the tests swap. */
|
|
38
|
+
expandCustomGrants(opts: {
|
|
39
|
+
subjectType: string;
|
|
40
|
+
customRows: TCustomGrantRow[];
|
|
41
|
+
}): Promise<{
|
|
42
|
+
lines: string[];
|
|
43
|
+
rejections: string[];
|
|
44
|
+
}>;
|
|
45
|
+
/** Schema-qualified table reference (`"<schema>"."<table>"`) for use after FROM/JOIN with an alias. */
|
|
46
|
+
private qualifiedTable;
|
|
47
|
+
/** `AND <alias>.<col> IS NULL` when soft-delete is on, else empty. The alias is emitted raw to match the unquoted FROM alias - quoting folds it to a different case and breaks the join. */
|
|
48
|
+
private softDeleteClause;
|
|
49
|
+
/** Resolve `(subject, method)` pairs to catalogued operations. One query for the whole extraction. */
|
|
50
|
+
private queryOperationCatalog;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=custom-grant-expander.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-grant-expander.d.ts","sourceRoot":"","sources":["../../../../../src/components/auth/authorize/adapters/custom-grant-expander.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,EA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KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,UAAU,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAoDtD,uGAAuG;IACvG,OAAO,CAAC,cAAc;IAMtB,4LAA4L;IAC5L,OAAO,CAAC,gBAAgB;IASxB,sGAAsG;YACxF,qBAAqB;CA6BpC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomGrantExpander = void 0;
|
|
4
|
+
const utilities_1 = require("../../../../utilities");
|
|
5
|
+
const core_1 = require("@venizia/ignis-helpers/core");
|
|
6
|
+
const ignis_kernel_1 = require("@venizia/ignis-kernel");
|
|
7
|
+
const drizzle_orm_1 = require("drizzle-orm");
|
|
8
|
+
const connector_1 = require("./connector");
|
|
9
|
+
const DEFAULT_SCHEMA = 'public';
|
|
10
|
+
/**
|
|
11
|
+
* Expands "custom" operation-subset grants (`metadata.ops`) into one casbin line per catalogued
|
|
12
|
+
* operation. Isolated from the filtered-policy loader on purpose: it owns its own SQL
|
|
13
|
+
* (`queryOperationCatalog`) and error vocabulary, and never reaches back into ScopedCasbinAdapter.
|
|
14
|
+
*/
|
|
15
|
+
class CustomGrantExpander extends core_1.BaseHelper {
|
|
16
|
+
constructor(opts) {
|
|
17
|
+
super({ scope: CustomGrantExpander.name });
|
|
18
|
+
this.dataSource = opts.dataSource;
|
|
19
|
+
this.permission = opts.entities.permission;
|
|
20
|
+
this.softDelete = opts.entities.softDelete;
|
|
21
|
+
}
|
|
22
|
+
/** Why a custom-looking grant row cannot be honoured, or null when it is well formed. */
|
|
23
|
+
rejectCustomRow(opts) {
|
|
24
|
+
const { row, parsed, isCustomAction, metadataColumnName } = opts;
|
|
25
|
+
if (isCustomAction && !metadataColumnName) {
|
|
26
|
+
return `Skipping custom grant - entities.policyDefinition.metadata.columnName is not mapped, so metadata.ops cannot be read | subject id: ${row.subjectId} | object: ${row.objectCode}`;
|
|
27
|
+
}
|
|
28
|
+
if (isCustomAction && !parsed) {
|
|
29
|
+
return `Skipping custom grant - metadata.ops is missing, empty, or not an array of non-empty strings | subject id: ${row.subjectId} | object: ${row.objectCode}`;
|
|
30
|
+
}
|
|
31
|
+
if (!isCustomAction && parsed) {
|
|
32
|
+
return `Skipping grant - metadata.ops is present but action is not "${ignis_kernel_1.AuthorizationActions.CUSTOM}", so the intent is ambiguous | subject id: ${row.subjectId} | object: ${row.objectCode}`;
|
|
33
|
+
}
|
|
34
|
+
if (row.objectMethod !== ignis_kernel_1.AuthorizationPermissionBuilder.RESOURCE_NODE_METHOD) {
|
|
35
|
+
return `Skipping custom grant - the target must be a subject-level resource node | subject id: ${row.subjectId} | object: ${row.objectCode}`;
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
/** Resolve every custom row's ops in one catalog query, then emit one line per resolved operation. Unresolvable ops come back as `rejections` rather than being logged here - the caller owns the logger the tests swap. */
|
|
40
|
+
async expandCustomGrants(opts) {
|
|
41
|
+
if (!opts.customRows.length) {
|
|
42
|
+
return { lines: [], rejections: [] };
|
|
43
|
+
}
|
|
44
|
+
const seen = new Set();
|
|
45
|
+
const pairs = [];
|
|
46
|
+
const candidates = opts.customRows.flatMap(row => row.ops.map(op => ({ subject: row.objectSubject, method: op })));
|
|
47
|
+
for (const candidate of candidates) {
|
|
48
|
+
const key = `${candidate.subject}.${candidate.method}`;
|
|
49
|
+
if (seen.has(key)) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
seen.add(key);
|
|
53
|
+
pairs.push(candidate);
|
|
54
|
+
}
|
|
55
|
+
const catalog = await this.queryOperationCatalog({ pairs });
|
|
56
|
+
const byKey = new Map(catalog.map(entry => [`${entry.subject}.${entry.method}`, entry]));
|
|
57
|
+
const lines = [];
|
|
58
|
+
const rejections = [];
|
|
59
|
+
for (const row of opts.customRows) {
|
|
60
|
+
const { valid, unknown } = ignis_kernel_1.GrantBuilder.getInstance().validateCustomGrantOps({
|
|
61
|
+
ops: row.ops,
|
|
62
|
+
subject: row.objectSubject,
|
|
63
|
+
catalog,
|
|
64
|
+
});
|
|
65
|
+
if (unknown.length) {
|
|
66
|
+
rejections.push(`Skipping unresolvable operations in a custom grant | subject id: ${row.subjectId} | resource: ${row.objectSubject} | unknown: ${unknown.join(', ')}`);
|
|
67
|
+
}
|
|
68
|
+
for (const op of valid) {
|
|
69
|
+
const entry = byKey.get(`${row.objectSubject}.${op}`);
|
|
70
|
+
lines.push(`${ignis_kernel_1.AuthorizationPolicyVariants.GRANT.rule}, ${opts.subjectType}_${row.subjectId}, ${row.domain}, ${entry.code}, ${entry.action}, ${row.effect}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return { lines, rejections };
|
|
74
|
+
}
|
|
75
|
+
/** Schema-qualified table reference (`"<schema>"."<table>"`) for use after FROM/JOIN with an alias. */
|
|
76
|
+
qualifiedTable(opts) {
|
|
77
|
+
const { table } = opts;
|
|
78
|
+
const schema = table.schemaName ?? DEFAULT_SCHEMA;
|
|
79
|
+
return (0, drizzle_orm_1.sql) `${drizzle_orm_1.sql.identifier(schema)}.${drizzle_orm_1.sql.identifier(table.tableName)}`;
|
|
80
|
+
}
|
|
81
|
+
/** `AND <alias>.<col> IS NULL` when soft-delete is on, else empty. The alias is emitted raw to match the unquoted FROM alias - quoting folds it to a different case and breaks the join. */
|
|
82
|
+
softDeleteClause(opts) {
|
|
83
|
+
const sd = this.softDelete;
|
|
84
|
+
if (!sd?.use) {
|
|
85
|
+
return drizzle_orm_1.sql.empty();
|
|
86
|
+
}
|
|
87
|
+
return (0, drizzle_orm_1.sql) ` AND ${drizzle_orm_1.sql.raw(opts.alias)}.${drizzle_orm_1.sql.identifier(sd.columnName)} IS NULL`;
|
|
88
|
+
}
|
|
89
|
+
/** Resolve `(subject, method)` pairs to catalogued operations. One query for the whole extraction. */
|
|
90
|
+
async queryOperationCatalog(opts) {
|
|
91
|
+
if (!opts.pairs.length) {
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
const permissionTable = this.qualifiedTable({ table: this.permission });
|
|
95
|
+
const connector = connector_1.PolicyConnectorResolver.resolve({
|
|
96
|
+
source: this.dataSource,
|
|
97
|
+
caller: CustomGrantExpander.name,
|
|
98
|
+
});
|
|
99
|
+
const result = await connector.execute((0, drizzle_orm_1.sql) `
|
|
100
|
+
SELECT permission.subject, permission.method, permission.code, permission.action
|
|
101
|
+
FROM ${permissionTable} permission
|
|
102
|
+
WHERE (permission.subject, permission.method) IN (${drizzle_orm_1.sql.join(opts.pairs.map(pair => (0, drizzle_orm_1.sql) `(${pair.subject}, ${pair.method})`), (0, drizzle_orm_1.sql) `, `)})
|
|
103
|
+
AND permission.method <> ${ignis_kernel_1.AuthorizationPermissionBuilder.RESOURCE_NODE_METHOD}${this.softDeleteClause({ alias: 'permission' })}
|
|
104
|
+
`);
|
|
105
|
+
return (0, utilities_1.readResultRows)({
|
|
106
|
+
result,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.CustomGrantExpander = CustomGrantExpander;
|
|
111
|
+
//# sourceMappingURL=custom-grant-expander.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-grant-expander.js","sourceRoot":"","sources":["../../../../../src/components/auth/authorize/adapters/custom-grant-expander.ts"],"names":[],"mappings":";;;AACA,2CAA6C;AAC7C,sDAAyD;AACzD,wDAM+B;AAC/B,6CAA4C;AAC5C,2CAAsD;AAGtD,MAAM,cAAc,GAAG,QAAQ,CAAC;AAWhC;;;;GAIG;AACH,MAAa,mBAAoB,SAAQ,iBAAU;IAKjD,YAAY,IAGX;QACC,KAAK,CAAC,EAAE,KAAK,EAAE,mBAAmB,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,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AAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YACvB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QACxE,MAAM,SAAS,GAAG,mCAAuB,CAAC,OAAO,CAAC;YAChD,MAAM,EAAE,IAAI,CAAC,UAAU;YACvB,MAAM,EAAE,mBAAmB,CAAC,IAAI;SACjC,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,IAAA,iBAAG,EAAA;;aAEjC,eAAe;0DAC8B,iBAAG,CAAC,IAAI,CAC1D,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAA,iBAAG,EAAA,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC,EAC9D,IAAA,iBAAG,EAAA,IAAI,CACR;mCAC4B,6CAA8B,CAAC,oBAAoB,GAAG,IAAI,CAAC,gBAAgB,CACpG,EAAE,KAAK,EAAE,YAAY,EAAE,CACxB;KACJ,CAAC,CAAC;QAEH,OAAO,IAAA,0BAAc,EAAoE;YACvF,MAAM;SACP,CAAC,CAAC;IACL,CAAC;CACF;AAlJD,kDAkJC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from './base-filtered';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
2
|
+
export * from './common';
|
|
3
|
+
export * from './connector';
|
|
4
|
+
export * from './custom-grant-expander';
|
|
5
|
+
export * from './scoped-casbin';
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/auth/authorize/adapters/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/auth/authorize/adapters/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC"}
|
|
@@ -15,6 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./base-filtered"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./common"), exports);
|
|
19
|
+
__exportStar(require("./connector"), exports);
|
|
20
|
+
__exportStar(require("./custom-grant-expander"), exports);
|
|
21
|
+
__exportStar(require("./scoped-casbin"), exports);
|
|
20
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/auth/authorize/adapters/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,0DAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/auth/authorize/adapters/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,2CAAyB;AACzB,8CAA4B;AAC5B,0DAAwC;AACxC,kDAAgC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { IdType } from '../../../../../base';
|
|
2
|
+
import { type Model } from 'casbin';
|
|
3
|
+
import { type SQL } from 'drizzle-orm';
|
|
4
|
+
import { BaseFilteredAdapter } from '../base-filtered';
|
|
5
|
+
import { CustomGrantExpander } from '../custom-grant-expander';
|
|
6
|
+
import type { ICasbinPolicySource, IScopedCasbinEntities } from '../common';
|
|
7
|
+
import { type TPrincipalPolicyRow } from './policy-edges';
|
|
8
|
+
import { type IScopedCasbinPolicyFilter, type TGrantRow, type TResolveDomainEdgesFn } from './common';
|
|
9
|
+
/**
|
|
10
|
+
* Filtered casbin adapter for the scoped RBAC model: loads ONE principal's edges (role assignments,
|
|
11
|
+
* memberships, grants) plus the shared structural hierarchy trees as casbin lines. Read-only.
|
|
12
|
+
*
|
|
13
|
+
* EVERY branch below must select by `variant = <known value>` or `variant IN (<known values>)`.
|
|
14
|
+
* Never `variant NOT IN (...)`, and never a bare select that classifies afterwards. Applications
|
|
15
|
+
* store their own edge kinds in this same table (declared via `extraVariants`), and an exclusion
|
|
16
|
+
* filter would sweep those unknown rows into a branch that has no idea what they mean. The current
|
|
17
|
+
* shape makes an undeclared variant inert, which is what makes sharing the table safe.
|
|
18
|
+
*/
|
|
19
|
+
export declare class ScopedCasbinAdapter extends BaseFilteredAdapter<IScopedCasbinPolicyFilter> {
|
|
20
|
+
protected readonly entities: IScopedCasbinEntities;
|
|
21
|
+
protected readonly customGrantExpander: CustomGrantExpander;
|
|
22
|
+
protected readonly resolveDomainEdges?: TResolveDomainEdgesFn;
|
|
23
|
+
constructor(opts: {
|
|
24
|
+
dataSource: ICasbinPolicySource;
|
|
25
|
+
entities: IScopedCasbinEntities;
|
|
26
|
+
resolveDomainEdges?: TResolveDomainEdgesFn;
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* One wave: the principal-scoped CTE and the merged structural-edges query are issued together -
|
|
30
|
+
* the role closure resolves in SQL, so neither waits on the other. `resolveDomainEdges` cannot
|
|
31
|
+
* join that wave - it needs the domain closure the principal-scoped CTE produces - but it does
|
|
32
|
+
* not wait for the structural-edges query either: both run concurrently once the closure is known.
|
|
33
|
+
*/
|
|
34
|
+
loadFilteredPolicy(model: Model, filter: IScopedCasbinPolicyFilter): Promise<void>;
|
|
35
|
+
/** Route one `direct` row to its casbin line, or to the grant batch. */
|
|
36
|
+
protected collectDirectRow(opts: {
|
|
37
|
+
row: TPrincipalPolicyRow;
|
|
38
|
+
principal: {
|
|
39
|
+
type: string;
|
|
40
|
+
id: IdType;
|
|
41
|
+
};
|
|
42
|
+
lines: string[];
|
|
43
|
+
directGrants: TGrantRow[];
|
|
44
|
+
}): void;
|
|
45
|
+
/**
|
|
46
|
+
* Calls the `resolveDomainEdges` hook, if supplied, and turns its edges into `g3` lines using
|
|
47
|
+
* the same shape the DOMAIN_EDGE branch emits. A throwing hook is logged and treated as no
|
|
48
|
+
* edges - the rows already gathered for this principal still load. This is the safe direction:
|
|
49
|
+
* a missing hierarchy edge can only narrow what `g`/`g2`/`g3` reach, never widen it, so the
|
|
50
|
+
* failure degrades to less access rather than either an outage or excess access.
|
|
51
|
+
*/
|
|
52
|
+
protected resolveDomainEdgeLines(opts: {
|
|
53
|
+
principal: {
|
|
54
|
+
type: string;
|
|
55
|
+
id: IdType;
|
|
56
|
+
};
|
|
57
|
+
domains: string[];
|
|
58
|
+
}): Promise<string[]>;
|
|
59
|
+
/** Schema for a table, defaulting to `public`. */
|
|
60
|
+
protected schemaOf(table: {
|
|
61
|
+
schemaName?: string;
|
|
62
|
+
}): string;
|
|
63
|
+
/** The casbin domain token, built from the stored pair - one expression for every SELECT so they cannot drift. NULL reaches `buildGrantLines` as `ANY_MEMBER`. The alias is emitted raw for the same reason as in `softDeleteClause`: quoting folds it to a different case than the unquoted FROM alias. */
|
|
64
|
+
protected domainTokenSelection(opts: {
|
|
65
|
+
alias: string;
|
|
66
|
+
}): SQL;
|
|
67
|
+
/** Schema-qualified table reference (`"<schema>"."<table>"`) for use after FROM/JOIN with an alias. */
|
|
68
|
+
protected qualifiedTable(opts: {
|
|
69
|
+
table: {
|
|
70
|
+
schemaName?: string;
|
|
71
|
+
tableName: string;
|
|
72
|
+
};
|
|
73
|
+
}): SQL;
|
|
74
|
+
/** `AND <alias>.<col> IS NULL` when soft-delete is on, else empty. The alias is emitted raw to match the unquoted FROM alias - quoting folds it to a different case and breaks the join. */
|
|
75
|
+
protected softDeleteClause(opts: {
|
|
76
|
+
alias: string;
|
|
77
|
+
}): SQL;
|
|
78
|
+
/** One statement for everything scoped to a principal: its own edges, the role_inherits edges reachable from its roles, and the grants of that closure. `UNION` in the recursive term is what terminates a cyclic role graph. */
|
|
79
|
+
protected queryPrincipalPolicies(opts: {
|
|
80
|
+
principal: {
|
|
81
|
+
type: string;
|
|
82
|
+
id: IdType;
|
|
83
|
+
};
|
|
84
|
+
}): Promise<TPrincipalPolicyRow[]>;
|
|
85
|
+
/** Turn fetched grant rows into casbin lines. Shared by the direct and role-closure branches. */
|
|
86
|
+
protected buildGrantLines(opts: {
|
|
87
|
+
subjectType: string;
|
|
88
|
+
rows: TGrantRow[];
|
|
89
|
+
}): Promise<string[]>;
|
|
90
|
+
/** The two code-fixed structural trees only (`g4` resource, `g5` action) - constant regardless of tenant count. Domain edges (`g3`) grow with the domain count, so they are principal-scoped in {@link queryPrincipalPolicies} instead. */
|
|
91
|
+
protected queryEdgePolicies(): Promise<string[]>;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../../../src/components/auth/authorize/adapters/scoped-casbin/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAO,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAQ5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAwB,MAAM,0BAA0B,CAAC;AACrF,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAC5E,OAAO,EAAwB,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAEL,K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