@venizia/ignis 0.0.7-2 → 0.0.7-21
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/README.md +2757 -28
- package/dist/base/applications/abstract.d.ts.map +1 -1
- package/dist/base/applications/abstract.js +0 -8
- package/dist/base/applications/abstract.js.map +1 -1
- package/dist/base/applications/base.d.ts.map +1 -1
- package/dist/base/applications/base.js +0 -17
- package/dist/base/applications/base.js.map +1 -1
- package/dist/base/applications/types.d.ts.map +1 -1
- package/dist/base/applications/types.js.map +1 -1
- package/dist/base/components/base.d.ts.map +1 -1
- package/dist/base/components/base.js +0 -2
- package/dist/base/components/base.js.map +1 -1
- package/dist/base/controllers/abstract.d.ts +16 -130
- package/dist/base/controllers/abstract.d.ts.map +1 -1
- package/dist/base/controllers/abstract.js +62 -112
- package/dist/base/controllers/abstract.js.map +1 -1
- package/dist/base/controllers/base.d.ts +10 -118
- package/dist/base/controllers/base.d.ts.map +1 -1
- package/dist/base/controllers/base.js +5 -113
- package/dist/base/controllers/base.js.map +1 -1
- package/dist/base/controllers/common/constants.d.ts +1 -16
- package/dist/base/controllers/common/constants.d.ts.map +1 -1
- package/dist/base/controllers/common/constants.js +10 -29
- package/dist/base/controllers/common/constants.js.map +1 -1
- package/dist/base/controllers/common/types.d.ts +34 -152
- package/dist/base/controllers/common/types.d.ts.map +1 -1
- package/dist/base/controllers/common/types.js +1 -4
- package/dist/base/controllers/common/types.js.map +1 -1
- package/dist/base/controllers/factory/controller.d.ts +37 -199
- package/dist/base/controllers/factory/controller.d.ts.map +1 -1
- package/dist/base/controllers/factory/controller.js +21 -146
- package/dist/base/controllers/factory/controller.js.map +1 -1
- package/dist/base/controllers/factory/definition.d.ts +15 -9
- package/dist/base/controllers/factory/definition.d.ts.map +1 -1
- package/dist/base/controllers/factory/definition.js +62 -58
- package/dist/base/controllers/factory/definition.js.map +1 -1
- package/dist/base/datasources/base.d.ts +2 -31
- package/dist/base/datasources/base.d.ts.map +1 -1
- package/dist/base/datasources/base.js +2 -39
- package/dist/base/datasources/base.js.map +1 -1
- package/dist/base/datasources/common/types.d.ts +2 -4
- package/dist/base/datasources/common/types.d.ts.map +1 -1
- package/dist/base/datasources/common/types.js +1 -8
- package/dist/base/datasources/common/types.js.map +1 -1
- package/dist/base/metadata/injectors.d.ts +1 -30
- package/dist/base/metadata/injectors.d.ts.map +1 -1
- package/dist/base/metadata/injectors.js +1 -30
- package/dist/base/metadata/injectors.js.map +1 -1
- package/dist/base/metadata/persistents.d.ts +3 -63
- package/dist/base/metadata/persistents.d.ts.map +1 -1
- package/dist/base/metadata/persistents.js +11 -88
- package/dist/base/metadata/persistents.js.map +1 -1
- package/dist/base/metadata/routes.d.ts +8 -31
- package/dist/base/metadata/routes.d.ts.map +1 -1
- package/dist/base/metadata/routes.js +1 -27
- package/dist/base/metadata/routes.js.map +1 -1
- package/dist/base/middlewares/app-error.middleware.d.ts +1 -10
- package/dist/base/middlewares/app-error.middleware.d.ts.map +1 -1
- package/dist/base/middlewares/app-error.middleware.js +2 -14
- package/dist/base/middlewares/app-error.middleware.js.map +1 -1
- package/dist/base/middlewares/emoji-favicon.middleware.d.ts +1 -7
- package/dist/base/middlewares/emoji-favicon.middleware.d.ts.map +1 -1
- package/dist/base/middlewares/emoji-favicon.middleware.js +1 -7
- package/dist/base/middlewares/emoji-favicon.middleware.js.map +1 -1
- package/dist/base/middlewares/not-found.middleware.d.ts +1 -8
- package/dist/base/middlewares/not-found.middleware.d.ts.map +1 -1
- package/dist/base/middlewares/not-found.middleware.js +1 -8
- package/dist/base/middlewares/not-found.middleware.js.map +1 -1
- package/dist/base/middlewares/request-spy.middleware.d.ts +3 -19
- package/dist/base/middlewares/request-spy.middleware.d.ts.map +1 -1
- package/dist/base/middlewares/request-spy.middleware.js +3 -23
- package/dist/base/middlewares/request-spy.middleware.js.map +1 -1
- package/dist/base/mixins/component.mixin.d.ts.map +1 -1
- package/dist/base/mixins/controller.mixin.d.ts.map +1 -1
- package/dist/base/mixins/repository.mixin.d.ts.map +1 -1
- package/dist/base/mixins/service.mixin.d.ts.map +1 -1
- package/dist/base/models/base.d.ts +4 -21
- package/dist/base/models/base.d.ts.map +1 -1
- package/dist/base/models/base.js +1 -11
- package/dist/base/models/base.js.map +1 -1
- package/dist/base/models/common/types.d.ts.map +1 -1
- package/dist/base/models/common/types.js +0 -2
- package/dist/base/models/common/types.js.map +1 -1
- package/dist/base/models/enrichers/id.enricher.d.ts.map +1 -1
- package/dist/base/models/enrichers/id.enricher.js.map +1 -1
- package/dist/base/models/enrichers/user-audit.enricher.d.ts.map +1 -1
- package/dist/base/models/enrichers/user-audit.enricher.js +1 -6
- package/dist/base/models/enrichers/user-audit.enricher.js.map +1 -1
- package/dist/base/repositories/common/constants.d.ts +5 -59
- package/dist/base/repositories/common/constants.d.ts.map +1 -1
- package/dist/base/repositories/common/constants.js +3 -51
- package/dist/base/repositories/common/constants.js.map +1 -1
- package/dist/base/repositories/common/shared.d.ts +1 -13
- package/dist/base/repositories/common/shared.d.ts.map +1 -1
- package/dist/base/repositories/common/shared.js +2 -19
- package/dist/base/repositories/common/shared.js.map +1 -1
- package/dist/base/repositories/common/types.d.ts +32 -461
- package/dist/base/repositories/common/types.d.ts.map +1 -1
- package/dist/base/repositories/common/types.js +13 -159
- package/dist/base/repositories/common/types.js.map +1 -1
- package/dist/base/repositories/core/abstract.d.ts +10 -204
- package/dist/base/repositories/core/abstract.d.ts.map +1 -1
- package/dist/base/repositories/core/abstract.js +6 -126
- package/dist/base/repositories/core/abstract.js.map +1 -1
- package/dist/base/repositories/core/default-crud.d.ts +1 -36
- package/dist/base/repositories/core/default-crud.d.ts.map +1 -1
- package/dist/base/repositories/core/default-crud.js +1 -36
- package/dist/base/repositories/core/default-crud.js.map +1 -1
- package/dist/base/repositories/core/index.d.ts +1 -0
- package/dist/base/repositories/core/index.d.ts.map +1 -1
- package/dist/base/repositories/core/index.js +1 -0
- package/dist/base/repositories/core/index.js.map +1 -1
- package/dist/base/repositories/core/persistable.d.ts +2 -71
- package/dist/base/repositories/core/persistable.d.ts.map +1 -1
- package/dist/base/repositories/core/persistable.js +2 -100
- package/dist/base/repositories/core/persistable.js.map +1 -1
- package/dist/base/repositories/core/readable.d.ts +12 -127
- package/dist/base/repositories/core/readable.d.ts.map +1 -1
- package/dist/base/repositories/core/readable.js +8 -124
- package/dist/base/repositories/core/readable.js.map +1 -1
- package/dist/base/repositories/core/soft-deletable.d.ts +140 -0
- package/dist/base/repositories/core/soft-deletable.d.ts.map +1 -0
- package/dist/base/repositories/core/soft-deletable.js +99 -0
- package/dist/base/repositories/core/soft-deletable.js.map +1 -0
- package/dist/base/repositories/mixins/default-filter.d.ts +3 -49
- package/dist/base/repositories/mixins/default-filter.d.ts.map +1 -1
- package/dist/base/repositories/mixins/default-filter.js +3 -57
- package/dist/base/repositories/mixins/default-filter.js.map +1 -1
- package/dist/base/repositories/mixins/fields-visibility.d.ts +3 -59
- package/dist/base/repositories/mixins/fields-visibility.d.ts.map +1 -1
- package/dist/base/repositories/mixins/fields-visibility.js +3 -67
- package/dist/base/repositories/mixins/fields-visibility.js.map +1 -1
- package/dist/base/repositories/operators/filter.d.ts +10 -115
- package/dist/base/repositories/operators/filter.d.ts.map +1 -1
- package/dist/base/repositories/operators/filter.js +13 -154
- package/dist/base/repositories/operators/filter.js.map +1 -1
- package/dist/base/repositories/operators/json-utils.d.ts +5 -38
- package/dist/base/repositories/operators/json-utils.d.ts.map +1 -1
- package/dist/base/repositories/operators/json-utils.js +5 -47
- package/dist/base/repositories/operators/json-utils.js.map +1 -1
- package/dist/base/repositories/operators/query.d.ts +3 -56
- package/dist/base/repositories/operators/query.d.ts.map +1 -1
- package/dist/base/repositories/operators/query.js +11 -106
- package/dist/base/repositories/operators/query.js.map +1 -1
- package/dist/base/repositories/operators/relation.d.ts +1 -33
- package/dist/base/repositories/operators/relation.d.ts.map +1 -1
- package/dist/base/repositories/operators/relation.js +1 -36
- package/dist/base/repositories/operators/relation.js.map +1 -1
- package/dist/base/repositories/operators/update.d.ts +7 -72
- package/dist/base/repositories/operators/update.d.ts.map +1 -1
- package/dist/base/repositories/operators/update.js +6 -91
- package/dist/base/repositories/operators/update.js.map +1 -1
- package/dist/base/services/types.d.ts.map +1 -1
- package/dist/common/bindings.d.ts +2 -17
- package/dist/common/bindings.d.ts.map +1 -1
- package/dist/common/bindings.js +2 -14
- package/dist/common/bindings.js.map +1 -1
- package/dist/common/constants.d.ts +1 -3
- package/dist/common/constants.d.ts.map +1 -1
- package/dist/common/constants.js +1 -4
- package/dist/common/constants.js.map +1 -1
- package/dist/common/environments.d.ts +1 -4
- package/dist/common/environments.d.ts.map +1 -1
- package/dist/common/environments.js +1 -4
- package/dist/common/environments.js.map +1 -1
- package/dist/common/statuses.d.ts +6 -19
- package/dist/common/statuses.d.ts.map +1 -1
- package/dist/common/statuses.js +6 -27
- package/dist/common/statuses.js.map +1 -1
- package/dist/components/auth/authenticate/common/codecs.d.ts +11 -0
- package/dist/components/auth/authenticate/common/codecs.d.ts.map +1 -0
- package/dist/components/auth/authenticate/common/codecs.js +28 -0
- package/dist/components/auth/authenticate/common/codecs.js.map +1 -0
- package/dist/components/auth/authenticate/common/constants.d.ts +31 -5
- package/dist/components/auth/authenticate/common/constants.d.ts.map +1 -1
- package/dist/components/auth/authenticate/common/constants.js +41 -9
- package/dist/components/auth/authenticate/common/constants.js.map +1 -1
- package/dist/components/auth/authenticate/common/index.d.ts +1 -0
- package/dist/components/auth/authenticate/common/index.d.ts.map +1 -1
- package/dist/components/auth/authenticate/common/index.js +1 -0
- package/dist/components/auth/authenticate/common/index.js.map +1 -1
- package/dist/components/auth/authenticate/common/keys.d.ts +1 -0
- package/dist/components/auth/authenticate/common/keys.d.ts.map +1 -1
- package/dist/components/auth/authenticate/common/keys.js +1 -0
- package/dist/components/auth/authenticate/common/keys.js.map +1 -1
- package/dist/components/auth/authenticate/common/types.d.ts +63 -37
- package/dist/components/auth/authenticate/common/types.d.ts.map +1 -1
- package/dist/components/auth/authenticate/component.d.ts +5 -18
- package/dist/components/auth/authenticate/component.d.ts.map +1 -1
- package/dist/components/auth/authenticate/component.js +114 -82
- package/dist/components/auth/authenticate/component.js.map +1 -1
- package/dist/components/auth/authenticate/controllers/factory.d.ts +12 -12
- package/dist/components/auth/authenticate/controllers/factory.d.ts.map +1 -1
- package/dist/components/auth/authenticate/controllers/factory.js +23 -22
- package/dist/components/auth/authenticate/controllers/factory.js.map +1 -1
- package/dist/components/auth/authenticate/controllers/index.d.ts +1 -0
- package/dist/components/auth/authenticate/controllers/index.d.ts.map +1 -1
- package/dist/components/auth/authenticate/controllers/index.js +1 -0
- package/dist/components/auth/authenticate/controllers/index.js.map +1 -1
- package/dist/components/auth/authenticate/controllers/jwks/controller.d.ts +9 -0
- package/dist/components/auth/authenticate/controllers/jwks/controller.d.ts.map +1 -0
- package/dist/components/auth/authenticate/controllers/jwks/controller.js +54 -0
- package/dist/components/auth/authenticate/controllers/jwks/controller.js.map +1 -0
- package/dist/components/auth/authenticate/controllers/jwks/definitions.d.ts +66 -0
- package/dist/components/auth/authenticate/controllers/jwks/definitions.d.ts.map +1 -0
- package/dist/components/auth/authenticate/controllers/jwks/definitions.js +32 -0
- package/dist/components/auth/authenticate/controllers/jwks/definitions.js.map +1 -0
- package/dist/components/auth/authenticate/controllers/jwks/index.d.ts +2 -0
- package/dist/components/auth/authenticate/controllers/jwks/index.d.ts.map +1 -0
- package/dist/components/auth/authenticate/controllers/jwks/index.js +18 -0
- package/dist/components/auth/authenticate/controllers/jwks/index.js.map +1 -0
- package/dist/components/auth/authenticate/index.d.ts +2 -0
- package/dist/components/auth/authenticate/index.d.ts.map +1 -1
- package/dist/components/auth/authenticate/index.js +2 -0
- package/dist/components/auth/authenticate/index.js.map +1 -1
- package/dist/components/auth/authenticate/middlewares/authenticate.middleware.d.ts +6 -0
- package/dist/components/auth/authenticate/middlewares/authenticate.middleware.d.ts.map +1 -0
- package/dist/components/auth/authenticate/middlewares/authenticate.middleware.js +12 -0
- package/dist/components/auth/authenticate/middlewares/authenticate.middleware.js.map +1 -0
- package/dist/components/auth/authenticate/middlewares/index.d.ts +2 -0
- package/dist/components/auth/authenticate/middlewares/index.d.ts.map +1 -0
- package/dist/components/auth/authenticate/middlewares/index.js +18 -0
- package/dist/components/auth/authenticate/middlewares/index.js.map +1 -0
- package/dist/components/auth/authenticate/providers/authentication.provider.d.ts +12 -0
- package/dist/components/auth/authenticate/providers/authentication.provider.d.ts.map +1 -0
- package/dist/components/auth/authenticate/providers/authentication.provider.js +117 -0
- package/dist/components/auth/authenticate/providers/authentication.provider.js.map +1 -0
- package/dist/components/auth/authenticate/providers/index.d.ts +2 -0
- package/dist/components/auth/authenticate/providers/index.d.ts.map +1 -0
- package/dist/components/auth/authenticate/providers/index.js +18 -0
- package/dist/components/auth/authenticate/providers/index.js.map +1 -0
- package/dist/components/auth/authenticate/services/basic/index.d.ts +2 -0
- package/dist/components/auth/authenticate/services/basic/index.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/basic/index.js +18 -0
- package/dist/components/auth/authenticate/services/basic/index.js.map +1 -0
- package/dist/components/auth/authenticate/services/basic/service.d.ts +24 -0
- package/dist/components/auth/authenticate/services/basic/service.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/{basic-token.service.js → basic/service.js} +10 -49
- package/dist/components/auth/authenticate/services/basic/service.js.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/abstract.service.d.ts +52 -0
- package/dist/components/auth/authenticate/services/bearer/abstract.service.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/abstract.service.js +177 -0
- package/dist/components/auth/authenticate/services/bearer/abstract.service.js.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/index.d.ts +4 -0
- package/dist/components/auth/authenticate/services/bearer/index.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/index.js +20 -0
- package/dist/components/auth/authenticate/services/bearer/index.js.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/abstract.service.d.ts +16 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/abstract.service.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/abstract.service.js +32 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/abstract.service.js.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/index.d.ts +4 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/index.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/index.js +20 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/index.js.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/issuer.service.d.ts +46 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/issuer.service.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/issuer.service.js +168 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/issuer.service.js.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/verifier.service.d.ts +18 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/verifier.service.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/verifier.service.js +73 -0
- package/dist/components/auth/authenticate/services/bearer/jwks/verifier.service.js.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jws.service.d.ts +19 -0
- package/dist/components/auth/authenticate/services/bearer/jws.service.d.ts.map +1 -0
- package/dist/components/auth/authenticate/services/bearer/jws.service.js +76 -0
- package/dist/components/auth/authenticate/services/bearer/jws.service.js.map +1 -0
- package/dist/components/auth/authenticate/services/index.d.ts +2 -2
- package/dist/components/auth/authenticate/services/index.d.ts.map +1 -1
- package/dist/components/auth/authenticate/services/index.js +2 -2
- package/dist/components/auth/authenticate/services/index.js.map +1 -1
- package/dist/components/auth/authenticate/strategies/basic.strategy.d.ts +2 -23
- package/dist/components/auth/authenticate/strategies/basic.strategy.d.ts.map +1 -1
- package/dist/components/auth/authenticate/strategies/basic.strategy.js +12 -26
- package/dist/components/auth/authenticate/strategies/basic.strategy.js.map +1 -1
- package/dist/components/auth/authenticate/strategies/index.d.ts +2 -1
- package/dist/components/auth/authenticate/strategies/index.d.ts.map +1 -1
- package/dist/components/auth/authenticate/strategies/index.js +2 -1
- package/dist/components/auth/authenticate/strategies/index.js.map +1 -1
- package/dist/components/auth/authenticate/strategies/jwks.strategy.d.ts +21 -0
- package/dist/components/auth/authenticate/strategies/jwks.strategy.d.ts.map +1 -0
- package/dist/components/auth/authenticate/strategies/jwks.strategy.js +68 -0
- package/dist/components/auth/authenticate/strategies/jwks.strategy.js.map +1 -0
- package/dist/components/auth/authenticate/strategies/{jwt.strategy.d.ts → jws.strategy.d.ts} +6 -5
- package/dist/components/auth/authenticate/strategies/jws.strategy.d.ts.map +1 -0
- package/dist/components/auth/authenticate/strategies/{jwt.strategy.js → jws.strategy.js} +21 -13
- package/dist/components/auth/authenticate/strategies/jws.strategy.js.map +1 -0
- package/dist/components/auth/authenticate/strategies/strategy-registry.d.ts +11 -24
- package/dist/components/auth/authenticate/strategies/strategy-registry.d.ts.map +1 -1
- package/dist/components/auth/authenticate/strategies/strategy-registry.js +9 -132
- package/dist/components/auth/authenticate/strategies/strategy-registry.js.map +1 -1
- package/dist/components/auth/authorize/adapters/base-filtered.d.ts +73 -0
- package/dist/components/auth/authorize/adapters/base-filtered.d.ts.map +1 -0
- package/dist/components/auth/authorize/adapters/base-filtered.js +90 -0
- package/dist/components/auth/authorize/adapters/base-filtered.js.map +1 -0
- package/dist/components/auth/authorize/adapters/drizzle-casbin.d.ts +40 -0
- package/dist/components/auth/authorize/adapters/drizzle-casbin.d.ts.map +1 -0
- package/dist/components/auth/authorize/adapters/drizzle-casbin.js +99 -0
- package/dist/components/auth/authorize/adapters/drizzle-casbin.js.map +1 -0
- package/dist/components/auth/authorize/adapters/index.d.ts +3 -0
- package/dist/components/auth/authorize/adapters/index.d.ts.map +1 -0
- package/dist/components/auth/authorize/adapters/index.js +19 -0
- package/dist/components/auth/authorize/adapters/index.js.map +1 -0
- package/dist/components/auth/authorize/common/constants.d.ts +70 -0
- package/dist/components/auth/authorize/common/constants.d.ts.map +1 -0
- package/dist/components/auth/authorize/common/constants.js +130 -0
- package/dist/components/auth/authorize/common/constants.js.map +1 -0
- package/dist/components/auth/authorize/common/index.d.ts +4 -0
- package/dist/components/auth/authorize/common/index.d.ts.map +1 -0
- package/dist/components/auth/authorize/common/index.js +20 -0
- package/dist/components/auth/authorize/common/index.js.map +1 -0
- package/dist/components/auth/authorize/common/keys.d.ts +6 -0
- package/dist/components/auth/authorize/common/keys.d.ts.map +1 -0
- package/dist/components/auth/authorize/common/keys.js +12 -0
- package/dist/components/auth/authorize/common/keys.js.map +1 -0
- package/dist/components/auth/authorize/common/types.d.ts +107 -0
- package/dist/components/auth/authorize/common/types.d.ts.map +1 -0
- package/dist/components/auth/authorize/{middleware.js → common/types.js} +1 -1
- package/dist/components/auth/authorize/common/types.js.map +1 -0
- package/dist/components/auth/authorize/component.d.ts +10 -0
- package/dist/components/auth/authorize/component.d.ts.map +1 -0
- package/dist/components/auth/authorize/component.js +58 -0
- package/dist/components/auth/authorize/component.js.map +1 -0
- package/dist/components/auth/authorize/enforcers/casbin.enforcer.d.ts +56 -0
- package/dist/components/auth/authorize/enforcers/casbin.enforcer.d.ts.map +1 -0
- package/dist/components/auth/authorize/enforcers/casbin.enforcer.js +254 -0
- package/dist/components/auth/authorize/enforcers/casbin.enforcer.js.map +1 -0
- package/dist/components/auth/authorize/enforcers/enforcer-registry.d.ts +33 -0
- package/dist/components/auth/authorize/enforcers/enforcer-registry.d.ts.map +1 -0
- package/dist/components/auth/authorize/enforcers/enforcer-registry.js +79 -0
- package/dist/components/auth/authorize/enforcers/enforcer-registry.js.map +1 -0
- package/dist/components/auth/authorize/enforcers/index.d.ts +3 -0
- package/dist/components/auth/authorize/enforcers/index.d.ts.map +1 -0
- package/dist/components/auth/authorize/enforcers/index.js +19 -0
- package/dist/components/auth/authorize/enforcers/index.js.map +1 -0
- package/dist/components/auth/authorize/index.d.ts +7 -1
- package/dist/components/auth/authorize/index.d.ts.map +1 -1
- package/dist/components/auth/authorize/index.js +21 -0
- package/dist/components/auth/authorize/index.js.map +1 -1
- package/dist/components/auth/authorize/middlewares/authorize.middleware.d.ts +6 -0
- package/dist/components/auth/authorize/middlewares/authorize.middleware.d.ts.map +1 -0
- package/dist/components/auth/authorize/middlewares/authorize.middleware.js +12 -0
- package/dist/components/auth/authorize/middlewares/authorize.middleware.js.map +1 -0
- package/dist/components/auth/authorize/middlewares/index.d.ts +2 -0
- package/dist/components/auth/authorize/middlewares/index.d.ts.map +1 -0
- package/dist/components/auth/authorize/middlewares/index.js +18 -0
- package/dist/components/auth/authorize/middlewares/index.js.map +1 -0
- package/dist/components/auth/authorize/models/abilities/index.d.ts +3 -0
- package/dist/components/auth/authorize/models/abilities/index.d.ts.map +1 -0
- package/dist/components/auth/authorize/models/abilities/index.js +19 -0
- package/dist/components/auth/authorize/models/abilities/index.js.map +1 -0
- package/dist/components/auth/authorize/models/abilities/string-action.model.d.ts +14 -0
- package/dist/components/auth/authorize/models/abilities/string-action.model.d.ts.map +1 -0
- package/dist/components/auth/authorize/models/abilities/string-action.model.js +23 -0
- package/dist/components/auth/authorize/models/abilities/string-action.model.js.map +1 -0
- package/dist/components/auth/authorize/models/abilities/string-resource.model.d.ts +13 -0
- package/dist/components/auth/authorize/models/abilities/string-resource.model.d.ts.map +1 -0
- package/dist/components/auth/authorize/models/abilities/string-resource.model.js +19 -0
- package/dist/components/auth/authorize/models/abilities/string-resource.model.js.map +1 -0
- package/dist/components/auth/authorize/models/authorization-role.model.d.ts +30 -0
- package/dist/components/auth/authorize/models/authorization-role.model.d.ts.map +1 -0
- package/dist/components/auth/authorize/models/authorization-role.model.js +30 -0
- package/dist/components/auth/authorize/models/authorization-role.model.js.map +1 -0
- package/dist/components/auth/authorize/models/index.d.ts +3 -0
- package/dist/components/auth/authorize/models/index.d.ts.map +1 -0
- package/dist/components/auth/authorize/models/index.js +19 -0
- package/dist/components/auth/authorize/models/index.js.map +1 -0
- package/dist/components/auth/authorize/providers/authorization.provider.d.ts +10 -0
- package/dist/components/auth/authorize/providers/authorization.provider.d.ts.map +1 -0
- package/dist/components/auth/authorize/providers/authorization.provider.js +135 -0
- package/dist/components/auth/authorize/providers/authorization.provider.js.map +1 -0
- package/dist/components/auth/authorize/providers/index.d.ts +2 -0
- package/dist/components/auth/authorize/providers/index.d.ts.map +1 -0
- package/dist/components/auth/authorize/providers/index.js +18 -0
- package/dist/components/auth/authorize/providers/index.js.map +1 -0
- package/dist/components/auth/base/abstract-auth-registry.d.ts +27 -0
- package/dist/components/auth/base/abstract-auth-registry.d.ts.map +1 -0
- package/dist/components/auth/base/abstract-auth-registry.js +62 -0
- package/dist/components/auth/base/abstract-auth-registry.js.map +1 -0
- package/dist/components/auth/base/index.d.ts +2 -0
- package/dist/components/auth/base/index.d.ts.map +1 -0
- package/dist/components/auth/base/index.js +18 -0
- package/dist/components/auth/base/index.js.map +1 -0
- package/dist/components/auth/context-variables.d.ts +14 -0
- package/dist/components/auth/context-variables.d.ts.map +1 -0
- package/dist/components/auth/context-variables.js +3 -0
- package/dist/components/auth/context-variables.js.map +1 -0
- package/dist/components/auth/index.d.ts +2 -0
- package/dist/components/auth/index.d.ts.map +1 -1
- package/dist/components/auth/index.js +2 -0
- package/dist/components/auth/index.js.map +1 -1
- package/dist/components/auth/models/entities/index.d.ts +1 -2
- package/dist/components/auth/models/entities/index.d.ts.map +1 -1
- package/dist/components/auth/models/entities/index.js +1 -2
- package/dist/components/auth/models/entities/index.js.map +1 -1
- package/dist/components/auth/models/entities/permission.model.d.ts +0 -1
- package/dist/components/auth/models/entities/permission.model.d.ts.map +1 -1
- package/dist/components/auth/models/entities/permission.model.js +0 -2
- package/dist/components/auth/models/entities/permission.model.js.map +1 -1
- package/dist/components/auth/models/entities/policy-definition.model.d.ts +24 -0
- package/dist/components/auth/models/entities/policy-definition.model.d.ts.map +1 -0
- package/dist/components/auth/models/entities/policy-definition.model.js +39 -0
- package/dist/components/auth/models/entities/policy-definition.model.js.map +1 -0
- package/dist/components/auth/models/entities/role.model.d.ts +3 -1
- package/dist/components/auth/models/entities/role.model.d.ts.map +1 -1
- package/dist/components/auth/models/entities/role.model.js +5 -3
- package/dist/components/auth/models/entities/role.model.js.map +1 -1
- package/dist/components/auth/models/entities/user.model.d.ts +4 -2
- package/dist/components/auth/models/entities/user.model.d.ts.map +1 -1
- package/dist/components/auth/models/entities/user.model.js +6 -5
- package/dist/components/auth/models/entities/user.model.js.map +1 -1
- package/dist/components/auth/models/requests/change-password.schema.js +3 -3
- package/dist/components/auth/models/requests/change-password.schema.js.map +1 -1
- package/dist/components/auth/models/requests/sign-in.schema.js +5 -5
- package/dist/components/auth/models/requests/sign-in.schema.js.map +1 -1
- package/dist/components/health-check/controller.d.ts.map +1 -1
- package/dist/components/health-check/controller.js +0 -1
- package/dist/components/health-check/controller.js.map +1 -1
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/mail/common/types.d.ts +1 -1
- package/dist/components/mail/common/types.d.ts.map +1 -1
- package/dist/components/mail/component.d.ts.map +1 -1
- package/dist/components/mail/component.js +2 -7
- package/dist/components/mail/component.js.map +1 -1
- package/dist/components/mail/helpers/executors/bull-mq-executor.helper.d.ts +2 -1
- 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 +10 -9
- package/dist/components/mail/helpers/executors/bull-mq-executor.helper.js.map +1 -1
- package/dist/components/mail/helpers/executors/direct-executor.helper.d.ts +1 -1
- package/dist/components/mail/helpers/executors/direct-executor.helper.d.ts.map +1 -1
- package/dist/components/mail/helpers/executors/direct-executor.helper.js +3 -3
- package/dist/components/mail/helpers/executors/direct-executor.helper.js.map +1 -1
- package/dist/components/mail/helpers/executors/internal-queue-executor.helper.d.ts +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 +4 -4
- package/dist/components/mail/helpers/executors/internal-queue-executor.helper.js.map +1 -1
- package/dist/components/mail/helpers/transporters/mailgun-transporter.helper.d.ts +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 +3 -3
- package/dist/components/mail/helpers/transporters/mailgun-transporter.helper.js.map +1 -1
- package/dist/components/mail/helpers/transporters/nodemail-transporter.helper.d.ts +1 -1
- package/dist/components/mail/helpers/transporters/nodemail-transporter.helper.d.ts.map +1 -1
- package/dist/components/mail/helpers/transporters/nodemail-transporter.helper.js +3 -3
- package/dist/components/mail/helpers/transporters/nodemail-transporter.helper.js.map +1 -1
- package/dist/components/mail/providers/mail-queue-executor.provider.d.ts.map +1 -1
- package/dist/components/mail/providers/mail-queue-executor.provider.js +8 -8
- package/dist/components/mail/providers/mail-queue-executor.provider.js.map +1 -1
- package/dist/components/mail/providers/mail-transporter.provider.d.ts.map +1 -1
- package/dist/components/mail/providers/mail-transporter.provider.js +6 -6
- package/dist/components/mail/providers/mail-transporter.provider.js.map +1 -1
- package/dist/components/mail/services/mail.service.d.ts +1 -1
- package/dist/components/mail/services/mail.service.d.ts.map +1 -1
- package/dist/components/mail/services/mail.service.js +9 -9
- package/dist/components/mail/services/mail.service.js.map +1 -1
- package/dist/components/mail/services/template.service.d.ts +1 -1
- package/dist/components/mail/services/template.service.d.ts.map +1 -1
- package/dist/components/mail/services/template.service.js +4 -4
- package/dist/components/mail/services/template.service.js.map +1 -1
- package/dist/components/mail/utilities/type.utility.d.ts +1 -1
- package/dist/components/mail/utilities/type.utility.d.ts.map +1 -1
- package/dist/components/socket-io/common/types.d.ts +2 -1
- package/dist/components/socket-io/common/types.d.ts.map +1 -1
- package/dist/components/socket-io/component.d.ts.map +1 -1
- package/dist/components/socket-io/component.js +2 -5
- package/dist/components/socket-io/component.js.map +1 -1
- package/dist/components/socket-io/handlers/node.handler.d.ts +1 -1
- package/dist/components/socket-io/handlers/node.handler.d.ts.map +1 -1
- package/dist/components/socket-io/handlers/node.handler.js +2 -1
- package/dist/components/socket-io/handlers/node.handler.js.map +1 -1
- package/dist/components/static-asset/common/constants.d.ts +1 -0
- package/dist/components/static-asset/common/constants.d.ts.map +1 -1
- package/dist/components/static-asset/common/constants.js +2 -1
- package/dist/components/static-asset/common/constants.js.map +1 -1
- package/dist/components/static-asset/common/types.d.ts +44 -1
- package/dist/components/static-asset/common/types.d.ts.map +1 -1
- package/dist/components/static-asset/controller/base.definition.d.ts +81 -80
- package/dist/components/static-asset/controller/base.definition.d.ts.map +1 -1
- package/dist/components/static-asset/controller/base.definition.js +1 -2
- package/dist/components/static-asset/controller/base.definition.js.map +1 -1
- package/dist/components/static-asset/controller/factory.d.ts +8 -12
- package/dist/components/static-asset/controller/factory.d.ts.map +1 -1
- package/dist/components/static-asset/controller/factory.js +41 -42
- package/dist/components/static-asset/controller/factory.js.map +1 -1
- package/dist/components/static-asset/models/base.model.d.ts +49 -19
- package/dist/components/static-asset/models/base.model.d.ts.map +1 -1
- package/dist/components/static-asset/models/base.model.js +3 -7
- package/dist/components/static-asset/models/base.model.js.map +1 -1
- package/dist/components/swagger/ui-factory.d.ts.map +1 -1
- package/dist/components/swagger/ui-factory.js +0 -2
- package/dist/components/swagger/ui-factory.js.map +1 -1
- package/dist/components/websocket/component.d.ts.map +1 -1
- package/dist/components/websocket/component.js +0 -3
- package/dist/components/websocket/component.js.map +1 -1
- package/dist/helpers/base-helper.d.ts +2 -0
- package/dist/helpers/base-helper.d.ts.map +1 -0
- package/dist/helpers/base-helper.js +6 -0
- package/dist/helpers/base-helper.js.map +1 -0
- package/dist/helpers/index.d.ts +2 -1
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +1 -1
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/inversion/common/keys.d.ts.map +1 -1
- package/dist/helpers/inversion/common/keys.js +0 -2
- package/dist/helpers/inversion/common/keys.js.map +1 -1
- package/dist/helpers/inversion/common/types.d.ts +18 -56
- package/dist/helpers/inversion/common/types.d.ts.map +1 -1
- package/dist/helpers/inversion/container.d.ts.map +1 -1
- package/dist/helpers/inversion/container.js +0 -1
- package/dist/helpers/inversion/container.js.map +1 -1
- package/dist/helpers/inversion/index.d.ts +1 -1
- package/dist/helpers/inversion/index.d.ts.map +1 -1
- package/dist/helpers/inversion/index.js +5 -1
- package/dist/helpers/inversion/index.js.map +1 -1
- package/dist/helpers/inversion/mixins/controller.mixin.d.ts.map +1 -1
- package/dist/helpers/inversion/mixins/controller.mixin.js +0 -3
- package/dist/helpers/inversion/mixins/controller.mixin.js.map +1 -1
- package/dist/helpers/inversion/mixins/datasource.mixin.d.ts.map +1 -1
- package/dist/helpers/inversion/mixins/datasource.mixin.js +0 -3
- package/dist/helpers/inversion/mixins/datasource.mixin.js.map +1 -1
- package/dist/helpers/inversion/mixins/model.mixin.d.ts +29 -1
- package/dist/helpers/inversion/mixins/model.mixin.d.ts.map +1 -1
- package/dist/helpers/inversion/mixins/model.mixin.js +66 -2
- package/dist/helpers/inversion/mixins/model.mixin.js.map +1 -1
- package/dist/helpers/inversion/mixins/repository.mixin.d.ts.map +1 -1
- package/dist/helpers/inversion/mixins/repository.mixin.js +0 -2
- package/dist/helpers/inversion/mixins/repository.mixin.js.map +1 -1
- package/dist/helpers/inversion/registry.d.ts +22 -0
- package/dist/helpers/inversion/registry.d.ts.map +1 -1
- package/dist/utilities/jsx.utility.d.ts +2 -16
- package/dist/utilities/jsx.utility.d.ts.map +1 -1
- package/dist/utilities/jsx.utility.js +2 -16
- package/dist/utilities/jsx.utility.js.map +1 -1
- package/dist/utilities/schema.utility.d.ts.map +1 -1
- package/dist/utilities/schema.utility.js +0 -2
- package/dist/utilities/schema.utility.js.map +1 -1
- package/package.json +117 -77
- package/dist/components/auth/authenticate/services/basic-token.service.d.ts +0 -60
- package/dist/components/auth/authenticate/services/basic-token.service.d.ts.map +0 -1
- package/dist/components/auth/authenticate/services/basic-token.service.js.map +0 -1
- package/dist/components/auth/authenticate/services/jwt-token.service.d.ts +0 -34
- package/dist/components/auth/authenticate/services/jwt-token.service.d.ts.map +0 -1
- package/dist/components/auth/authenticate/services/jwt-token.service.js +0 -219
- package/dist/components/auth/authenticate/services/jwt-token.service.js.map +0 -1
- package/dist/components/auth/authenticate/strategies/jwt.strategy.d.ts.map +0 -1
- package/dist/components/auth/authenticate/strategies/jwt.strategy.js.map +0 -1
- package/dist/components/auth/authorize/middleware.d.ts +0 -2
- package/dist/components/auth/authorize/middleware.d.ts.map +0 -1
- package/dist/components/auth/authorize/middleware.js.map +0 -1
- package/dist/components/auth/models/entities/permission-mapping.model.d.ts +0 -26
- package/dist/components/auth/models/entities/permission-mapping.model.d.ts.map +0 -1
- package/dist/components/auth/models/entities/permission-mapping.model.js +0 -33
- package/dist/components/auth/models/entities/permission-mapping.model.js.map +0 -1
- package/dist/components/auth/models/entities/user-role.model.d.ts +0 -17
- package/dist/components/auth/models/entities/user-role.model.d.ts.map +0 -1
- package/dist/components/auth/models/entities/user-role.model.js +0 -34
- package/dist/components/auth/models/entities/user-role.model.js.map +0 -1
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CasbinRuleVariants = exports.CasbinEnforcerModelDrivers = exports.CasbinEnforcerCachedDrivers = exports.AuthorizationEnforcerTypes = exports.AuthorizationRoles = exports.AuthorizationDecisions = exports.AuthorizationActions = exports.Authorization = void 0;
|
|
4
|
+
const authorization_role_model_1 = require("../models/authorization-role.model");
|
|
5
|
+
class Authorization {
|
|
6
|
+
static { this.RULES = 'authorization.rules'; }
|
|
7
|
+
static { this.SKIP_AUTHORIZATION = 'authorization.skip'; }
|
|
8
|
+
static { this.ENFORCER = 'authorization.enforcer'; }
|
|
9
|
+
}
|
|
10
|
+
exports.Authorization = Authorization;
|
|
11
|
+
class AuthorizationActions {
|
|
12
|
+
static { this.CREATE = 'create'; }
|
|
13
|
+
static { this.READ = 'read'; }
|
|
14
|
+
static { this.UPDATE = 'update'; }
|
|
15
|
+
static { this.DELETE = 'delete'; }
|
|
16
|
+
static { this.EXECUTE = 'execute'; }
|
|
17
|
+
static { this.SCHEME_SET = new Set([
|
|
18
|
+
this.CREATE,
|
|
19
|
+
this.READ,
|
|
20
|
+
this.UPDATE,
|
|
21
|
+
this.DELETE,
|
|
22
|
+
this.EXECUTE,
|
|
23
|
+
]); }
|
|
24
|
+
static isValid(input) {
|
|
25
|
+
return this.SCHEME_SET.has(input);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.AuthorizationActions = AuthorizationActions;
|
|
29
|
+
class AuthorizationDecisions {
|
|
30
|
+
static { this.ALLOW = 'allow'; }
|
|
31
|
+
static { this.DENY = 'deny'; }
|
|
32
|
+
static { this.ABSTAIN = 'abstain'; }
|
|
33
|
+
static { this.SCHEME_SET = new Set([this.ALLOW, this.DENY, this.ABSTAIN]); }
|
|
34
|
+
static isValid(input) {
|
|
35
|
+
return this.SCHEME_SET.has(input);
|
|
36
|
+
}
|
|
37
|
+
static isAllow(input) {
|
|
38
|
+
if (typeof input === 'number') {
|
|
39
|
+
return input > 0;
|
|
40
|
+
}
|
|
41
|
+
return input.toLowerCase() === this.ALLOW;
|
|
42
|
+
}
|
|
43
|
+
static isDeny(input) {
|
|
44
|
+
if (typeof input === 'number') {
|
|
45
|
+
return input < 0;
|
|
46
|
+
}
|
|
47
|
+
return input.toLowerCase() === this.DENY;
|
|
48
|
+
}
|
|
49
|
+
static isAbstain(input) {
|
|
50
|
+
if (typeof input === 'number') {
|
|
51
|
+
return input === 0;
|
|
52
|
+
}
|
|
53
|
+
return input.toLowerCase() === this.ABSTAIN;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.AuthorizationDecisions = AuthorizationDecisions;
|
|
57
|
+
class AuthorizationRoles {
|
|
58
|
+
static { this.SUPER_ADMIN = authorization_role_model_1.AuthorizationRole.build({
|
|
59
|
+
name: 'super-admin',
|
|
60
|
+
priority: 999,
|
|
61
|
+
}); }
|
|
62
|
+
static { this.ADMIN = authorization_role_model_1.AuthorizationRole.build({
|
|
63
|
+
name: 'admin',
|
|
64
|
+
priority: 900,
|
|
65
|
+
}); }
|
|
66
|
+
static { this.USER = authorization_role_model_1.AuthorizationRole.build({
|
|
67
|
+
name: 'user',
|
|
68
|
+
priority: 10,
|
|
69
|
+
}); }
|
|
70
|
+
static { this.GUEST = authorization_role_model_1.AuthorizationRole.build({
|
|
71
|
+
name: 'guest',
|
|
72
|
+
priority: 1,
|
|
73
|
+
}); }
|
|
74
|
+
static { this.UNKNOWN_USER = authorization_role_model_1.AuthorizationRole.build({
|
|
75
|
+
name: 'unknown-user',
|
|
76
|
+
priority: 0,
|
|
77
|
+
}); }
|
|
78
|
+
static { this.SCHEME_SET = new Set([
|
|
79
|
+
this.SUPER_ADMIN.identifier,
|
|
80
|
+
this.ADMIN.identifier,
|
|
81
|
+
this.USER.identifier,
|
|
82
|
+
this.GUEST.identifier,
|
|
83
|
+
this.UNKNOWN_USER.identifier,
|
|
84
|
+
]); }
|
|
85
|
+
static isValid(input) {
|
|
86
|
+
return this.SCHEME_SET.has(input);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.AuthorizationRoles = AuthorizationRoles;
|
|
90
|
+
class AuthorizationEnforcerTypes {
|
|
91
|
+
static { this.CASBIN = 'casbin'; }
|
|
92
|
+
static { this.CUSTOM = 'custom'; }
|
|
93
|
+
static { this.SCHEME_SET = new Set([this.CASBIN, this.CUSTOM]); }
|
|
94
|
+
static isValid(input) {
|
|
95
|
+
return this.SCHEME_SET.has(input);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.AuthorizationEnforcerTypes = AuthorizationEnforcerTypes;
|
|
99
|
+
class CasbinEnforcerCachedDrivers {
|
|
100
|
+
static { this.IN_MEMORY = 'in-memory'; }
|
|
101
|
+
static { this.REDIS = 'redis'; }
|
|
102
|
+
static { this.SCHEME_SET = new Set([this.IN_MEMORY, this.REDIS]); }
|
|
103
|
+
static isValid(input) {
|
|
104
|
+
return this.SCHEME_SET.has(input);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.CasbinEnforcerCachedDrivers = CasbinEnforcerCachedDrivers;
|
|
108
|
+
class CasbinEnforcerModelDrivers {
|
|
109
|
+
static { this.FILE = 'file'; }
|
|
110
|
+
static { this.TEXT = 'text'; }
|
|
111
|
+
static { this.SCHEME_SET = new Set([this.FILE, this.TEXT]); }
|
|
112
|
+
static isValid(input) {
|
|
113
|
+
return this.SCHEME_SET.has(input);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.CasbinEnforcerModelDrivers = CasbinEnforcerModelDrivers;
|
|
117
|
+
class CasbinRuleVariants {
|
|
118
|
+
static { this.POLICY = 'policy'; }
|
|
119
|
+
static { this.GROUP = 'group'; }
|
|
120
|
+
/** Casbin line prefix for policy rules. */
|
|
121
|
+
static { this.P = 'p'; }
|
|
122
|
+
/** Casbin line prefix for grouping rules. */
|
|
123
|
+
static { this.G = 'g'; }
|
|
124
|
+
static { this.SCHEME_SET = new Set([this.POLICY, this.GROUP]); }
|
|
125
|
+
static isValid(input) {
|
|
126
|
+
return this.SCHEME_SET.has(input);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
exports.CasbinRuleVariants = CasbinRuleVariants;
|
|
130
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/components/auth/authorize/common/constants.ts"],"names":[],"mappings":";;;AACA,iFAAuE;AAEvE,MAAa,aAAa;aACR,UAAK,GAAG,qBAAqB,CAAC;aAC9B,uBAAkB,GAAG,oBAAoB,CAAC;aAC1C,aAAQ,GAAG,wBAAwB,CAAC;;AAHtD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I,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AAbH,gDAcC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/auth/authorize/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./constants"), exports);
|
|
18
|
+
__exportStar(require("./keys"), exports);
|
|
19
|
+
__exportStar(require("./types"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/auth/authorize/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,yCAAuB;AACvB,0CAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../../../src/components/auth/authorize/common/keys.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAoB;IAC/B,MAAM,CAAC,QAAQ,CAAC,OAAO,4BAA4B;IACnD,MAAM,CAAC,QAAQ,CAAC,kBAAkB,uCAAuC;IAEzE,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAG7C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthorizeBindingKeys = void 0;
|
|
4
|
+
class AuthorizeBindingKeys {
|
|
5
|
+
static { this.OPTIONS = '@app/authorize/options'; }
|
|
6
|
+
static { this.ALWAYS_ALLOW_ROLES = '@app/authorize/always-allow-roles'; }
|
|
7
|
+
static enforcerOptions(name) {
|
|
8
|
+
return `@app/authorize/enforcers/${name}/options`;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.AuthorizeBindingKeys = AuthorizeBindingKeys;
|
|
12
|
+
//# sourceMappingURL=keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../../../src/components/auth/authorize/common/keys.ts"],"names":[],"mappings":";;;AAAA,MAAa,oBAAoB;aACf,YAAO,GAAG,wBAAwB,CAAC;aACnC,uBAAkB,GAAG,mCAAmC,CAAC;IAEzE,MAAM,CAAC,eAAe,CAAC,IAAY;QACjC,OAAO,4BAA4B,IAAI,UAAU,CAAC;IACpD,CAAC;;AANH,oDAOC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { TContext } from '../../../../base/controllers/common/types';
|
|
2
|
+
import { type DefaultRedisHelper, type ValueOrPromise } from '@venizia/ignis-helpers';
|
|
3
|
+
import { type Adapter } from 'casbin';
|
|
4
|
+
import { Env, type MiddlewareHandler } from 'hono';
|
|
5
|
+
import { IAuthUser } from '../../authenticate';
|
|
6
|
+
import { CasbinEnforcerCachedDrivers, CasbinEnforcerModelDrivers, TAuthorizationDecision } from './constants';
|
|
7
|
+
export interface IAuthorizationRole {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly priority: number;
|
|
10
|
+
readonly identifier: string;
|
|
11
|
+
}
|
|
12
|
+
/** Key-value conditions for attribute-based access control. Values compared with strict equality. */
|
|
13
|
+
export type TAuthorizationConditions<KeyType extends string | symbol = string | symbol, ValueType = string | number | boolean | null> = Record<KeyType, ValueType>;
|
|
14
|
+
export interface IAuthorizationComparable<TElement = string, TCompareResult = number> {
|
|
15
|
+
value: TElement;
|
|
16
|
+
compare(other: TElement): TCompareResult;
|
|
17
|
+
isEqual(other: TElement): boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface IAuthorizationRequest<TAction = string, TResource = string> {
|
|
20
|
+
action: TAction;
|
|
21
|
+
resource: TResource;
|
|
22
|
+
conditions?: TAuthorizationConditions;
|
|
23
|
+
}
|
|
24
|
+
/** Authorization enforcer that builds rules and evaluates authorization requests. */
|
|
25
|
+
export interface IAuthorizationEnforcer<E extends Env = Env, TAction = string, TResource = string, TRules = unknown, TBuildRulesReturn = ValueOrPromise<TRules>, TEvaluateReturn = ValueOrPromise<TAuthorizationDecision>> {
|
|
26
|
+
name: string;
|
|
27
|
+
configure(): ValueOrPromise<void>;
|
|
28
|
+
buildRules(opts: {
|
|
29
|
+
user: {
|
|
30
|
+
principalType: string;
|
|
31
|
+
} & IAuthUser;
|
|
32
|
+
context: TContext<E, string>;
|
|
33
|
+
}): TBuildRulesReturn;
|
|
34
|
+
evaluate(opts: {
|
|
35
|
+
rules: TRules;
|
|
36
|
+
request: IAuthorizationRequest<TAction, TResource>;
|
|
37
|
+
context: TContext<E, string>;
|
|
38
|
+
}): TEvaluateReturn;
|
|
39
|
+
}
|
|
40
|
+
export type TAuthorizationVoter<E extends Env = Env, TAction = string, TResource = string> = (opts: {
|
|
41
|
+
user: IAuthUser;
|
|
42
|
+
action: TAction;
|
|
43
|
+
resource: TResource;
|
|
44
|
+
context: TContext<E, string>;
|
|
45
|
+
}) => ValueOrPromise<TAuthorizationDecision>;
|
|
46
|
+
export interface IAuthorizationSpec<E extends Env = Env, TAction = string, TResource = string> {
|
|
47
|
+
action: TAction;
|
|
48
|
+
resource: TResource;
|
|
49
|
+
conditions?: TAuthorizationConditions;
|
|
50
|
+
allowedRoles?: string[];
|
|
51
|
+
voters?: TAuthorizationVoter<E, TAction, TResource>[];
|
|
52
|
+
}
|
|
53
|
+
export type TAuthorizeFn<E extends Env = Env, TAction = string, TResource = string> = (opts: {
|
|
54
|
+
spec: IAuthorizationSpec<E, TAction, TResource>;
|
|
55
|
+
enforcerName?: string;
|
|
56
|
+
}) => MiddlewareHandler;
|
|
57
|
+
export interface ICasbinEnforcerCachedMemory {
|
|
58
|
+
driver: typeof CasbinEnforcerCachedDrivers.IN_MEMORY;
|
|
59
|
+
options: {
|
|
60
|
+
expiresIn: number;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export interface ICasbinEnforcerCachedRedis {
|
|
64
|
+
driver: typeof CasbinEnforcerCachedDrivers.REDIS;
|
|
65
|
+
options: {
|
|
66
|
+
connection: DefaultRedisHelper;
|
|
67
|
+
expiresIn: number;
|
|
68
|
+
keyFn: (opts: {
|
|
69
|
+
user: {
|
|
70
|
+
principalType: string;
|
|
71
|
+
} & IAuthUser;
|
|
72
|
+
}) => ValueOrPromise<string>;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export interface ICasbinEnforcerOptions<E extends Env = Env, TAction = string, TResource = string, TAdapter = Adapter> {
|
|
76
|
+
model: {
|
|
77
|
+
driver: typeof CasbinEnforcerModelDrivers.FILE;
|
|
78
|
+
definition: string;
|
|
79
|
+
} | {
|
|
80
|
+
driver: typeof CasbinEnforcerModelDrivers.TEXT;
|
|
81
|
+
definition: string;
|
|
82
|
+
};
|
|
83
|
+
cached: {
|
|
84
|
+
use: false;
|
|
85
|
+
} | (ICasbinEnforcerCachedMemory & {
|
|
86
|
+
use: true;
|
|
87
|
+
}) | (ICasbinEnforcerCachedRedis & {
|
|
88
|
+
use: true;
|
|
89
|
+
});
|
|
90
|
+
adapter?: TAdapter;
|
|
91
|
+
normalizePayloadFn?(opts: {
|
|
92
|
+
user: IAuthUser;
|
|
93
|
+
action: TAction;
|
|
94
|
+
resource: TResource;
|
|
95
|
+
context: TContext<E, string>;
|
|
96
|
+
}): {
|
|
97
|
+
subject: string;
|
|
98
|
+
resource: string;
|
|
99
|
+
action: string;
|
|
100
|
+
domain?: string;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export interface IAuthorizeOptions {
|
|
104
|
+
defaultDecision: TAuthorizationDecision;
|
|
105
|
+
alwaysAllowRoles?: string[];
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/auth/authorize/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,KAAK,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,aAAa,CAAC;AACrB,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,qGAAqG;AACrG,MAAM,MAAM,w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;IACxC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/components/auth/authorize/common/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseApplication } from '../../../base/applications/base';
|
|
2
|
+
import { BaseComponent } from '../../../base/components/base';
|
|
3
|
+
import { ValueOrPromise } from '@venizia/ignis-helpers';
|
|
4
|
+
export declare class AuthorizeComponent extends BaseComponent {
|
|
5
|
+
private application;
|
|
6
|
+
constructor(application: BaseApplication);
|
|
7
|
+
binding(): ValueOrPromise<void>;
|
|
8
|
+
private bindAlwaysAllowRoles;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/components/auth/authorize/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAY,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGlE,qBAAa,kBAAmB,SAAQ,aAAa;IAEG,OAAO,CAAC,WAAW;gBAAX,WAAW,EAAE,eAAe;IAQjF,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC;IAkBxC,OAAO,CAAC,oBAAoB;CAS7B"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var AuthorizeComponent_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.AuthorizeComponent = void 0;
|
|
17
|
+
const base_1 = require("../../../base/applications/base");
|
|
18
|
+
const base_2 = require("../../../base/components/base");
|
|
19
|
+
const injectors_1 = require("../../../base/metadata/injectors");
|
|
20
|
+
const bindings_1 = require("../../../common/bindings");
|
|
21
|
+
const ignis_helpers_1 = require("@venizia/ignis-helpers");
|
|
22
|
+
const common_1 = require("./common");
|
|
23
|
+
let AuthorizeComponent = AuthorizeComponent_1 = class AuthorizeComponent extends base_2.BaseComponent {
|
|
24
|
+
constructor(application) {
|
|
25
|
+
super({
|
|
26
|
+
scope: AuthorizeComponent_1.name,
|
|
27
|
+
initDefault: { enable: true, container: application },
|
|
28
|
+
});
|
|
29
|
+
this.application = application;
|
|
30
|
+
}
|
|
31
|
+
binding() {
|
|
32
|
+
const options = this.application.get({
|
|
33
|
+
key: common_1.AuthorizeBindingKeys.OPTIONS,
|
|
34
|
+
isOptional: true,
|
|
35
|
+
});
|
|
36
|
+
if (!options) {
|
|
37
|
+
throw (0, ignis_helpers_1.getError)({
|
|
38
|
+
message: '[AuthorizeComponent] No authorize options found. Bind options to AuthorizeBindingKeys.OPTIONS before registering the component.',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
this.bindAlwaysAllowRoles({ options });
|
|
42
|
+
this.logger.for(this.binding.name).info('Authorization configured');
|
|
43
|
+
}
|
|
44
|
+
bindAlwaysAllowRoles(opts) {
|
|
45
|
+
if (!opts.options.alwaysAllowRoles?.length) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this.application
|
|
49
|
+
.bind({ key: common_1.AuthorizeBindingKeys.ALWAYS_ALLOW_ROLES })
|
|
50
|
+
.toValue(opts.options.alwaysAllowRoles);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
exports.AuthorizeComponent = AuthorizeComponent;
|
|
54
|
+
exports.AuthorizeComponent = AuthorizeComponent = AuthorizeComponent_1 = __decorate([
|
|
55
|
+
__param(0, (0, injectors_1.inject)({ key: bindings_1.CoreBindings.APPLICATION_INSTANCE })),
|
|
56
|
+
__metadata("design:paramtypes", [base_1.BaseApplication])
|
|
57
|
+
], AuthorizeComponent);
|
|
58
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/components/auth/authorize/component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAA2D;AAC3D,iDAAuD;AACvD,yDAAmD;AACnD,gDAAiD;AACjD,0DAAkE;AAClE,qCAAmE;AAEnE,IAAa,kBAAkB,0BAA/B,MAAa,kBAAmB,SAAQ,oBAAa;IACnD,YAC8D,WAA4B;QAExF,KAAK,CAAC;YACJ,KAAK,EAAE,oBAAkB,CAAC,IAAI;YAC9B,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE;SACtD,CAAC,CAAC;QALyD,gBAAW,GAAX,WAAW,CAAiB;IAM1F,CAAC;IAEQ,OAAO;QACd,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAoB;YACtD,GAAG,EAAE,6BAAoB,CAAC,OAAO;YACjC,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAA,wBAAQ,EAAC;gBACb,OAAO,EACL,iIAAiI;aACpI,CAAC,CAAC;QACL,CAAC;QAED,IAAI,CAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;QAEvC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IACtE,CAAC;IAEO,oBAAoB,CAAC,IAAoC;QAC/D,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,EAAE,CAAC;YAC3C,OAAO;QACT,CAAC;QAED,IAAI,CAAC,WAAW;aACb,IAAI,CAAW,EAAE,GAAG,EAAE,6BAAoB,CAAC,kBAAkB,EAAE,CAAC;aAChE,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;CACF,CAAA;AArCY,gDAAkB;6BAAlB,kBAAkB;IAE1B,WAAA,IAAA,kBAAM,EAAC,EAAE,GAAG,EAAE,uBAAY,CAAC,oBAAoB,EAAE,CAAC,CAAA;qCAAsB,sBAAe;GAF/E,kBAAkB,CAqC9B"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { TContext } from '../../../../base/controllers/common/types';
|
|
2
|
+
import { BaseHelper } from '@venizia/ignis-helpers';
|
|
3
|
+
import type { CachedEnforcer as CasbinCachedEnforcerType, Enforcer as CasbinEnforcerType } from 'casbin';
|
|
4
|
+
import { Env } from 'hono';
|
|
5
|
+
import { IAuthUser } from '../../authenticate';
|
|
6
|
+
import { IAuthorizationEnforcer, ICasbinEnforcerCachedRedis, ICasbinEnforcerOptions, type IAuthorizationComparable, type IAuthorizationRequest, type TAuthorizationDecision } from '../common';
|
|
7
|
+
export declare class CasbinAuthorizationEnforcer<E extends Env = Env, TAction extends string | IAuthorizationComparable = string, TResource extends string | IAuthorizationComparable = string> extends BaseHelper implements IAuthorizationEnforcer<E, TAction, TResource, IAuthUser> {
|
|
8
|
+
private options;
|
|
9
|
+
name: string;
|
|
10
|
+
private readonly MIN_EXPIRES_IN;
|
|
11
|
+
private enforcer;
|
|
12
|
+
private inMemoryInvalidationTimer;
|
|
13
|
+
constructor(options: ICasbinEnforcerOptions<E, TAction, TResource>);
|
|
14
|
+
configure(): Promise<void>;
|
|
15
|
+
destroy(): void;
|
|
16
|
+
buildRules(opts: {
|
|
17
|
+
user: {
|
|
18
|
+
principalType: string;
|
|
19
|
+
} & IAuthUser;
|
|
20
|
+
context: TContext<E, string>;
|
|
21
|
+
}): Promise<IAuthUser>;
|
|
22
|
+
evaluate(opts: {
|
|
23
|
+
rules: IAuthUser;
|
|
24
|
+
request: IAuthorizationRequest<TAction, TResource>;
|
|
25
|
+
context: TContext<E, string>;
|
|
26
|
+
}): Promise<TAuthorizationDecision>;
|
|
27
|
+
protected resolveCasbinEnforcer(opts: {
|
|
28
|
+
casbin: typeof import('casbin');
|
|
29
|
+
model: import('casbin').Model;
|
|
30
|
+
adapter?: unknown;
|
|
31
|
+
cached: ICasbinEnforcerOptions['cached'];
|
|
32
|
+
}): Promise<CasbinEnforcerType | CasbinCachedEnforcerType>;
|
|
33
|
+
protected resolveModel(opts: {
|
|
34
|
+
casbin: typeof import('casbin');
|
|
35
|
+
model: ICasbinEnforcerOptions['model'];
|
|
36
|
+
}): import("casbin").Model;
|
|
37
|
+
protected validateExpiresIn(opts: {
|
|
38
|
+
expiresIn: number;
|
|
39
|
+
}): void;
|
|
40
|
+
protected loadPoliciesFromAdapter(opts: {
|
|
41
|
+
user: {
|
|
42
|
+
principalType: string;
|
|
43
|
+
} & IAuthUser;
|
|
44
|
+
}): Promise<void>;
|
|
45
|
+
protected loadPoliciesWithRedisCache(opts: {
|
|
46
|
+
user: {
|
|
47
|
+
principalType: string;
|
|
48
|
+
} & IAuthUser;
|
|
49
|
+
cached: ICasbinEnforcerCachedRedis;
|
|
50
|
+
}): Promise<void>;
|
|
51
|
+
protected extractPolicyLines(): Promise<string[]>;
|
|
52
|
+
protected loadPolicyLinesIntoModel(opts: {
|
|
53
|
+
lines: string[];
|
|
54
|
+
}): Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=casbin.enforcer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"casbin.enforcer.d.ts","sourceRoot":"","sources":["../../../../../src/components/auth/authorize/enforcers/casbin.enforcer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAA6B,MAAM,wBAAwB,CAAC;AAC/E,OAAO,KAAK,EACV,cAAc,IAAI,wBAAwB,EAC1C,QAAQ,IAAI,kBAAkB,EAC/B,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAOL,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,WAAW,CAAC;AAInB,qBAAa,2BAA2B,CACtC,CAAC,SAAS,GAAG,GAAG,GAAG,EACnB,OAAO,SAAS,MAAM,GAAG,wBAAwB,GAAG,MAAM,EAC1D,SAAS,SAAS,MAAM,GAAG,wBAAwB,GAAG,MAAM,CAE5D,SAAQ,UACR,YAAW,sBAAsB,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC;IAUjE,OAAO,CAAC,OAAO;IARjB,IAAI,SAAoC;IACxC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAU;IAEzC,OAAO,CAAC,QAAQ,CAAkE;IAClF,OAAO,CAAC,yBAAyB,CAAmC;gBAI1D,OAAO,EAAE,sBAAsB,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,C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