@authup/server-core 1.0.0-beta.52 → 1.0.0-beta.53
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/dist/adapters/database/data-source/options/module.d.ts.map +1 -1
- package/dist/adapters/database/data-source/options/module.mjs +18 -8
- package/dist/adapters/database/data-source/options/module.mjs.map +1 -1
- package/dist/adapters/database/domains/client/entity.d.ts +5 -2
- package/dist/adapters/database/domains/client/entity.d.ts.map +1 -1
- package/dist/adapters/database/domains/client/entity.mjs +28 -4
- package/dist/adapters/database/domains/client/entity.mjs.map +1 -1
- package/dist/adapters/database/domains/client-permission/entity.mjs +2 -2
- package/dist/adapters/database/domains/consent/entity.d.ts +20 -0
- package/dist/adapters/database/domains/consent/entity.d.ts.map +1 -0
- package/dist/adapters/database/domains/consent/entity.mjs +110 -0
- package/dist/adapters/database/domains/consent/entity.mjs.map +1 -0
- package/dist/adapters/database/domains/consent/index.d.ts +3 -0
- package/dist/adapters/database/domains/consent/index.d.ts.map +1 -0
- package/dist/adapters/database/domains/consent/index.mjs +6 -0
- package/dist/adapters/database/domains/consent/subscriber.d.ts +6 -0
- package/dist/adapters/database/domains/consent/subscriber.d.ts.map +1 -0
- package/dist/adapters/database/domains/consent/subscriber.mjs +45 -0
- package/dist/adapters/database/domains/consent/subscriber.mjs.map +1 -0
- package/dist/adapters/database/domains/constants.d.ts +1 -0
- package/dist/adapters/database/domains/constants.d.ts.map +1 -1
- package/dist/adapters/database/domains/constants.mjs +1 -0
- package/dist/adapters/database/domains/constants.mjs.map +1 -1
- package/dist/adapters/database/domains/event/entity.d.ts +22 -0
- package/dist/adapters/database/domains/event/entity.d.ts.map +1 -0
- package/dist/adapters/database/domains/event/entity.mjs +174 -0
- package/dist/adapters/database/domains/event/entity.mjs.map +1 -0
- package/dist/adapters/database/domains/event/index.d.ts +2 -0
- package/dist/adapters/database/domains/event/index.d.ts.map +1 -0
- package/dist/adapters/database/domains/event/index.mjs +5 -0
- package/dist/adapters/database/domains/identity-provider-account/entity.mjs +2 -2
- package/dist/adapters/database/domains/index.d.ts +4 -0
- package/dist/adapters/database/domains/index.d.ts.map +1 -1
- package/dist/adapters/database/domains/index.mjs +24 -15
- package/dist/adapters/database/domains/key/entity.d.ts +7 -3
- package/dist/adapters/database/domains/key/entity.d.ts.map +1 -1
- package/dist/adapters/database/domains/key/entity.mjs +35 -10
- package/dist/adapters/database/domains/key/entity.mjs.map +1 -1
- package/dist/adapters/database/domains/permission-policy/entity.mjs +2 -2
- package/dist/adapters/database/domains/policy/repository.d.ts.map +1 -1
- package/dist/adapters/database/domains/policy/repository.mjs +3 -3
- package/dist/adapters/database/domains/policy/repository.mjs.map +1 -1
- package/dist/adapters/database/domains/robot-permission/entity.mjs +2 -2
- package/dist/adapters/database/domains/role/repository.mjs +1 -1
- package/dist/adapters/database/domains/role-permission/entity.mjs +2 -2
- package/dist/adapters/database/domains/session/entity.d.ts +3 -1
- package/dist/adapters/database/domains/session/entity.d.ts.map +1 -1
- package/dist/adapters/database/domains/session/entity.mjs +12 -0
- package/dist/adapters/database/domains/session/entity.mjs.map +1 -1
- package/dist/adapters/database/domains/trust-anchor/entity.d.ts +13 -0
- package/dist/adapters/database/domains/trust-anchor/entity.d.ts.map +1 -0
- package/dist/adapters/database/domains/trust-anchor/entity.mjs +55 -0
- package/dist/adapters/database/domains/trust-anchor/entity.mjs.map +1 -0
- package/dist/adapters/database/domains/trust-anchor/index.d.ts +2 -0
- package/dist/adapters/database/domains/trust-anchor/index.d.ts.map +1 -0
- package/dist/adapters/database/domains/trust-anchor/index.mjs +5 -0
- package/dist/adapters/database/domains/user-authenticator/entity.d.ts +20 -0
- package/dist/adapters/database/domains/user-authenticator/entity.d.ts.map +1 -0
- package/dist/adapters/database/domains/user-authenticator/entity.mjs +98 -0
- package/dist/adapters/database/domains/user-authenticator/entity.mjs.map +1 -0
- package/dist/adapters/database/domains/user-authenticator/index.d.ts +2 -0
- package/dist/adapters/database/domains/user-authenticator/index.d.ts.map +1 -0
- package/dist/adapters/database/domains/user-authenticator/index.mjs +5 -0
- package/dist/adapters/database/domains/user-permission/entity.mjs +1 -1
- package/dist/adapters/database/errors/driver.d.ts +14 -0
- package/dist/adapters/database/errors/driver.d.ts.map +1 -0
- package/dist/adapters/database/errors/driver.mjs +32 -0
- package/dist/adapters/database/errors/driver.mjs.map +1 -0
- package/dist/adapters/database/errors/index.d.ts +1 -0
- package/dist/adapters/database/errors/index.d.ts.map +1 -1
- package/dist/adapters/database/errors/index.mjs +2 -1
- package/dist/adapters/database/index.mjs +17 -11
- package/dist/adapters/database/migrations/mysql/1783769340000-Default.d.ts +50 -0
- package/dist/adapters/database/migrations/mysql/1783769340000-Default.d.ts.map +1 -0
- package/dist/adapters/database/migrations/mysql/1783769340000-Default.mjs +320 -0
- package/dist/adapters/database/migrations/mysql/1783769340000-Default.mjs.map +1 -0
- package/dist/adapters/database/migrations/postgres/1783769340000-Default.d.ts +50 -0
- package/dist/adapters/database/migrations/postgres/1783769340000-Default.d.ts.map +1 -0
- package/dist/adapters/database/migrations/postgres/1783769340000-Default.mjs +310 -0
- package/dist/adapters/database/migrations/postgres/1783769340000-Default.mjs.map +1 -0
- package/dist/adapters/database/subscriber/module.d.ts +1 -1
- package/dist/adapters/database/subscriber/module.d.ts.map +1 -1
- package/dist/adapters/database/subscriber/module.mjs +4 -3
- package/dist/adapters/database/subscriber/module.mjs.map +1 -1
- package/dist/adapters/http/adapters/index.mjs +2 -1
- package/dist/adapters/http/adapters/oauth2/authorization/module.d.ts +4 -1
- package/dist/adapters/http/adapters/oauth2/authorization/module.d.ts.map +1 -1
- package/dist/adapters/http/adapters/oauth2/authorization/module.mjs +27 -2
- package/dist/adapters/http/adapters/oauth2/authorization/module.mjs.map +1 -1
- package/dist/adapters/http/adapters/oauth2/authorization/types.d.ts +9 -1
- package/dist/adapters/http/adapters/oauth2/authorization/types.d.ts.map +1 -1
- package/dist/adapters/http/adapters/oauth2/grant-types/authorize.d.ts +4 -1
- package/dist/adapters/http/adapters/oauth2/grant-types/authorize.d.ts.map +1 -1
- package/dist/adapters/http/adapters/oauth2/grant-types/authorize.mjs +23 -3
- package/dist/adapters/http/adapters/oauth2/grant-types/authorize.mjs.map +1 -1
- package/dist/adapters/http/adapters/oauth2/grant-types/client-credentials.d.ts +4 -3
- package/dist/adapters/http/adapters/oauth2/grant-types/client-credentials.d.ts.map +1 -1
- package/dist/adapters/http/adapters/oauth2/grant-types/client-credentials.mjs +13 -6
- package/dist/adapters/http/adapters/oauth2/grant-types/client-credentials.mjs.map +1 -1
- package/dist/adapters/http/adapters/oauth2/grant-types/index.mjs +2 -1
- package/dist/adapters/http/adapters/oauth2/grant-types/password.d.ts +38 -2
- package/dist/adapters/http/adapters/oauth2/grant-types/password.d.ts.map +1 -1
- package/dist/adapters/http/adapters/oauth2/grant-types/password.mjs +119 -6
- package/dist/adapters/http/adapters/oauth2/grant-types/password.mjs.map +1 -1
- package/dist/adapters/http/adapters/oauth2/grant-types/refresh_token.d.ts +2 -0
- package/dist/adapters/http/adapters/oauth2/grant-types/refresh_token.d.ts.map +1 -1
- package/dist/adapters/http/adapters/oauth2/grant-types/refresh_token.mjs +16 -3
- package/dist/adapters/http/adapters/oauth2/grant-types/refresh_token.mjs.map +1 -1
- package/dist/adapters/http/adapters/oauth2/grant-types/types.d.ts +14 -3
- package/dist/adapters/http/adapters/oauth2/grant-types/types.d.ts.map +1 -1
- package/dist/adapters/http/adapters/oauth2/grant-types/utils/certificate.d.ts +5 -0
- package/dist/adapters/http/adapters/oauth2/grant-types/utils/certificate.d.ts.map +1 -0
- package/dist/adapters/http/adapters/oauth2/grant-types/utils/certificate.mjs +18 -0
- package/dist/adapters/http/adapters/oauth2/grant-types/utils/certificate.mjs.map +1 -0
- package/dist/adapters/http/adapters/oauth2/grant-types/utils/credentials.mjs +1 -1
- package/dist/adapters/http/adapters/oauth2/grant-types/utils/guess.mjs +1 -1
- package/dist/adapters/http/adapters/oauth2/grant-types/utils/index.d.ts +1 -0
- package/dist/adapters/http/adapters/oauth2/grant-types/utils/index.d.ts.map +1 -1
- package/dist/adapters/http/adapters/oauth2/grant-types/utils/index.mjs +2 -1
- package/dist/adapters/http/adapters/oauth2/index.mjs +2 -1
- package/dist/adapters/http/controllers/entities/consent/index.d.ts +2 -0
- package/dist/adapters/http/controllers/entities/consent/index.d.ts.map +1 -0
- package/dist/adapters/http/controllers/entities/consent/index.mjs +5 -0
- package/dist/adapters/http/controllers/entities/consent/module.d.ts +15 -0
- package/dist/adapters/http/controllers/entities/consent/module.d.ts.map +1 -0
- package/dist/adapters/http/controllers/entities/consent/module.mjs +82 -0
- package/dist/adapters/http/controllers/entities/consent/module.mjs.map +1 -0
- package/dist/adapters/http/controllers/entities/event/index.d.ts +2 -0
- package/dist/adapters/http/controllers/entities/event/index.d.ts.map +1 -0
- package/dist/adapters/http/controllers/entities/event/index.mjs +5 -0
- package/dist/adapters/http/controllers/entities/event/module.d.ts +14 -0
- package/dist/adapters/http/controllers/entities/event/module.d.ts.map +1 -0
- package/dist/adapters/http/controllers/entities/event/module.mjs +68 -0
- package/dist/adapters/http/controllers/entities/event/module.mjs.map +1 -0
- package/dist/adapters/http/controllers/entities/identity-provider/module.d.ts +4 -1
- package/dist/adapters/http/controllers/entities/identity-provider/module.d.ts.map +1 -1
- package/dist/adapters/http/controllers/entities/identity-provider/module.mjs +38 -10
- package/dist/adapters/http/controllers/entities/identity-provider/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/entities/identity-provider/types.d.ts +3 -1
- package/dist/adapters/http/controllers/entities/identity-provider/types.d.ts.map +1 -1
- package/dist/adapters/http/controllers/entities/index.d.ts +5 -0
- package/dist/adapters/http/controllers/entities/index.d.ts.map +1 -1
- package/dist/adapters/http/controllers/entities/index.mjs +11 -1
- package/dist/adapters/http/controllers/entities/key/index.d.ts +2 -0
- package/dist/adapters/http/controllers/entities/key/index.d.ts.map +1 -0
- package/dist/adapters/http/controllers/entities/key/index.mjs +5 -0
- package/dist/adapters/http/controllers/entities/key/module.d.ts +17 -0
- package/dist/adapters/http/controllers/entities/key/module.d.ts.map +1 -0
- package/dist/adapters/http/controllers/entities/key/module.mjs +122 -0
- package/dist/adapters/http/controllers/entities/key/module.mjs.map +1 -0
- package/dist/adapters/http/controllers/entities/policy/utils/validation.mjs +1 -1
- package/dist/adapters/http/controllers/entities/realm/module.d.ts +2 -0
- package/dist/adapters/http/controllers/entities/realm/module.d.ts.map +1 -1
- package/dist/adapters/http/controllers/entities/realm/module.mjs +16 -1
- package/dist/adapters/http/controllers/entities/realm/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/entities/trust-anchor/index.d.ts +2 -0
- package/dist/adapters/http/controllers/entities/trust-anchor/index.d.ts.map +1 -0
- package/dist/adapters/http/controllers/entities/trust-anchor/index.mjs +5 -0
- package/dist/adapters/http/controllers/entities/trust-anchor/module.d.ts +17 -0
- package/dist/adapters/http/controllers/entities/trust-anchor/module.d.ts.map +1 -0
- package/dist/adapters/http/controllers/entities/trust-anchor/module.mjs +120 -0
- package/dist/adapters/http/controllers/entities/trust-anchor/module.mjs.map +1 -0
- package/dist/adapters/http/controllers/entities/user-authenticator/index.d.ts +2 -0
- package/dist/adapters/http/controllers/entities/user-authenticator/index.d.ts.map +1 -0
- package/dist/adapters/http/controllers/entities/user-authenticator/index.mjs +5 -0
- package/dist/adapters/http/controllers/entities/user-authenticator/module.d.ts +21 -0
- package/dist/adapters/http/controllers/entities/user-authenticator/module.d.ts.map +1 -0
- package/dist/adapters/http/controllers/entities/user-authenticator/module.mjs +154 -0
- package/dist/adapters/http/controllers/entities/user-authenticator/module.mjs.map +1 -0
- package/dist/adapters/http/controllers/index.mjs +7 -1
- package/dist/adapters/http/controllers/workflows/authenticator-challenge/index.d.ts +2 -0
- package/dist/adapters/http/controllers/workflows/authenticator-challenge/index.d.ts.map +1 -0
- package/dist/adapters/http/controllers/workflows/authenticator-challenge/index.mjs +5 -0
- package/dist/adapters/http/controllers/workflows/authenticator-challenge/module.d.ts +46 -0
- package/dist/adapters/http/controllers/workflows/authenticator-challenge/module.d.ts.map +1 -0
- package/dist/adapters/http/controllers/workflows/authenticator-challenge/module.mjs +132 -0
- package/dist/adapters/http/controllers/workflows/authenticator-challenge/module.mjs.map +1 -0
- package/dist/adapters/http/controllers/workflows/authorize/module.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/authorize/module.mjs +34 -6
- package/dist/adapters/http/controllers/workflows/authorize/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/workflows/authorize/types.d.ts +17 -1
- package/dist/adapters/http/controllers/workflows/authorize/types.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/index.d.ts +1 -0
- package/dist/adapters/http/controllers/workflows/index.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/index.mjs +3 -1
- package/dist/adapters/http/controllers/workflows/jwks/handlers/read.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/jwks/handlers/read.mjs +28 -14
- package/dist/adapters/http/controllers/workflows/jwks/handlers/read.mjs.map +1 -1
- package/dist/adapters/http/controllers/workflows/jwks/module.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/jwks/module.mjs +28 -14
- package/dist/adapters/http/controllers/workflows/jwks/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/workflows/token/module.d.ts +2 -1
- package/dist/adapters/http/controllers/workflows/token/module.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/token/module.mjs +28 -8
- package/dist/adapters/http/controllers/workflows/token/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/workflows/token/types.d.ts +11 -4
- package/dist/adapters/http/controllers/workflows/token/types.d.ts.map +1 -1
- package/dist/adapters/http/index.mjs +13 -3
- package/dist/adapters/http/middleware/built-in/assets.mjs +1 -1
- package/dist/adapters/http/middleware/built-in/authorization/module.d.ts +13 -0
- package/dist/adapters/http/middleware/built-in/authorization/module.d.ts.map +1 -1
- package/dist/adapters/http/middleware/built-in/authorization/module.mjs +52 -2
- package/dist/adapters/http/middleware/built-in/authorization/module.mjs.map +1 -1
- package/dist/adapters/http/middleware/built-in/authorization/types.d.ts +2 -0
- package/dist/adapters/http/middleware/built-in/authorization/types.d.ts.map +1 -1
- package/dist/adapters/http/middleware/built-in/index.mjs +2 -2
- package/dist/adapters/http/middleware/built-in/prometheus.d.ts +12 -1
- package/dist/adapters/http/middleware/built-in/prometheus.d.ts.map +1 -1
- package/dist/adapters/http/middleware/built-in/prometheus.mjs +75 -6
- package/dist/adapters/http/middleware/built-in/prometheus.mjs.map +1 -1
- package/dist/adapters/http/middleware/index.mjs +2 -2
- package/dist/adapters/http/request/client-certificate.d.ts +5 -0
- package/dist/adapters/http/request/client-certificate.d.ts.map +1 -0
- package/dist/adapters/http/request/client-certificate.mjs +88 -0
- package/dist/adapters/http/request/client-certificate.mjs.map +1 -0
- package/dist/adapters/http/request/constants.d.ts +1 -0
- package/dist/adapters/http/request/constants.d.ts.map +1 -1
- package/dist/adapters/http/request/constants.mjs +6 -1
- package/dist/adapters/http/request/constants.mjs.map +1 -1
- package/dist/adapters/http/request/event-context.d.ts +19 -0
- package/dist/adapters/http/request/event-context.d.ts.map +1 -0
- package/dist/adapters/http/request/event-context.mjs +37 -0
- package/dist/adapters/http/request/event-context.mjs.map +1 -0
- package/dist/adapters/http/request/helpers/index.d.ts +1 -0
- package/dist/adapters/http/request/helpers/index.d.ts.map +1 -1
- package/dist/adapters/http/request/helpers/index.mjs +2 -1
- package/dist/adapters/http/request/helpers/mfa-login-ticket.d.ts +16 -0
- package/dist/adapters/http/request/helpers/mfa-login-ticket.d.ts.map +1 -0
- package/dist/adapters/http/request/helpers/mfa-login-ticket.mjs +15 -0
- package/dist/adapters/http/request/helpers/mfa-login-ticket.mjs.map +1 -0
- package/dist/adapters/http/request/index.d.ts +3 -0
- package/dist/adapters/http/request/index.d.ts.map +1 -1
- package/dist/adapters/http/request/index.mjs +5 -2
- package/dist/adapters/http/request/types.d.ts +3 -0
- package/dist/adapters/http/request/types.d.ts.map +1 -0
- package/dist/adapters/http/ui/render.mjs +2 -2
- package/dist/app/index.mjs +11 -5
- package/dist/app/modules/components/module.d.ts.map +1 -1
- package/dist/app/modules/components/module.mjs +22 -2
- package/dist/app/modules/components/module.mjs.map +1 -1
- package/dist/app/modules/config/constants.d.ts +14 -0
- package/dist/app/modules/config/constants.d.ts.map +1 -1
- package/dist/app/modules/config/constants.mjs +14 -0
- package/dist/app/modules/config/constants.mjs.map +1 -1
- package/dist/app/modules/config/normalize.d.ts.map +1 -1
- package/dist/app/modules/config/normalize.mjs +30 -2
- package/dist/app/modules/config/normalize.mjs.map +1 -1
- package/dist/app/modules/config/read/env.d.ts.map +1 -1
- package/dist/app/modules/config/read/env.mjs +57 -0
- package/dist/app/modules/config/read/env.mjs.map +1 -1
- package/dist/app/modules/config/types.d.ts +101 -0
- package/dist/app/modules/config/types.d.ts.map +1 -1
- package/dist/app/modules/config/validator.d.ts.map +1 -1
- package/dist/app/modules/config/validator.mjs +16 -0
- package/dist/app/modules/config/validator.mjs.map +1 -1
- package/dist/app/modules/database/constants.d.ts +3 -0
- package/dist/app/modules/database/constants.d.ts.map +1 -1
- package/dist/app/modules/database/constants.mjs +3 -1
- package/dist/app/modules/database/constants.mjs.map +1 -1
- package/dist/app/modules/database/index.mjs +7 -3
- package/dist/app/modules/database/module.d.ts +1 -0
- package/dist/app/modules/database/module.d.ts.map +1 -1
- package/dist/app/modules/database/module.mjs +32 -1
- package/dist/app/modules/database/module.mjs.map +1 -1
- package/dist/app/modules/database/repositories/client/repository.d.ts.map +1 -1
- package/dist/app/modules/database/repositories/client/repository.mjs +8 -4
- package/dist/app/modules/database/repositories/client/repository.mjs.map +1 -1
- package/dist/app/modules/database/repositories/event/index.d.ts.map +1 -0
- package/dist/app/modules/database/repositories/event/index.mjs +5 -0
- package/dist/app/modules/database/repositories/event/repository.d.ts +15 -0
- package/dist/app/modules/database/repositories/event/repository.d.ts.map +1 -0
- package/dist/app/modules/database/repositories/event/repository.mjs +113 -0
- package/dist/app/modules/database/repositories/event/repository.mjs.map +1 -0
- package/dist/app/modules/database/repositories/helpers.d.ts +4 -2
- package/dist/app/modules/database/repositories/helpers.d.ts.map +1 -1
- package/dist/app/modules/database/repositories/helpers.mjs +7 -3
- package/dist/app/modules/database/repositories/helpers.mjs.map +1 -1
- package/dist/app/modules/database/repositories/index.d.ts +4 -0
- package/dist/app/modules/database/repositories/index.d.ts.map +1 -1
- package/dist/app/modules/database/repositories/index.mjs +9 -1
- package/dist/app/modules/database/repositories/key/index.d.ts +2 -0
- package/dist/app/modules/database/repositories/key/index.d.ts.map +1 -0
- package/dist/app/modules/database/repositories/key/index.mjs +5 -0
- package/dist/app/modules/database/repositories/key/repository.d.ts +50 -0
- package/dist/app/modules/database/repositories/key/repository.d.ts.map +1 -0
- package/dist/app/modules/database/repositories/key/repository.mjs +273 -0
- package/dist/app/modules/database/repositories/key/repository.mjs.map +1 -0
- package/dist/app/modules/database/repositories/permission-provider/module.mjs +1 -1
- package/dist/app/modules/database/repositories/trust-anchor/index.d.ts +2 -0
- package/dist/app/modules/database/repositories/trust-anchor/index.d.ts.map +1 -0
- package/dist/app/modules/database/repositories/trust-anchor/index.mjs +5 -0
- package/dist/app/modules/database/repositories/trust-anchor/repository.d.ts +24 -0
- package/dist/app/modules/database/repositories/trust-anchor/repository.d.ts.map +1 -0
- package/dist/app/modules/database/repositories/trust-anchor/repository.mjs +113 -0
- package/dist/app/modules/database/repositories/trust-anchor/repository.mjs.map +1 -0
- package/dist/app/modules/database/repositories/user-authenticator/index.d.ts +2 -0
- package/dist/app/modules/database/repositories/user-authenticator/index.d.ts.map +1 -0
- package/dist/app/modules/database/repositories/user-authenticator/index.mjs +5 -0
- package/dist/app/modules/database/repositories/user-authenticator/repository.d.ts +19 -0
- package/dist/app/modules/database/repositories/user-authenticator/repository.d.ts.map +1 -0
- package/dist/app/modules/database/repositories/user-authenticator/repository.mjs +92 -0
- package/dist/app/modules/database/repositories/user-authenticator/repository.mjs.map +1 -0
- package/dist/app/modules/http/module.d.ts +8 -0
- package/dist/app/modules/http/module.d.ts.map +1 -1
- package/dist/app/modules/http/module.mjs +19 -1
- package/dist/app/modules/http/module.mjs.map +1 -1
- package/dist/app/modules/http/modules/controller.d.ts +16 -3
- package/dist/app/modules/http/modules/controller.d.ts.map +1 -1
- package/dist/app/modules/http/modules/controller.mjs +186 -15
- package/dist/app/modules/http/modules/controller.mjs.map +1 -1
- package/dist/app/modules/http/modules/middleware.d.ts +1 -0
- package/dist/app/modules/http/modules/middleware.d.ts.map +1 -1
- package/dist/app/modules/http/modules/middleware.mjs +10 -4
- package/dist/app/modules/http/modules/middleware.mjs.map +1 -1
- package/dist/app/modules/identity/module.mjs +2 -2
- package/dist/app/modules/index.d.ts +1 -0
- package/dist/app/modules/index.d.ts.map +1 -1
- package/dist/app/modules/index.mjs +13 -6
- package/dist/app/modules/mail/module.d.ts.map +1 -1
- package/dist/app/modules/mail/module.mjs +2 -1
- package/dist/app/modules/mail/module.mjs.map +1 -1
- package/dist/app/modules/metrics/constants.d.ts +4 -0
- package/dist/app/modules/metrics/constants.d.ts.map +1 -0
- package/dist/app/modules/metrics/constants.mjs +10 -0
- package/dist/app/modules/metrics/constants.mjs.map +1 -0
- package/dist/app/modules/metrics/index.d.ts +3 -0
- package/dist/app/modules/metrics/index.d.ts.map +1 -0
- package/dist/app/modules/metrics/index.mjs +6 -0
- package/dist/app/modules/metrics/prom.d.ts +15 -0
- package/dist/app/modules/metrics/prom.d.ts.map +1 -0
- package/dist/app/modules/metrics/prom.mjs +42 -0
- package/dist/app/modules/metrics/prom.mjs.map +1 -0
- package/dist/app/modules/oauth2/constants.d.ts +9 -2
- package/dist/app/modules/oauth2/constants.d.ts.map +1 -1
- package/dist/app/modules/oauth2/constants.mjs +7 -1
- package/dist/app/modules/oauth2/constants.mjs.map +1 -1
- package/dist/app/modules/oauth2/module.d.ts.map +1 -1
- package/dist/app/modules/oauth2/module.mjs +23 -4
- package/dist/app/modules/oauth2/module.mjs.map +1 -1
- package/dist/app/modules/oauth2/repositories/consent/index.d.ts +2 -0
- package/dist/app/modules/oauth2/repositories/consent/index.d.ts.map +1 -0
- package/dist/app/modules/oauth2/repositories/consent/index.mjs +5 -0
- package/dist/app/modules/oauth2/repositories/consent/repository.d.ts +20 -0
- package/dist/app/modules/oauth2/repositories/consent/repository.d.ts.map +1 -0
- package/dist/app/modules/oauth2/repositories/consent/repository.mjs +116 -0
- package/dist/app/modules/oauth2/repositories/consent/repository.mjs.map +1 -0
- package/dist/app/modules/oauth2/repositories/index.d.ts +1 -1
- package/dist/app/modules/oauth2/repositories/index.d.ts.map +1 -1
- package/dist/app/modules/oauth2/repositories/index.mjs +3 -3
- package/dist/app/modules/oauth2/repositories/token/repository.d.ts +1 -0
- package/dist/app/modules/oauth2/repositories/token/repository.d.ts.map +1 -1
- package/dist/app/modules/oauth2/repositories/token/repository.mjs +8 -0
- package/dist/app/modules/oauth2/repositories/token/repository.mjs.map +1 -1
- package/dist/app/modules/provisioning/module.d.ts.map +1 -1
- package/dist/app/modules/provisioning/module.mjs +16 -5
- package/dist/app/modules/provisioning/module.mjs.map +1 -1
- package/dist/app/modules/provisioning/sources/default/module.d.ts.map +1 -1
- package/dist/app/modules/provisioning/sources/default/module.mjs +22 -7
- package/dist/app/modules/provisioning/sources/default/module.mjs.map +1 -1
- package/dist/app/modules/provisioning/sources/file/module.d.ts.map +1 -1
- package/dist/app/modules/provisioning/sources/file/module.mjs +12 -2
- package/dist/app/modules/provisioning/sources/file/module.mjs.map +1 -1
- package/dist/components/event-cleaner/index.d.ts +2 -0
- package/dist/components/event-cleaner/index.d.ts.map +1 -0
- package/dist/components/event-cleaner/index.mjs +5 -0
- package/dist/components/event-cleaner/module.d.ts +5 -0
- package/dist/components/event-cleaner/module.d.ts.map +1 -0
- package/dist/components/event-cleaner/module.mjs +30 -0
- package/dist/components/event-cleaner/module.mjs.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.mjs +3 -1
- package/dist/components/oauth2-cleaner/module.d.ts +2 -1
- package/dist/components/oauth2-cleaner/module.d.ts.map +1 -1
- package/dist/components/oauth2-cleaner/module.mjs +9 -4
- package/dist/components/oauth2-cleaner/module.mjs.map +1 -1
- package/dist/core/authentication/credential/entities/client/module.d.ts +1 -1
- package/dist/core/authentication/credential/entities/client/module.d.ts.map +1 -1
- package/dist/core/authentication/credential/entities/client/module.mjs +2 -1
- package/dist/core/authentication/credential/entities/client/module.mjs.map +1 -1
- package/dist/core/authentication/entities/client/module.mjs +2 -2
- package/dist/core/authentication/entities/client/module.mjs.map +1 -1
- package/dist/core/authentication/index.d.ts +1 -0
- package/dist/core/authentication/index.d.ts.map +1 -1
- package/dist/core/authentication/index.mjs +3 -1
- package/dist/core/authentication/login-throttle/index.d.ts +3 -0
- package/dist/core/authentication/login-throttle/index.d.ts.map +1 -0
- package/dist/core/authentication/login-throttle/index.mjs +5 -0
- package/dist/core/authentication/login-throttle/service.d.ts +13 -0
- package/dist/core/authentication/login-throttle/service.d.ts.map +1 -0
- package/dist/core/authentication/login-throttle/service.mjs +33 -0
- package/dist/core/authentication/login-throttle/service.mjs.map +1 -0
- package/dist/core/authentication/login-throttle/types.d.ts +34 -0
- package/dist/core/authentication/login-throttle/types.d.ts.map +1 -0
- package/dist/core/authentication/session/module.d.ts +1 -0
- package/dist/core/authentication/session/module.d.ts.map +1 -1
- package/dist/core/authentication/session/module.mjs +4 -0
- package/dist/core/authentication/session/module.mjs.map +1 -1
- package/dist/core/authentication/session/types.d.ts +6 -0
- package/dist/core/authentication/session/types.d.ts.map +1 -1
- package/dist/core/authentication/session/types.mjs.map +1 -1
- package/dist/core/client-certificate/index.d.ts +3 -0
- package/dist/core/client-certificate/index.d.ts.map +1 -0
- package/dist/core/client-certificate/index.mjs +5 -0
- package/dist/core/client-certificate/module.d.ts +18 -0
- package/dist/core/client-certificate/module.d.ts.map +1 -0
- package/dist/core/client-certificate/module.mjs +195 -0
- package/dist/core/client-certificate/module.mjs.map +1 -0
- package/dist/core/client-certificate/types.d.ts +22 -0
- package/dist/core/client-certificate/types.d.ts.map +1 -0
- package/dist/core/client-certificate/types.mjs +4 -0
- package/dist/core/entities/client/service.d.ts.map +1 -1
- package/dist/core/entities/client/service.mjs +15 -7
- package/dist/core/entities/client/service.mjs.map +1 -1
- package/dist/core/entities/client/web-client.d.ts.map +1 -1
- package/dist/core/entities/client/web-client.mjs +3 -2
- package/dist/core/entities/client/web-client.mjs.map +1 -1
- package/dist/core/entities/consent/index.d.ts +3 -0
- package/dist/core/entities/consent/index.d.ts.map +1 -0
- package/dist/core/entities/consent/index.mjs +6 -0
- package/dist/core/entities/consent/service.d.ts +19 -0
- package/dist/core/entities/consent/service.d.ts.map +1 -0
- package/dist/core/entities/consent/service.mjs +122 -0
- package/dist/core/entities/consent/service.mjs.map +1 -0
- package/dist/core/entities/consent/types.d.ts +97 -0
- package/dist/core/entities/consent/types.d.ts.map +1 -0
- package/dist/core/entities/consent/types.mjs +25 -0
- package/dist/core/entities/consent/types.mjs.map +1 -0
- package/dist/core/entities/event/constants.d.ts +7 -0
- package/dist/core/entities/event/constants.d.ts.map +1 -0
- package/dist/core/entities/event/constants.mjs +13 -0
- package/dist/core/entities/event/constants.mjs.map +1 -0
- package/dist/core/entities/event/diff.d.ts +20 -0
- package/dist/core/entities/event/diff.d.ts.map +1 -0
- package/dist/core/entities/event/diff.mjs +45 -0
- package/dist/core/entities/event/diff.mjs.map +1 -0
- package/dist/core/entities/event/entity-event-handler.d.ts +19 -0
- package/dist/core/entities/event/entity-event-handler.d.ts.map +1 -0
- package/dist/core/entities/event/entity-event-handler.mjs +100 -0
- package/dist/core/entities/event/entity-event-handler.mjs.map +1 -0
- package/dist/core/entities/event/index.d.ts +7 -0
- package/dist/core/entities/event/index.d.ts.map +1 -0
- package/dist/core/entities/event/index.mjs +9 -0
- package/dist/core/entities/event/sanitize.d.ts +2 -0
- package/dist/core/entities/event/sanitize.d.ts.map +1 -0
- package/dist/core/entities/event/sanitize.mjs +83 -0
- package/dist/core/entities/event/sanitize.mjs.map +1 -0
- package/dist/core/entities/event/service.d.ts +22 -0
- package/dist/core/entities/event/service.d.ts.map +1 -0
- package/dist/core/entities/event/service.mjs +169 -0
- package/dist/core/entities/event/service.mjs.map +1 -0
- package/dist/core/entities/event/types.d.ts +124 -0
- package/dist/core/entities/event/types.d.ts.map +1 -0
- package/dist/core/entities/event/types.mjs +4 -0
- package/dist/core/entities/identity-provider-role-mapping/service.mjs +2 -2
- package/dist/core/entities/identity-provider-role-mapping/service.mjs.map +1 -1
- package/dist/core/entities/index.d.ts +5 -0
- package/dist/core/entities/index.d.ts.map +1 -1
- package/dist/core/entities/index.mjs +20 -1
- package/dist/core/entities/key/index.d.ts +3 -0
- package/dist/core/entities/key/index.d.ts.map +1 -0
- package/dist/core/entities/key/index.mjs +5 -0
- package/dist/core/entities/key/service.d.ts +55 -0
- package/dist/core/entities/key/service.d.ts.map +1 -0
- package/dist/core/entities/key/service.mjs +301 -0
- package/dist/core/entities/key/service.mjs.map +1 -0
- package/dist/core/entities/key/types.d.ts +33 -0
- package/dist/core/entities/key/types.d.ts.map +1 -0
- package/dist/core/entities/key/types.mjs +4 -0
- package/dist/core/entities/permission/service.mjs +3 -3
- package/dist/core/entities/permission/service.mjs.map +1 -1
- package/dist/core/entities/policy/service.mjs +4 -4
- package/dist/core/entities/policy/service.mjs.map +1 -1
- package/dist/core/entities/realm/service.d.ts +3 -0
- package/dist/core/entities/realm/service.d.ts.map +1 -1
- package/dist/core/entities/realm/service.mjs +6 -3
- package/dist/core/entities/realm/service.mjs.map +1 -1
- package/dist/core/entities/role/service.mjs +2 -2
- package/dist/core/entities/role/service.mjs.map +1 -1
- package/dist/core/entities/role-attribute/service.mjs +3 -3
- package/dist/core/entities/role-attribute/service.mjs.map +1 -1
- package/dist/core/entities/session/service.mjs +5 -2
- package/dist/core/entities/session/service.mjs.map +1 -1
- package/dist/core/entities/trust-anchor/index.d.ts +3 -0
- package/dist/core/entities/trust-anchor/index.d.ts.map +1 -0
- package/dist/core/entities/trust-anchor/index.mjs +5 -0
- package/dist/core/entities/trust-anchor/service.d.ts +33 -0
- package/dist/core/entities/trust-anchor/service.d.ts.map +1 -0
- package/dist/core/entities/trust-anchor/service.mjs +175 -0
- package/dist/core/entities/trust-anchor/service.mjs.map +1 -0
- package/dist/core/entities/trust-anchor/types.d.ts +14 -0
- package/dist/core/entities/trust-anchor/types.d.ts.map +1 -0
- package/dist/core/entities/trust-anchor/types.mjs +4 -0
- package/dist/core/entities/user/service.mjs +2 -2
- package/dist/core/entities/user/service.mjs.map +1 -1
- package/dist/core/entities/user-attribute/service.mjs +4 -4
- package/dist/core/entities/user-attribute/service.mjs.map +1 -1
- package/dist/core/entities/user-authenticator/constants.d.ts +26 -0
- package/dist/core/entities/user-authenticator/constants.d.ts.map +1 -0
- package/dist/core/entities/user-authenticator/constants.mjs +32 -0
- package/dist/core/entities/user-authenticator/constants.mjs.map +1 -0
- package/dist/core/entities/user-authenticator/helpers.d.ts +10 -0
- package/dist/core/entities/user-authenticator/helpers.d.ts.map +1 -0
- package/dist/core/entities/user-authenticator/helpers.mjs +35 -0
- package/dist/core/entities/user-authenticator/helpers.mjs.map +1 -0
- package/dist/core/entities/user-authenticator/index.d.ts +6 -0
- package/dist/core/entities/user-authenticator/index.d.ts.map +1 -0
- package/dist/core/entities/user-authenticator/index.mjs +9 -0
- package/dist/core/entities/user-authenticator/service.d.ts +89 -0
- package/dist/core/entities/user-authenticator/service.d.ts.map +1 -0
- package/dist/core/entities/user-authenticator/service.mjs +709 -0
- package/dist/core/entities/user-authenticator/service.mjs.map +1 -0
- package/dist/core/entities/user-authenticator/types.d.ts +221 -0
- package/dist/core/entities/user-authenticator/types.d.ts.map +1 -0
- package/dist/core/entities/user-authenticator/types.mjs +15 -0
- package/dist/core/entities/user-authenticator/types.mjs.map +1 -0
- package/dist/core/entities/user-authenticator/webauthn.d.ts +28 -0
- package/dist/core/entities/user-authenticator/webauthn.d.ts.map +1 -0
- package/dist/core/entities/user-authenticator/webauthn.mjs +88 -0
- package/dist/core/entities/user-authenticator/webauthn.mjs.map +1 -0
- package/dist/core/identity/index.mjs +2 -1
- package/dist/core/identity/password-recovery/disabled.d.ts +2 -2
- package/dist/core/identity/password-recovery/disabled.d.ts.map +1 -1
- package/dist/core/identity/password-recovery/disabled.mjs +2 -2
- package/dist/core/identity/password-recovery/disabled.mjs.map +1 -1
- package/dist/core/identity/password-recovery/email-verification-required.d.ts +2 -2
- package/dist/core/identity/password-recovery/email-verification-required.d.ts.map +1 -1
- package/dist/core/identity/password-recovery/email-verification-required.mjs +2 -2
- package/dist/core/identity/password-recovery/email-verification-required.mjs.map +1 -1
- package/dist/core/identity/password-recovery/service.d.ts +2 -1
- package/dist/core/identity/password-recovery/service.d.ts.map +1 -1
- package/dist/core/identity/password-recovery/service.mjs +26 -4
- package/dist/core/identity/password-recovery/service.mjs.map +1 -1
- package/dist/core/identity/password-recovery/token-expired.d.ts +2 -2
- package/dist/core/identity/password-recovery/token-expired.d.ts.map +1 -1
- package/dist/core/identity/password-recovery/token-expired.mjs +2 -2
- package/dist/core/identity/password-recovery/token-expired.mjs.map +1 -1
- package/dist/core/identity/password-recovery/types.d.ts +2 -1
- package/dist/core/identity/password-recovery/types.d.ts.map +1 -1
- package/dist/core/identity/permission/index.d.ts +1 -0
- package/dist/core/identity/permission/index.d.ts.map +1 -1
- package/dist/core/identity/permission/index.mjs +2 -1
- package/dist/core/identity/policy/checker/service.mjs +1 -1
- package/dist/core/identity/policy/checker/service.mjs.map +1 -1
- package/dist/core/identity/provider/authentication/protocols/oauth2/module.mjs +2 -2
- package/dist/core/identity/provider/authentication/protocols/oauth2/module.mjs.map +1 -1
- package/dist/core/identity/registration/error.d.ts +2 -2
- package/dist/core/identity/registration/error.d.ts.map +1 -1
- package/dist/core/identity/registration/error.mjs +2 -2
- package/dist/core/identity/registration/error.mjs.map +1 -1
- package/dist/core/identity/registration/service.d.ts +2 -1
- package/dist/core/identity/registration/service.d.ts.map +1 -1
- package/dist/core/identity/registration/service.mjs +26 -4
- package/dist/core/identity/registration/service.mjs.map +1 -1
- package/dist/core/identity/registration/types.d.ts +2 -1
- package/dist/core/identity/registration/types.d.ts.map +1 -1
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.mjs +39 -8
- package/dist/core/key/certificate-error.d.ts +10 -0
- package/dist/core/key/certificate-error.d.ts.map +1 -0
- package/dist/core/key/certificate-error.mjs +19 -0
- package/dist/core/key/certificate-error.mjs.map +1 -0
- package/dist/core/key/certificate.d.ts +15 -0
- package/dist/core/key/certificate.d.ts.map +1 -0
- package/dist/core/key/certificate.mjs +72 -0
- package/dist/core/key/certificate.mjs.map +1 -0
- package/dist/core/key/check.d.ts +3 -0
- package/dist/core/key/check.d.ts.map +1 -0
- package/dist/core/key/check.mjs +13 -0
- package/dist/core/key/check.mjs.map +1 -0
- package/dist/core/key/constants.d.ts +10 -0
- package/dist/core/key/constants.d.ts.map +1 -0
- package/dist/core/key/constants.mjs +15 -0
- package/dist/core/key/constants.mjs.map +1 -0
- package/dist/core/key/error.d.ts +14 -0
- package/dist/core/key/error.d.ts.map +1 -0
- package/dist/core/key/error.mjs +23 -0
- package/dist/core/key/error.mjs.map +1 -0
- package/dist/core/key/index.d.ts +10 -0
- package/dist/core/key/index.d.ts.map +1 -0
- package/dist/core/key/index.mjs +12 -0
- package/dist/core/key/provisioner.d.ts +22 -0
- package/dist/core/key/provisioner.d.ts.map +1 -0
- package/dist/core/key/provisioner.mjs +30 -0
- package/dist/core/key/provisioner.mjs.map +1 -0
- package/dist/core/key/realm-cipher.d.ts +20 -0
- package/dist/core/key/realm-cipher.d.ts.map +1 -0
- package/dist/core/key/realm-cipher.mjs +60 -0
- package/dist/core/key/realm-cipher.mjs.map +1 -0
- package/dist/core/key/types.d.ts +59 -0
- package/dist/core/key/types.d.ts.map +1 -0
- package/dist/core/key/types.mjs +4 -0
- package/dist/core/key/wrap.d.ts +5 -0
- package/dist/core/key/wrap.d.ts.map +1 -0
- package/dist/core/key/wrap.mjs +21 -0
- package/dist/core/key/wrap.mjs.map +1 -0
- package/dist/core/mail/template/registry.d.ts.map +1 -1
- package/dist/core/mail/template/registry.mjs +3 -1
- package/dist/core/mail/template/registry.mjs.map +1 -1
- package/dist/core/mail/template/templates/mfa-email-otp.d.ts +3 -0
- package/dist/core/mail/template/templates/mfa-email-otp.d.ts.map +1 -0
- package/dist/core/mail/template/templates/mfa-email-otp.mjs +34 -0
- package/dist/core/mail/template/templates/mfa-email-otp.mjs.map +1 -0
- package/dist/core/mail/template/types.d.ts +6 -1
- package/dist/core/mail/template/types.d.ts.map +1 -1
- package/dist/core/mail/template/types.mjs +1 -0
- package/dist/core/mail/template/types.mjs.map +1 -1
- package/dist/core/metrics/index.d.ts +3 -0
- package/dist/core/metrics/index.d.ts.map +1 -0
- package/dist/core/metrics/index.mjs +5 -0
- package/dist/core/metrics/noop.d.ts +8 -0
- package/dist/core/metrics/noop.d.ts.map +1 -0
- package/dist/core/metrics/noop.mjs +14 -0
- package/dist/core/metrics/noop.mjs.map +1 -0
- package/dist/core/metrics/types.d.ts +19 -0
- package/dist/core/metrics/types.d.ts.map +1 -0
- package/dist/core/metrics/types.mjs +4 -0
- package/dist/core/oauth2/access-policy/index.d.ts +3 -0
- package/dist/core/oauth2/access-policy/index.d.ts.map +1 -0
- package/dist/core/oauth2/access-policy/index.mjs +5 -0
- package/dist/core/oauth2/access-policy/module.d.ts +12 -0
- package/dist/core/oauth2/access-policy/module.d.ts.map +1 -0
- package/dist/core/oauth2/access-policy/module.mjs +32 -0
- package/dist/core/oauth2/access-policy/module.mjs.map +1 -0
- package/dist/core/oauth2/access-policy/types.d.ts +19 -0
- package/dist/core/oauth2/access-policy/types.d.ts.map +1 -0
- package/dist/core/oauth2/access-policy/types.mjs +4 -0
- package/dist/core/oauth2/authorization/code/issuer/module.d.ts.map +1 -1
- package/dist/core/oauth2/authorization/code/issuer/module.mjs +2 -0
- package/dist/core/oauth2/authorization/code/issuer/module.mjs.map +1 -1
- package/dist/core/oauth2/authorization/code/issuer/types.d.ts +6 -1
- package/dist/core/oauth2/authorization/code/issuer/types.d.ts.map +1 -1
- package/dist/core/oauth2/authorization/code/verifier/module.mjs.map +1 -1
- package/dist/core/oauth2/authorization/code-request/validator.d.ts.map +1 -1
- package/dist/core/oauth2/authorization/code-request/validator.mjs +1 -0
- package/dist/core/oauth2/authorization/code-request/validator.mjs.map +1 -1
- package/dist/core/oauth2/authorization/code-request/verifier/module.mjs +3 -3
- package/dist/core/oauth2/authorization/code-request/verifier/module.mjs.map +1 -1
- package/dist/core/oauth2/authorization/helpers.d.ts +10 -1
- package/dist/core/oauth2/authorization/helpers.d.ts.map +1 -1
- package/dist/core/oauth2/authorization/helpers.mjs +28 -2
- package/dist/core/oauth2/authorization/helpers.mjs.map +1 -1
- package/dist/core/oauth2/authorization/index.mjs +2 -2
- package/dist/core/oauth2/authorization/module.d.ts +9 -0
- package/dist/core/oauth2/authorization/module.d.ts.map +1 -1
- package/dist/core/oauth2/authorization/module.mjs +80 -3
- package/dist/core/oauth2/authorization/module.mjs.map +1 -1
- package/dist/core/oauth2/authorization/types.d.ts +36 -0
- package/dist/core/oauth2/authorization/types.d.ts.map +1 -1
- package/dist/core/oauth2/client/authenticator.d.ts +16 -7
- package/dist/core/oauth2/client/authenticator.d.ts.map +1 -1
- package/dist/core/oauth2/client/authenticator.mjs +49 -12
- package/dist/core/oauth2/client/authenticator.mjs.map +1 -1
- package/dist/core/oauth2/end-session/service.d.ts +2 -1
- package/dist/core/oauth2/end-session/service.d.ts.map +1 -1
- package/dist/core/oauth2/end-session/service.mjs +13 -0
- package/dist/core/oauth2/end-session/service.mjs.map +1 -1
- package/dist/core/oauth2/end-session/types.d.ts +2 -1
- package/dist/core/oauth2/end-session/types.d.ts.map +1 -1
- package/dist/core/oauth2/grant-types/authorize.d.ts +2 -2
- package/dist/core/oauth2/grant-types/authorize.d.ts.map +1 -1
- package/dist/core/oauth2/grant-types/authorize.mjs +12 -8
- package/dist/core/oauth2/grant-types/authorize.mjs.map +1 -1
- package/dist/core/oauth2/grant-types/client-credentials.d.ts.map +1 -1
- package/dist/core/oauth2/grant-types/client-credentials.mjs +5 -3
- package/dist/core/oauth2/grant-types/client-credentials.mjs.map +1 -1
- package/dist/core/oauth2/grant-types/identity.d.ts.map +1 -1
- package/dist/core/oauth2/grant-types/identity.mjs +10 -3
- package/dist/core/oauth2/grant-types/identity.mjs.map +1 -1
- package/dist/core/oauth2/grant-types/password.d.ts +9 -0
- package/dist/core/oauth2/grant-types/password.d.ts.map +1 -1
- package/dist/core/oauth2/grant-types/password.mjs +32 -4
- package/dist/core/oauth2/grant-types/password.mjs.map +1 -1
- package/dist/core/oauth2/grant-types/refresh-token.d.ts +4 -0
- package/dist/core/oauth2/grant-types/refresh-token.d.ts.map +1 -1
- package/dist/core/oauth2/grant-types/refresh-token.mjs +17 -1
- package/dist/core/oauth2/grant-types/refresh-token.mjs.map +1 -1
- package/dist/core/oauth2/grant-types/robot-credentials.d.ts.map +1 -1
- package/dist/core/oauth2/grant-types/robot-credentials.mjs +3 -2
- package/dist/core/oauth2/grant-types/robot-credentials.mjs.map +1 -1
- package/dist/core/oauth2/grant-types/types.d.ts +10 -3
- package/dist/core/oauth2/grant-types/types.d.ts.map +1 -1
- package/dist/core/oauth2/index.d.ts +2 -1
- package/dist/core/oauth2/index.d.ts.map +1 -1
- package/dist/core/oauth2/index.mjs +7 -2
- package/dist/core/oauth2/mfa-login/index.d.ts +3 -0
- package/dist/core/oauth2/mfa-login/index.d.ts.map +1 -0
- package/dist/core/oauth2/mfa-login/index.mjs +5 -0
- package/dist/core/oauth2/mfa-login/module.d.ts +19 -0
- package/dist/core/oauth2/mfa-login/module.d.ts.map +1 -0
- package/dist/core/oauth2/mfa-login/module.mjs +109 -0
- package/dist/core/oauth2/mfa-login/module.mjs.map +1 -0
- package/dist/core/oauth2/mfa-login/types.d.ts +64 -0
- package/dist/core/oauth2/mfa-login/types.d.ts.map +1 -0
- package/dist/core/oauth2/mfa-login/types.mjs +4 -0
- package/dist/core/oauth2/token/index.mjs +2 -1
- package/dist/core/oauth2/token/issuer/index.d.ts +1 -0
- package/dist/core/oauth2/token/issuer/index.d.ts.map +1 -1
- package/dist/core/oauth2/token/issuer/index.mjs +3 -1
- package/dist/core/oauth2/token/issuer/mfa/index.d.ts +2 -0
- package/dist/core/oauth2/token/issuer/mfa/index.d.ts.map +1 -0
- package/dist/core/oauth2/token/issuer/mfa/index.mjs +5 -0
- package/dist/core/oauth2/token/issuer/mfa/module.d.ts +18 -0
- package/dist/core/oauth2/token/issuer/mfa/module.d.ts.map +1 -0
- package/dist/core/oauth2/token/issuer/mfa/module.mjs +36 -0
- package/dist/core/oauth2/token/issuer/mfa/module.mjs.map +1 -0
- package/dist/core/oauth2/token/repository/types.d.ts +10 -0
- package/dist/core/oauth2/token/repository/types.d.ts.map +1 -1
- package/dist/core/oauth2/token/revoker/module.d.ts.map +1 -1
- package/dist/core/oauth2/token/revoker/module.mjs +1 -0
- package/dist/core/oauth2/token/revoker/module.mjs.map +1 -1
- package/dist/core/oauth2/token/signer/module.d.ts +3 -3
- package/dist/core/oauth2/token/signer/module.d.ts.map +1 -1
- package/dist/core/oauth2/token/signer/module.mjs +5 -6
- package/dist/core/oauth2/token/signer/module.mjs.map +1 -1
- package/dist/core/oauth2/token/verifier/module.d.ts +3 -3
- package/dist/core/oauth2/token/verifier/module.d.ts.map +1 -1
- package/dist/core/oauth2/token/verifier/module.mjs +8 -5
- package/dist/core/oauth2/token/verifier/module.mjs.map +1 -1
- package/dist/index.mjs +52 -30
- package/dist/swagger.json +5431 -2952
- package/dist/ui/client/.vite/ssr-manifest.json +3888 -864
- package/dist/ui/client/assets/index-BmWsoQro.css +2 -0
- package/dist/ui/client/assets/{index-CP9HCHoS.js → index-CT0Nq5pA.js} +18 -17
- package/dist/ui/client/index.html +2 -2
- package/dist/ui/server/server.js +19470 -18436
- package/package.json +22 -16
- package/dist/app/modules/oauth2/repositories/key/index.d.ts.map +0 -1
- package/dist/app/modules/oauth2/repositories/key/index.mjs +0 -5
- package/dist/app/modules/oauth2/repositories/key/repository.d.ts +0 -14
- package/dist/app/modules/oauth2/repositories/key/repository.d.ts.map +0 -1
- package/dist/app/modules/oauth2/repositories/key/repository.mjs +0 -51
- package/dist/app/modules/oauth2/repositories/key/repository.mjs.map +0 -1
- package/dist/core/oauth2/key/index.d.ts +0 -2
- package/dist/core/oauth2/key/index.d.ts.map +0 -1
- package/dist/core/oauth2/key/types.d.ts +0 -16
- package/dist/core/oauth2/key/types.d.ts.map +0 -1
- package/dist/ui/client/assets/index-VM4JXBXw.css +0 -2
- /package/dist/{core/oauth2/key → adapters/http/request}/types.mjs +0 -0
- /package/dist/app/modules/{oauth2/repositories/key → database/repositories/event}/index.d.ts +0 -0
- /package/dist/core/{oauth2/key/index.mjs → authentication/login-throttle/types.mjs} +0 -0
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import "node:path";
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
|
+
import "../../../core/entities/event/constants.mjs";
|
|
5
|
+
import "../../../core/index.mjs";
|
|
4
6
|
import { toPublicHost } from "../../../utils/host.mjs";
|
|
5
7
|
import { expandToOrigins } from "./origins.mjs";
|
|
6
8
|
import { parseConfig } from "./parse.mjs";
|
|
7
|
-
import { EnvironmentName } from "@authup/kit";
|
|
9
|
+
import { EnvironmentName, base64ToArrayBuffer } from "@authup/kit";
|
|
8
10
|
import { USER_PASSWORD_MIN_LENGTH } from "@authup/core-kit";
|
|
11
|
+
import { AuthupError } from "@authup/errors";
|
|
9
12
|
import { read } from "envix";
|
|
10
13
|
import path from "node:path";
|
|
11
14
|
import process from "node:process";
|
|
@@ -31,7 +34,7 @@ async function normalizeConfig(input = {}) {
|
|
|
31
34
|
const devOrigin = "http://localhost:3000";
|
|
32
35
|
if (!trustedOrigins.includes(devOrigin)) trustedOrigins.push(devOrigin);
|
|
33
36
|
}
|
|
34
|
-
|
|
37
|
+
const config = {
|
|
35
38
|
env,
|
|
36
39
|
rootPath: process.cwd(),
|
|
37
40
|
writableDirectoryPath,
|
|
@@ -41,6 +44,8 @@ async function normalizeConfig(input = {}) {
|
|
|
41
44
|
port,
|
|
42
45
|
host,
|
|
43
46
|
publicUrl,
|
|
47
|
+
mtlsPublicUrl: null,
|
|
48
|
+
certificateSource: "disabled",
|
|
44
49
|
middlewareBody: true,
|
|
45
50
|
middlewareCookie: true,
|
|
46
51
|
middlewareCors: true,
|
|
@@ -57,6 +62,18 @@ async function normalizeConfig(input = {}) {
|
|
|
57
62
|
emailVerificationEnabled: false,
|
|
58
63
|
passwordRecoveryEnabled: false,
|
|
59
64
|
passwordMinLength: USER_PASSWORD_MIN_LENGTH,
|
|
65
|
+
eventLogEnabled: true,
|
|
66
|
+
eventLogRetentionDays: 90,
|
|
67
|
+
eventLogEntityEnabled: true,
|
|
68
|
+
eventLogEntityRetentionDays: 7,
|
|
69
|
+
loginAttemptThrottleEnabled: false,
|
|
70
|
+
loginAttemptThreshold: 5,
|
|
71
|
+
loginAttemptWindow: 900,
|
|
72
|
+
secretsEncryptionKey: "",
|
|
73
|
+
mfaEnabled: false,
|
|
74
|
+
mfaRequired: false,
|
|
75
|
+
mfaFreshnessMaxAge: 60,
|
|
76
|
+
mfaTicketMaxAge: 600,
|
|
60
77
|
clientAuthBasic: false,
|
|
61
78
|
clientSystemEnabled: false,
|
|
62
79
|
clientSystemSecret: "start123",
|
|
@@ -74,6 +91,17 @@ async function normalizeConfig(input = {}) {
|
|
|
74
91
|
...parsed,
|
|
75
92
|
trustedOrigins
|
|
76
93
|
};
|
|
94
|
+
if (config.loginAttemptThrottleEnabled && !config.eventLogEnabled) throw new AuthupError("loginAttemptThrottleEnabled requires eventLogEnabled.");
|
|
95
|
+
if (config.mfaRequired && !config.mfaEnabled) throw new AuthupError("mfaRequired requires mfaEnabled.");
|
|
96
|
+
if (config.mtlsPublicUrl && config.certificateSource === "disabled") throw new AuthupError("mtlsPublicUrl requires certificateSource to be enabled.");
|
|
97
|
+
if (config.secretsEncryptionKey) {
|
|
98
|
+
let byteLength = -1;
|
|
99
|
+
try {
|
|
100
|
+
byteLength = base64ToArrayBuffer(config.secretsEncryptionKey.trim()).byteLength;
|
|
101
|
+
} catch {}
|
|
102
|
+
if (byteLength !== 32) throw new AuthupError("secretsEncryptionKey must decode to exactly 32 bytes (base64).");
|
|
103
|
+
}
|
|
104
|
+
return config;
|
|
77
105
|
}
|
|
78
106
|
//#endregion
|
|
79
107
|
export { normalizeConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.mjs","names":["read","path","process","USER_PASSWORD_MIN_LENGTH","EnvironmentName","toPublicHost","expandToOrigins","parseConfig","normalizeConfig","input","parsed","writableDirectoryPath","join","cwd","port","host","publicUrl","regex","match","env","DEVELOPMENT","trustedOrigins","value","origin","includes","push","PRODUCTION","devOrigin","rootPath","logger","redis","smtp","middlewareBody","middlewareCookie","middlewareCors","middlewarePrometheus","middlewareQuery","middlewareRateLimit","middlewareSwagger","tokenRefreshMaxAge","tokenAccessMaxAge","tokenRefreshGracePeriod","promptLoginMaxAge","endSessionHintGracePeriod","registrationEnabled","emailVerificationEnabled","passwordRecoveryEnabled","passwordMinLength","clientAuthBasic","clientSystemEnabled","clientSystemSecret","clientSystemSecretReset","userAuthBasic","userAdminEnabled","userAdminPassword","userAdminPasswordReset","robotAuthBasic","robotAdminEnabled","robotAdminSecret","robotAdminSecretReset","permissions","permissionsDefaultPolicyAssignment"],"sources":["../../../../src/app/modules/config/normalize.ts"],"sourcesContent":["/*\n * Copyright (c) 2023-2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { read } from 'envix';\nimport path from 'node:path';\nimport process from 'node:process';\nimport { USER_PASSWORD_MIN_LENGTH } from '@authup/core-kit';\nimport { EnvironmentName } from '@authup/kit';\nimport { toPublicHost } from '../../../utils/host.ts';\nimport { expandToOrigins } from './origins.ts';\nimport { parseConfig } from './parse.ts';\nimport type { Config, ConfigInput } from './types.ts';\n\nexport async function normalizeConfig(input: ConfigInput = {}): Promise<Config> {\n const parsed = await parseConfig(input);\n\n const writableDirectoryPath = parsed.writableDirectoryPath ||\n path.join(process.cwd(), 'writable');\n\n const port = parsed.port ?? 3001;\n let host = parsed.host || '0.0.0.0';\n\n let publicUrl : string;\n if (parsed.publicUrl) {\n publicUrl = parsed.publicUrl;\n } else {\n const regex = /^([^:]+)(?::(\\d+))?$/;\n const match = host.match(regex);\n if (match) {\n [, host] = match;\n publicUrl = `http://${toPublicHost(host)}:${match[2] || port}`;\n } else {\n publicUrl = `http://${toPublicHost(host)}:${port}`;\n }\n }\n\n const env = parsed.env || read('NODE_ENV', EnvironmentName.DEVELOPMENT);\n\n // Canonicalize to bare origins (scheme://host[:port]) — a scheme-less\n // entry (e.g. `hub.local`) expands to both its http and https origin.\n // Downstream consumers (redirect allowlist, getAppOrigins) can rely on\n // every entry being a full origin. Building a fresh array also keeps a\n // repeated normalizeConfig() on the same input from accumulating the\n // dev origin into a security-sensitive allowlist.\n const trustedOrigins: string[] = [];\n for (const value of parsed.trustedOrigins ?? []) {\n for (const origin of expandToOrigins(value)) {\n if (!trustedOrigins.includes(origin)) {\n trustedOrigins.push(origin);\n }\n }\n }\n\n // In non-production (development & test) client-web runs on :3000 while\n // the API (publicUrl) runs on :3001. Seed :3000 into the trusted origins\n // so the redirect allowlist (<origin>/**) and CORS accept logins from the\n // dev UI out of the box; otherwise the realm-selection login is dead on\n // first run.\n if (env !== EnvironmentName.PRODUCTION) {\n const devOrigin = 'http://localhost:3000';\n if (!trustedOrigins.includes(devOrigin)) {\n trustedOrigins.push(devOrigin);\n }\n }\n\n
|
|
1
|
+
{"version":3,"file":"normalize.mjs","names":["read","path","process","USER_PASSWORD_MIN_LENGTH","AuthupError","EnvironmentName","base64ToArrayBuffer","EVENT_LOG_RETENTION_DAYS_DEFAULT","toPublicHost","expandToOrigins","parseConfig","normalizeConfig","input","parsed","writableDirectoryPath","join","cwd","port","host","publicUrl","regex","match","env","DEVELOPMENT","trustedOrigins","value","origin","includes","push","PRODUCTION","devOrigin","config","rootPath","logger","redis","smtp","mtlsPublicUrl","certificateSource","middlewareBody","middlewareCookie","middlewareCors","middlewarePrometheus","middlewareQuery","middlewareRateLimit","middlewareSwagger","tokenRefreshMaxAge","tokenAccessMaxAge","tokenRefreshGracePeriod","promptLoginMaxAge","endSessionHintGracePeriod","registrationEnabled","emailVerificationEnabled","passwordRecoveryEnabled","passwordMinLength","eventLogEnabled","eventLogRetentionDays","eventLogEntityEnabled","eventLogEntityRetentionDays","loginAttemptThrottleEnabled","loginAttemptThreshold","loginAttemptWindow","secretsEncryptionKey","mfaEnabled","mfaRequired","mfaFreshnessMaxAge","mfaTicketMaxAge","clientAuthBasic","clientSystemEnabled","clientSystemSecret","clientSystemSecretReset","userAuthBasic","userAdminEnabled","userAdminPassword","userAdminPasswordReset","robotAuthBasic","robotAdminEnabled","robotAdminSecret","robotAdminSecretReset","permissions","permissionsDefaultPolicyAssignment","byteLength","trim"],"sources":["../../../../src/app/modules/config/normalize.ts"],"sourcesContent":["/*\n * Copyright (c) 2023-2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { read } from 'envix';\nimport path from 'node:path';\nimport process from 'node:process';\nimport { USER_PASSWORD_MIN_LENGTH } from '@authup/core-kit';\nimport { AuthupError } from '@authup/errors';\nimport { EnvironmentName, base64ToArrayBuffer } from '@authup/kit';\nimport { EVENT_LOG_RETENTION_DAYS_DEFAULT } from '../../../core/index.ts';\nimport { toPublicHost } from '../../../utils/host.ts';\nimport { expandToOrigins } from './origins.ts';\nimport { parseConfig } from './parse.ts';\nimport type { Config, ConfigInput } from './types.ts';\n\nexport async function normalizeConfig(input: ConfigInput = {}): Promise<Config> {\n const parsed = await parseConfig(input);\n\n const writableDirectoryPath = parsed.writableDirectoryPath ||\n path.join(process.cwd(), 'writable');\n\n const port = parsed.port ?? 3001;\n let host = parsed.host || '0.0.0.0';\n\n let publicUrl : string;\n if (parsed.publicUrl) {\n publicUrl = parsed.publicUrl;\n } else {\n const regex = /^([^:]+)(?::(\\d+))?$/;\n const match = host.match(regex);\n if (match) {\n [, host] = match;\n publicUrl = `http://${toPublicHost(host)}:${match[2] || port}`;\n } else {\n publicUrl = `http://${toPublicHost(host)}:${port}`;\n }\n }\n\n const env = parsed.env || read('NODE_ENV', EnvironmentName.DEVELOPMENT);\n\n // Canonicalize to bare origins (scheme://host[:port]) — a scheme-less\n // entry (e.g. `hub.local`) expands to both its http and https origin.\n // Downstream consumers (redirect allowlist, getAppOrigins) can rely on\n // every entry being a full origin. Building a fresh array also keeps a\n // repeated normalizeConfig() on the same input from accumulating the\n // dev origin into a security-sensitive allowlist.\n const trustedOrigins: string[] = [];\n for (const value of parsed.trustedOrigins ?? []) {\n for (const origin of expandToOrigins(value)) {\n if (!trustedOrigins.includes(origin)) {\n trustedOrigins.push(origin);\n }\n }\n }\n\n // In non-production (development & test) client-web runs on :3000 while\n // the API (publicUrl) runs on :3001. Seed :3000 into the trusted origins\n // so the redirect allowlist (<origin>/**) and CORS accept logins from the\n // dev UI out of the box; otherwise the realm-selection login is dead on\n // first run.\n if (env !== EnvironmentName.PRODUCTION) {\n const devOrigin = 'http://localhost:3000';\n if (!trustedOrigins.includes(devOrigin)) {\n trustedOrigins.push(devOrigin);\n }\n }\n\n const config : Config = {\n env,\n rootPath: process.cwd(),\n writableDirectoryPath,\n\n logger: true,\n redis: false,\n smtp: false,\n\n port,\n host,\n publicUrl,\n mtlsPublicUrl: null,\n certificateSource: 'disabled',\n\n middlewareBody: true,\n middlewareCookie: true,\n middlewareCors: true,\n middlewarePrometheus: true,\n middlewareQuery: true,\n middlewareRateLimit: true,\n middlewareSwagger: true,\n tokenRefreshMaxAge: 259_200,\n tokenAccessMaxAge: 900,\n tokenRefreshGracePeriod: 0,\n promptLoginMaxAge: 60,\n endSessionHintGracePeriod: 0,\n registrationEnabled: false,\n emailVerificationEnabled: false,\n passwordRecoveryEnabled: false,\n passwordMinLength: USER_PASSWORD_MIN_LENGTH,\n\n eventLogEnabled: true,\n eventLogRetentionDays: EVENT_LOG_RETENTION_DAYS_DEFAULT,\n eventLogEntityEnabled: true,\n eventLogEntityRetentionDays: 7,\n loginAttemptThrottleEnabled: false,\n loginAttemptThreshold: 5,\n loginAttemptWindow: 900,\n\n secretsEncryptionKey: '',\n\n mfaEnabled: false,\n mfaRequired: false,\n mfaFreshnessMaxAge: 60,\n mfaTicketMaxAge: 600,\n\n clientAuthBasic: false,\n clientSystemEnabled: false,\n clientSystemSecret: 'start123',\n clientSystemSecretReset: false,\n\n userAuthBasic: false,\n userAdminEnabled: true,\n userAdminPassword: 'start123',\n userAdminPasswordReset: false,\n\n robotAuthBasic: false,\n robotAdminEnabled: false,\n robotAdminSecret: 'start123',\n robotAdminSecretReset: false,\n\n permissions: [],\n permissionsDefaultPolicyAssignment: true,\n ...parsed,\n\n // After the spread so the canonicalized + dev-seeded list wins over\n // the raw parsed list (parsed.trustedOrigins is merged in above).\n trustedOrigins,\n };\n\n // fail loud at boot: the throttle counts loginFailed rows in\n // auth_events — with the audit log disabled it would silently no-op.\n if (config.loginAttemptThrottleEnabled && !config.eventLogEnabled) {\n throw new AuthupError('loginAttemptThrottleEnabled requires eventLogEnabled.');\n }\n\n if (config.mfaRequired && !config.mfaEnabled) {\n throw new AuthupError('mfaRequired requires mfaEnabled.');\n }\n\n if (config.mtlsPublicUrl && config.certificateSource === 'disabled') {\n throw new AuthupError('mtlsPublicUrl requires certificateSource to be enabled.');\n }\n\n // fail loud at boot rather than at first key-store access: wrapped key\n // material must never be minted under a malformed KEK. Validate the\n // DECODED length here (not just base64 shape) so a whitespace / invalid /\n // wrong-length key fails at config time, not asynchronously inside the\n // cipher at first wrap/unwrap.\n if (config.secretsEncryptionKey) {\n let byteLength = -1;\n try {\n byteLength = base64ToArrayBuffer(config.secretsEncryptionKey.trim()).byteLength;\n } catch {\n // fall through — treated as invalid below\n }\n if (byteLength !== 32) {\n throw new AuthupError('secretsEncryptionKey must decode to exactly 32 bytes (base64).');\n }\n }\n\n return config;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,eAAsBW,gBAAgBC,QAAqB,CAAC,GAAC;CACzD,MAAMC,SAAS,MAAMH,YAAYE,KAAAA;CAEjC,MAAME,wBAAwBD,OAAOC,yBACjCb,KAAKc,KAAKb,QAAQc,IAAG,GAAI,UAAA;CAE7B,MAAMC,OAAOJ,OAAOI,QAAQ;CAC5B,IAAIC,OAAOL,OAAOK,QAAQ;CAE1B,IAAIC;CACJ,IAAIN,OAAOM,WACPA,YAAYN,OAAOM;MAChB;EAEH,MAAME,QAAQH,KAAKG,MAAMD,sBAAAA;EACzB,IAAIC,OAAO;GACP,GAAGH,QAAQG;GACXF,YAAY,UAAUX,aAAaU,IAAAA,EAAM,GAAGG,MAAM,MAAMJ;EAC5D,OACIE,YAAY,UAAUX,aAAaU,IAAAA,EAAM,GAAGD;CAEpD;CAEA,MAAMK,MAAMT,OAAOS,OAAOtB,KAAK,YAAYK,gBAAgBkB,WAAW;CAQtE,MAAMC,iBAA2B,CAAA;CACjC,KAAK,MAAMC,SAASZ,OAAOW,kBAAkB,CAAA,GACzC,KAAK,MAAME,UAAUjB,gBAAgBgB,KAAAA,GACjC,IAAI,CAACD,eAAeG,SAASD,MAAAA,GACzBF,eAAeI,KAAKF,MAAAA;CAUhC,IAAIJ,QAAQjB,gBAAgBwB,YAAY;EACpC,MAAMC,YAAY;EAClB,IAAI,CAACN,eAAeG,SAASG,SAAAA,GACzBN,eAAeI,KAAKE,SAAAA;CAE5B;CAEA,MAAMC,SAAkB;EACpBT;EACAU,UAAU9B,QAAQc,IAAG;EACrBF;EAEAmB,QAAQ;EACRC,OAAO;EACPC,MAAM;EAENlB;EACAC;EACAC;EACAiB,eAA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.d.ts","sourceRoot":"","sources":["../../../../../src/app/modules/config/read/env.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../../../src/app/modules/config/read/env.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA4B/C,wBAAgB,oBAAoB,IAAK,WAAW,CAkQnD"}
|
|
@@ -5,6 +5,35 @@ import { ConfigEnvironmentVariableName } from "../constants.mjs";
|
|
|
5
5
|
import { oneOf, read, readArray, readBool, readInt } from "envix";
|
|
6
6
|
import { hasEnvDataSourceOptions, readDataSourceOptionsFromEnv } from "typeorm-extension";
|
|
7
7
|
//#region src/app/modules/config/read/env.ts
|
|
8
|
+
const BOOLEAN_TRUE_VALUES = /* @__PURE__ */ new Set([
|
|
9
|
+
"true",
|
|
10
|
+
"t",
|
|
11
|
+
"1",
|
|
12
|
+
"yes",
|
|
13
|
+
"y",
|
|
14
|
+
"on"
|
|
15
|
+
]);
|
|
16
|
+
const BOOLEAN_FALSE_VALUES = /* @__PURE__ */ new Set([
|
|
17
|
+
"false",
|
|
18
|
+
"f",
|
|
19
|
+
"0",
|
|
20
|
+
"no",
|
|
21
|
+
"n",
|
|
22
|
+
"off"
|
|
23
|
+
]);
|
|
24
|
+
/**
|
|
25
|
+
* Boolean env reader that FAILS LOUD on a set-but-unrecognized value instead
|
|
26
|
+
* of silently falling back to the default (envix's `readBool` swallows e.g.
|
|
27
|
+
* `MFA_REQUIRED=yes`). Reserved for security-relevant toggles where a silent
|
|
28
|
+
* default is a weakened posture. Returns `undefined` when the var is unset.
|
|
29
|
+
*/ function readBoolStrict(name) {
|
|
30
|
+
const raw = read(name);
|
|
31
|
+
if (typeof raw !== "string" || raw.trim().length === 0) return;
|
|
32
|
+
const normalized = raw.trim().toLowerCase();
|
|
33
|
+
if (BOOLEAN_TRUE_VALUES.has(normalized)) return true;
|
|
34
|
+
if (BOOLEAN_FALSE_VALUES.has(normalized)) return false;
|
|
35
|
+
throw new Error(`The environment variable ${name} must be a boolean value (received "${raw}").`);
|
|
36
|
+
}
|
|
8
37
|
function readConfigRawFromEnv() {
|
|
9
38
|
const options = {};
|
|
10
39
|
const env = read(ConfigEnvironmentVariableName.NODE_ENV);
|
|
@@ -22,6 +51,10 @@ function readConfigRawFromEnv() {
|
|
|
22
51
|
if (typeof port !== "undefined") options.port = port;
|
|
23
52
|
const publicURL = read(ConfigEnvironmentVariableName.PUBLIC_URL);
|
|
24
53
|
if (publicURL) options.publicUrl = publicURL;
|
|
54
|
+
const mtlsPublicURL = read(ConfigEnvironmentVariableName.MTLS_PUBLIC_URL);
|
|
55
|
+
if (mtlsPublicURL) options.mtlsPublicUrl = mtlsPublicURL;
|
|
56
|
+
const certificateSource = read(ConfigEnvironmentVariableName.CERTIFICATE_SOURCE);
|
|
57
|
+
if (certificateSource) options.certificateSource = certificateSource;
|
|
25
58
|
const trustedOrigins = readArray(ConfigEnvironmentVariableName.TRUSTED_ORIGINS);
|
|
26
59
|
if (trustedOrigins && trustedOrigins.length > 0) options.trustedOrigins = trustedOrigins;
|
|
27
60
|
const tokenAccessMaxAge = readInt(ConfigEnvironmentVariableName.TOKEN_ACCESS_MAX_AGE);
|
|
@@ -42,6 +75,30 @@ function readConfigRawFromEnv() {
|
|
|
42
75
|
if (typeof passwordRecoveryEnabled !== "undefined") options.passwordRecoveryEnabled = passwordRecoveryEnabled;
|
|
43
76
|
const passwordMinLength = readInt(ConfigEnvironmentVariableName.PASSWORD_MIN_LENGTH);
|
|
44
77
|
if (typeof passwordMinLength !== "undefined") options.passwordMinLength = passwordMinLength;
|
|
78
|
+
const eventLogEnabled = readBoolStrict(ConfigEnvironmentVariableName.EVENT_LOG_ENABLED);
|
|
79
|
+
if (typeof eventLogEnabled !== "undefined") options.eventLogEnabled = eventLogEnabled;
|
|
80
|
+
const eventLogRetentionDays = readInt(ConfigEnvironmentVariableName.EVENT_LOG_RETENTION_DAYS);
|
|
81
|
+
if (typeof eventLogRetentionDays !== "undefined") options.eventLogRetentionDays = eventLogRetentionDays;
|
|
82
|
+
const eventLogEntityEnabled = readBoolStrict(ConfigEnvironmentVariableName.EVENT_LOG_ENTITY_ENABLED);
|
|
83
|
+
if (typeof eventLogEntityEnabled !== "undefined") options.eventLogEntityEnabled = eventLogEntityEnabled;
|
|
84
|
+
const eventLogEntityRetentionDays = readInt(ConfigEnvironmentVariableName.EVENT_LOG_ENTITY_RETENTION_DAYS);
|
|
85
|
+
if (typeof eventLogEntityRetentionDays !== "undefined") options.eventLogEntityRetentionDays = eventLogEntityRetentionDays;
|
|
86
|
+
const loginAttemptThrottleEnabled = readBoolStrict(ConfigEnvironmentVariableName.LOGIN_ATTEMPT_THROTTLE_ENABLED);
|
|
87
|
+
if (typeof loginAttemptThrottleEnabled !== "undefined") options.loginAttemptThrottleEnabled = loginAttemptThrottleEnabled;
|
|
88
|
+
const loginAttemptThreshold = readInt(ConfigEnvironmentVariableName.LOGIN_ATTEMPT_THRESHOLD);
|
|
89
|
+
if (typeof loginAttemptThreshold !== "undefined") options.loginAttemptThreshold = loginAttemptThreshold;
|
|
90
|
+
const loginAttemptWindow = readInt(ConfigEnvironmentVariableName.LOGIN_ATTEMPT_WINDOW);
|
|
91
|
+
if (typeof loginAttemptWindow !== "undefined") options.loginAttemptWindow = loginAttemptWindow;
|
|
92
|
+
const mfaEnabled = readBoolStrict(ConfigEnvironmentVariableName.MFA_ENABLED);
|
|
93
|
+
if (typeof mfaEnabled !== "undefined") options.mfaEnabled = mfaEnabled;
|
|
94
|
+
const mfaRequired = readBoolStrict(ConfigEnvironmentVariableName.MFA_REQUIRED);
|
|
95
|
+
if (typeof mfaRequired !== "undefined") options.mfaRequired = mfaRequired;
|
|
96
|
+
const mfaFreshnessMaxAge = readInt(ConfigEnvironmentVariableName.MFA_FRESHNESS_MAX_AGE);
|
|
97
|
+
if (typeof mfaFreshnessMaxAge !== "undefined") options.mfaFreshnessMaxAge = mfaFreshnessMaxAge;
|
|
98
|
+
const mfaTicketMaxAge = readInt(ConfigEnvironmentVariableName.MFA_TICKET_MAX_AGE);
|
|
99
|
+
if (typeof mfaTicketMaxAge !== "undefined") options.mfaTicketMaxAge = mfaTicketMaxAge;
|
|
100
|
+
const secretsEncryptionKey = read(ConfigEnvironmentVariableName.SECRETS_ENCRYPTION_KEY);
|
|
101
|
+
if (secretsEncryptionKey) options.secretsEncryptionKey = secretsEncryptionKey;
|
|
45
102
|
const clientBasicAuth = readBool(ConfigEnvironmentVariableName.CLIENT_AUTH_BASIC);
|
|
46
103
|
if (typeof clientBasicAuth !== "undefined") options.clientAuthBasic = clientBasicAuth;
|
|
47
104
|
const clientSystemEnabled = readBool(ConfigEnvironmentVariableName.CLIENT_SYSTEM_ENABLED);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.mjs","names":["oneOf","read","readArray","readBool","readInt","hasEnvDataSourceOptions","readDataSourceOptionsFromEnv","ConfigEnvironmentVariableName","readConfigRawFromEnv","options","env","NODE_ENV","writableDirectoryPath","WRITABLE_DIRECTORY_PATH","db","redis","REDIS","smtp","SMTP","host","HOST","port","PORT","publicURL","PUBLIC_URL","publicUrl","trustedOrigins","TRUSTED_ORIGINS","length","tokenAccessMaxAge","TOKEN_ACCESS_MAX_AGE","tokenRefreshMaxAge","TOKEN_REFRESH_MAX_AGE","tokenRefreshGracePeriod","TOKEN_REFRESH_GRACE_PERIOD","promptLoginMaxAge","PROMPT_LOGIN_MAX_AGE","endSessionHintGracePeriod","END_SESSION_HINT_GRACE_PERIOD","registrationEnabled","REGISTRATION_ENABLED","emailVerificationEnabled","EMAIL_VERIFICATION_ENABLED","passwordRecoveryEnabled","PASSWORD_RECOVERY_ENABLED","passwordMinLength","PASSWORD_MIN_LENGTH","clientBasicAuth","CLIENT_AUTH_BASIC","clientAuthBasic","clientSystemEnabled","CLIENT_SYSTEM_ENABLED","clientAdminSecret","CLIENT_SYSTEM_SECRET","clientSystemSecret","clientAdminSecretReset","CLIENT_SYSTEM_SECRET_RESET","clientSystemSecretReset","userBasicAuth","USER_AUTH_BASIC","userAuthBasic","userAdminEnabled","USER_ADMIN_ENABLED","userAdminPassword","USER_ADMIN_PASSWORD","userAdminPasswordReset","USER_ADMIN_PASSWORD_RESET","robotBasicAuth","ROBOT_AUTH_BASIC","robotAuthBasic","robotAdminEnabled","ROBOT_ADMIN_ENABLED","robotAdminSecret","ROBOT_ADMIN_SECRET","robotAdminSecretReset","ROBOT_ADMIN_SECRET_RESET","permissions","PERMISSIONS","permissionsDefaultPolicyAssignment","PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT"],"sources":["../../../../../src/app/modules/config/read/env.ts"],"sourcesContent":["/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n oneOf,\n read,\n readArray,\n readBool,\n readInt,\n} from 'envix';\nimport { hasEnvDataSourceOptions, readDataSourceOptionsFromEnv } from 'typeorm-extension';\nimport type { BetterSqlite3ConnectionOptions } from 'typeorm/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js';\nimport type { MysqlConnectionOptions } from 'typeorm/driver/mysql/MysqlConnectionOptions.js';\nimport type { PostgresConnectionOptions } from 'typeorm/driver/postgres/PostgresConnectionOptions.js';\n\nimport { ConfigEnvironmentVariableName } from '../constants.ts';\nimport type { ConfigInput } from '../types.ts';\n\nexport function readConfigRawFromEnv() : ConfigInput {\n const options : ConfigInput = {};\n\n const env = read(ConfigEnvironmentVariableName.NODE_ENV);\n if (env) {\n options.env = env;\n }\n\n const writableDirectoryPath = read(ConfigEnvironmentVariableName.WRITABLE_DIRECTORY_PATH);\n if (writableDirectoryPath) {\n options.writableDirectoryPath = writableDirectoryPath;\n }\n\n // -------------------------------------------------------------\n\n if (hasEnvDataSourceOptions()) {\n // todo: type casting should be avoided\n options.db = readDataSourceOptionsFromEnv() as MysqlConnectionOptions |\n PostgresConnectionOptions |\n BetterSqlite3ConnectionOptions;\n }\n\n const redis = oneOf([\n readBool(ConfigEnvironmentVariableName.REDIS),\n read(ConfigEnvironmentVariableName.REDIS),\n ]);\n if (typeof redis !== 'undefined') {\n options.redis = redis;\n }\n\n const smtp = oneOf([\n readBool(ConfigEnvironmentVariableName.SMTP),\n read(ConfigEnvironmentVariableName.SMTP),\n ]);\n if (typeof smtp !== 'undefined') {\n options.smtp = smtp;\n }\n\n // -------------------------------------------------------------\n\n const host = read(ConfigEnvironmentVariableName.HOST);\n if (host) {\n options.host = host;\n }\n\n const port = readInt(ConfigEnvironmentVariableName.PORT);\n if (typeof port !== 'undefined') {\n options.port = port;\n }\n\n const publicURL = read(ConfigEnvironmentVariableName.PUBLIC_URL);\n if (publicURL) {\n options.publicUrl = publicURL;\n }\n\n const trustedOrigins = readArray(ConfigEnvironmentVariableName.TRUSTED_ORIGINS);\n if (trustedOrigins && trustedOrigins.length > 0) {\n options.trustedOrigins = trustedOrigins;\n }\n\n const tokenAccessMaxAge = readInt(ConfigEnvironmentVariableName.TOKEN_ACCESS_MAX_AGE);\n if (typeof tokenAccessMaxAge !== 'undefined') {\n options.tokenAccessMaxAge = tokenAccessMaxAge;\n }\n\n const tokenRefreshMaxAge = readInt(ConfigEnvironmentVariableName.TOKEN_REFRESH_MAX_AGE);\n if (typeof tokenRefreshMaxAge !== 'undefined') {\n options.tokenRefreshMaxAge = tokenRefreshMaxAge;\n }\n\n const tokenRefreshGracePeriod = readInt(ConfigEnvironmentVariableName.TOKEN_REFRESH_GRACE_PERIOD);\n if (typeof tokenRefreshGracePeriod !== 'undefined') {\n options.tokenRefreshGracePeriod = tokenRefreshGracePeriod;\n }\n\n const promptLoginMaxAge = readInt(ConfigEnvironmentVariableName.PROMPT_LOGIN_MAX_AGE);\n if (typeof promptLoginMaxAge !== 'undefined') {\n options.promptLoginMaxAge = promptLoginMaxAge;\n }\n\n const endSessionHintGracePeriod = readInt(ConfigEnvironmentVariableName.END_SESSION_HINT_GRACE_PERIOD);\n if (typeof endSessionHintGracePeriod !== 'undefined') {\n options.endSessionHintGracePeriod = endSessionHintGracePeriod;\n }\n\n const registrationEnabled = readBool(ConfigEnvironmentVariableName.REGISTRATION_ENABLED);\n if (typeof registrationEnabled !== 'undefined') {\n options.registrationEnabled = registrationEnabled;\n }\n\n const emailVerificationEnabled = readBool(ConfigEnvironmentVariableName.EMAIL_VERIFICATION_ENABLED);\n if (typeof emailVerificationEnabled !== 'undefined') {\n options.emailVerificationEnabled = emailVerificationEnabled;\n }\n\n const passwordRecoveryEnabled = readBool(ConfigEnvironmentVariableName.PASSWORD_RECOVERY_ENABLED);\n if (typeof passwordRecoveryEnabled !== 'undefined') {\n options.passwordRecoveryEnabled = passwordRecoveryEnabled;\n }\n\n const passwordMinLength = readInt(ConfigEnvironmentVariableName.PASSWORD_MIN_LENGTH);\n if (typeof passwordMinLength !== 'undefined') {\n options.passwordMinLength = passwordMinLength;\n }\n\n // ---------------------------------------------------------------\n\n const clientBasicAuth = readBool(ConfigEnvironmentVariableName.CLIENT_AUTH_BASIC);\n if (typeof clientBasicAuth !== 'undefined') {\n options.clientAuthBasic = clientBasicAuth;\n }\n\n const clientSystemEnabled = readBool(ConfigEnvironmentVariableName.CLIENT_SYSTEM_ENABLED);\n if (typeof clientSystemEnabled !== 'undefined') {\n options.clientSystemEnabled = clientSystemEnabled;\n }\n\n const clientAdminSecret = read(ConfigEnvironmentVariableName.CLIENT_SYSTEM_SECRET);\n if (clientAdminSecret) {\n options.clientSystemSecret = clientAdminSecret;\n }\n\n const clientAdminSecretReset = readBool(ConfigEnvironmentVariableName.CLIENT_SYSTEM_SECRET_RESET);\n if (typeof clientAdminSecretReset !== 'undefined') {\n options.clientSystemSecretReset = clientAdminSecretReset;\n }\n\n // ---------------------------------------------------------------\n\n const userBasicAuth = readBool(ConfigEnvironmentVariableName.USER_AUTH_BASIC);\n if (typeof userBasicAuth !== 'undefined') {\n options.userAuthBasic = userBasicAuth;\n }\n\n const userAdminEnabled = readBool(ConfigEnvironmentVariableName.USER_ADMIN_ENABLED);\n if (typeof userAdminEnabled !== 'undefined') {\n options.userAdminEnabled = userAdminEnabled;\n }\n\n const userAdminPassword = read(ConfigEnvironmentVariableName.USER_ADMIN_PASSWORD);\n if (userAdminPassword) {\n options.userAdminPassword = userAdminPassword;\n }\n\n const userAdminPasswordReset = readBool(ConfigEnvironmentVariableName.USER_ADMIN_PASSWORD_RESET);\n if (typeof userAdminPasswordReset !== 'undefined') {\n options.userAdminPasswordReset = userAdminPasswordReset;\n }\n\n // ---------------------------------------------------------------\n\n const robotBasicAuth = readBool(ConfigEnvironmentVariableName.ROBOT_AUTH_BASIC);\n if (typeof robotBasicAuth !== 'undefined') {\n options.robotAuthBasic = robotBasicAuth;\n }\n\n const robotAdminEnabled = readBool(ConfigEnvironmentVariableName.ROBOT_ADMIN_ENABLED);\n if (typeof robotAdminEnabled !== 'undefined') {\n options.robotAdminEnabled = robotAdminEnabled;\n }\n\n const robotAdminSecret = read(ConfigEnvironmentVariableName.ROBOT_ADMIN_SECRET);\n if (robotAdminSecret) {\n options.robotAdminSecret = robotAdminSecret;\n }\n\n const robotAdminSecretReset = readBool(ConfigEnvironmentVariableName.ROBOT_ADMIN_SECRET_RESET);\n if (typeof robotAdminSecretReset !== 'undefined') {\n options.robotAdminSecretReset = robotAdminSecretReset;\n }\n\n // ---------------------------------------------------------------\n\n const permissions = readArray(ConfigEnvironmentVariableName.PERMISSIONS);\n if (permissions && permissions.length > 0) {\n options.permissions = permissions;\n }\n\n const permissionsDefaultPolicyAssignment = readBool(ConfigEnvironmentVariableName.PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT);\n if (typeof permissionsDefaultPolicyAssignment !== 'undefined') {\n options.permissionsDefaultPolicyAssignment = permissionsDefaultPolicyAssignment;\n }\n\n return options;\n}\n"],"mappings":";;;;;;;AAsBA,SAAgBQ,uBAAAA;CACZ,MAAMC,UAAwB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B9D,KAAKM,8BAA8ByD,mBAAmB;CAChF,IAAID,mBACAtD,QAAQsD,oBAAoBA;CAGhC,MAAME,yBAAyB9D,SAASI,8BAA8B2D,yBAAyB;CAC/F,IAAI,OAAOD,2BAA2B,aAClCxD,QAAQwD,yBAAyBA;CAKrC,MAAME,iBAAiBhE,SAASI,8BAA8B6D,gBAAgB;CAC9E,IAAI,OAAOD,mBAAmB,aAC1B1D,QAAQ4D,iBAAiBF;CAG7B,MAAMG,oBAAoBnE,SAASI,8BAA8BgE,mBAAmB;CACpF,IAAI,OAAOD,sBAAsB,aAC7B7D,QAAQ6D,oBAAoBA;CAGhC,MAAME,mBAAmBvE,KAAKM,8BAA8BkE,kBAAkB;CAC9E,IAAID,kBACA/D,QAAQ+D,mBAAmBA;CAG/B,MAAME,wBAAwBvE,SAASI,8BAA8BoE,wBAAwB;CAC7F,IAAI,OAAOD,0BAA0B,aACjCjE,QAAQiE,wBAAwBA;CAKpC,MAAME,cAAc1E,UAAUK,8BAA8BsE,WAAW;CACvE,IAAID,eAAeA,YAAYhD,SAAS,GACpCnB,QAAQmE,cAAcA;CAG1B,MAAME,qCAAqC3E,SAASI,8BAA8BwE,qCAAqC;CACvH,IAAI,OAAOD,uCAAuC,aAC9CrE,QAAQqE,qCAAqCA;CAGjD,OAAOrE;AACX"}
|
|
1
|
+
{"version":3,"file":"env.mjs","names":["oneOf","read","readArray","readBool","readInt","hasEnvDataSourceOptions","readDataSourceOptionsFromEnv","ConfigEnvironmentVariableName","BOOLEAN_TRUE_VALUES","Set","BOOLEAN_FALSE_VALUES","readBoolStrict","name","raw","trim","length","undefined","normalized","toLowerCase","has","Error","readConfigRawFromEnv","options","env","NODE_ENV","writableDirectoryPath","WRITABLE_DIRECTORY_PATH","db","redis","REDIS","smtp","SMTP","host","HOST","port","PORT","publicURL","PUBLIC_URL","publicUrl","mtlsPublicURL","MTLS_PUBLIC_URL","mtlsPublicUrl","certificateSource","CERTIFICATE_SOURCE","trustedOrigins","TRUSTED_ORIGINS","tokenAccessMaxAge","TOKEN_ACCESS_MAX_AGE","tokenRefreshMaxAge","TOKEN_REFRESH_MAX_AGE","tokenRefreshGracePeriod","TOKEN_REFRESH_GRACE_PERIOD","promptLoginMaxAge","PROMPT_LOGIN_MAX_AGE","endSessionHintGracePeriod","END_SESSION_HINT_GRACE_PERIOD","registrationEnabled","REGISTRATION_ENABLED","emailVerificationEnabled","EMAIL_VERIFICATION_ENABLED","passwordRecoveryEnabled","PASSWORD_RECOVERY_ENABLED","passwordMinLength","PASSWORD_MIN_LENGTH","eventLogEnabled","EVENT_LOG_ENABLED","eventLogRetentionDays","EVENT_LOG_RETENTION_DAYS","eventLogEntityEnabled","EVENT_LOG_ENTITY_ENABLED","eventLogEntityRetentionDays","EVENT_LOG_ENTITY_RETENTION_DAYS","loginAttemptThrottleEnabled","LOGIN_ATTEMPT_THROTTLE_ENABLED","loginAttemptThreshold","LOGIN_ATTEMPT_THRESHOLD","loginAttemptWindow","LOGIN_ATTEMPT_WINDOW","mfaEnabled","MFA_ENABLED","mfaRequired","MFA_REQUIRED","mfaFreshnessMaxAge","MFA_FRESHNESS_MAX_AGE","mfaTicketMaxAge","MFA_TICKET_MAX_AGE","secretsEncryptionKey","SECRETS_ENCRYPTION_KEY","clientBasicAuth","CLIENT_AUTH_BASIC","clientAuthBasic","clientSystemEnabled","CLIENT_SYSTEM_ENABLED","clientAdminSecret","CLIENT_SYSTEM_SECRET","clientSystemSecret","clientAdminSecretReset","CLIENT_SYSTEM_SECRET_RESET","clientSystemSecretReset","userBasicAuth","USER_AUTH_BASIC","userAuthBasic","userAdminEnabled","USER_ADMIN_ENABLED","userAdminPassword","USER_ADMIN_PASSWORD","userAdminPasswordReset","USER_ADMIN_PASSWORD_RESET","robotBasicAuth","ROBOT_AUTH_BASIC","robotAuthBasic","robotAdminEnabled","ROBOT_ADMIN_ENABLED","robotAdminSecret","ROBOT_ADMIN_SECRET","robotAdminSecretReset","ROBOT_ADMIN_SECRET_RESET","permissions","PERMISSIONS","permissionsDefaultPolicyAssignment","PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT"],"sources":["../../../../../src/app/modules/config/read/env.ts"],"sourcesContent":["/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n oneOf,\n read,\n readArray,\n readBool,\n readInt,\n} from 'envix';\nimport { hasEnvDataSourceOptions, readDataSourceOptionsFromEnv } from 'typeorm-extension';\nimport type { BetterSqlite3ConnectionOptions } from 'typeorm/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js';\nimport type { MysqlConnectionOptions } from 'typeorm/driver/mysql/MysqlConnectionOptions.js';\nimport type { PostgresConnectionOptions } from 'typeorm/driver/postgres/PostgresConnectionOptions.js';\n\nimport { ConfigEnvironmentVariableName } from '../constants.ts';\nimport type { ConfigInput } from '../types.ts';\n\nconst BOOLEAN_TRUE_VALUES = new Set(['true', 't', '1', 'yes', 'y', 'on']);\nconst BOOLEAN_FALSE_VALUES = new Set(['false', 'f', '0', 'no', 'n', 'off']);\n\n/**\n * Boolean env reader that FAILS LOUD on a set-but-unrecognized value instead\n * of silently falling back to the default (envix's `readBool` swallows e.g.\n * `MFA_REQUIRED=yes`). Reserved for security-relevant toggles where a silent\n * default is a weakened posture. Returns `undefined` when the var is unset.\n */\nfunction readBoolStrict(name: ConfigEnvironmentVariableName) : boolean | undefined {\n const raw = read(name);\n if (typeof raw !== 'string' || raw.trim().length === 0) {\n return undefined;\n }\n\n const normalized = raw.trim().toLowerCase();\n if (BOOLEAN_TRUE_VALUES.has(normalized)) {\n return true;\n }\n if (BOOLEAN_FALSE_VALUES.has(normalized)) {\n return false;\n }\n\n throw new Error(`The environment variable ${name} must be a boolean value (received \"${raw}\").`);\n}\n\nexport function readConfigRawFromEnv() : ConfigInput {\n const options : ConfigInput = {};\n\n const env = read(ConfigEnvironmentVariableName.NODE_ENV);\n if (env) {\n options.env = env;\n }\n\n const writableDirectoryPath = read(ConfigEnvironmentVariableName.WRITABLE_DIRECTORY_PATH);\n if (writableDirectoryPath) {\n options.writableDirectoryPath = writableDirectoryPath;\n }\n\n // -------------------------------------------------------------\n\n if (hasEnvDataSourceOptions()) {\n // todo: type casting should be avoided\n options.db = readDataSourceOptionsFromEnv() as MysqlConnectionOptions |\n PostgresConnectionOptions |\n BetterSqlite3ConnectionOptions;\n }\n\n const redis = oneOf([\n readBool(ConfigEnvironmentVariableName.REDIS),\n read(ConfigEnvironmentVariableName.REDIS),\n ]);\n if (typeof redis !== 'undefined') {\n options.redis = redis;\n }\n\n const smtp = oneOf([\n readBool(ConfigEnvironmentVariableName.SMTP),\n read(ConfigEnvironmentVariableName.SMTP),\n ]);\n if (typeof smtp !== 'undefined') {\n options.smtp = smtp;\n }\n\n // -------------------------------------------------------------\n\n const host = read(ConfigEnvironmentVariableName.HOST);\n if (host) {\n options.host = host;\n }\n\n const port = readInt(ConfigEnvironmentVariableName.PORT);\n if (typeof port !== 'undefined') {\n options.port = port;\n }\n\n const publicURL = read(ConfigEnvironmentVariableName.PUBLIC_URL);\n if (publicURL) {\n options.publicUrl = publicURL;\n }\n\n const mtlsPublicURL = read(ConfigEnvironmentVariableName.MTLS_PUBLIC_URL);\n if (mtlsPublicURL) {\n options.mtlsPublicUrl = mtlsPublicURL;\n }\n\n const certificateSource = read(ConfigEnvironmentVariableName.CERTIFICATE_SOURCE);\n if (certificateSource) {\n options.certificateSource = certificateSource as ConfigInput['certificateSource'];\n }\n\n const trustedOrigins = readArray(ConfigEnvironmentVariableName.TRUSTED_ORIGINS);\n if (trustedOrigins && trustedOrigins.length > 0) {\n options.trustedOrigins = trustedOrigins;\n }\n\n const tokenAccessMaxAge = readInt(ConfigEnvironmentVariableName.TOKEN_ACCESS_MAX_AGE);\n if (typeof tokenAccessMaxAge !== 'undefined') {\n options.tokenAccessMaxAge = tokenAccessMaxAge;\n }\n\n const tokenRefreshMaxAge = readInt(ConfigEnvironmentVariableName.TOKEN_REFRESH_MAX_AGE);\n if (typeof tokenRefreshMaxAge !== 'undefined') {\n options.tokenRefreshMaxAge = tokenRefreshMaxAge;\n }\n\n const tokenRefreshGracePeriod = readInt(ConfigEnvironmentVariableName.TOKEN_REFRESH_GRACE_PERIOD);\n if (typeof tokenRefreshGracePeriod !== 'undefined') {\n options.tokenRefreshGracePeriod = tokenRefreshGracePeriod;\n }\n\n const promptLoginMaxAge = readInt(ConfigEnvironmentVariableName.PROMPT_LOGIN_MAX_AGE);\n if (typeof promptLoginMaxAge !== 'undefined') {\n options.promptLoginMaxAge = promptLoginMaxAge;\n }\n\n const endSessionHintGracePeriod = readInt(ConfigEnvironmentVariableName.END_SESSION_HINT_GRACE_PERIOD);\n if (typeof endSessionHintGracePeriod !== 'undefined') {\n options.endSessionHintGracePeriod = endSessionHintGracePeriod;\n }\n\n const registrationEnabled = readBool(ConfigEnvironmentVariableName.REGISTRATION_ENABLED);\n if (typeof registrationEnabled !== 'undefined') {\n options.registrationEnabled = registrationEnabled;\n }\n\n const emailVerificationEnabled = readBool(ConfigEnvironmentVariableName.EMAIL_VERIFICATION_ENABLED);\n if (typeof emailVerificationEnabled !== 'undefined') {\n options.emailVerificationEnabled = emailVerificationEnabled;\n }\n\n const passwordRecoveryEnabled = readBool(ConfigEnvironmentVariableName.PASSWORD_RECOVERY_ENABLED);\n if (typeof passwordRecoveryEnabled !== 'undefined') {\n options.passwordRecoveryEnabled = passwordRecoveryEnabled;\n }\n\n const passwordMinLength = readInt(ConfigEnvironmentVariableName.PASSWORD_MIN_LENGTH);\n if (typeof passwordMinLength !== 'undefined') {\n options.passwordMinLength = passwordMinLength;\n }\n\n // ---------------------------------------------------------------\n\n const eventLogEnabled = readBoolStrict(ConfigEnvironmentVariableName.EVENT_LOG_ENABLED);\n if (typeof eventLogEnabled !== 'undefined') {\n options.eventLogEnabled = eventLogEnabled;\n }\n\n const eventLogRetentionDays = readInt(ConfigEnvironmentVariableName.EVENT_LOG_RETENTION_DAYS);\n if (typeof eventLogRetentionDays !== 'undefined') {\n options.eventLogRetentionDays = eventLogRetentionDays;\n }\n\n const eventLogEntityEnabled = readBoolStrict(ConfigEnvironmentVariableName.EVENT_LOG_ENTITY_ENABLED);\n if (typeof eventLogEntityEnabled !== 'undefined') {\n options.eventLogEntityEnabled = eventLogEntityEnabled;\n }\n\n const eventLogEntityRetentionDays = readInt(ConfigEnvironmentVariableName.EVENT_LOG_ENTITY_RETENTION_DAYS);\n if (typeof eventLogEntityRetentionDays !== 'undefined') {\n options.eventLogEntityRetentionDays = eventLogEntityRetentionDays;\n }\n\n const loginAttemptThrottleEnabled = readBoolStrict(ConfigEnvironmentVariableName.LOGIN_ATTEMPT_THROTTLE_ENABLED);\n if (typeof loginAttemptThrottleEnabled !== 'undefined') {\n options.loginAttemptThrottleEnabled = loginAttemptThrottleEnabled;\n }\n\n const loginAttemptThreshold = readInt(ConfigEnvironmentVariableName.LOGIN_ATTEMPT_THRESHOLD);\n if (typeof loginAttemptThreshold !== 'undefined') {\n options.loginAttemptThreshold = loginAttemptThreshold;\n }\n\n const loginAttemptWindow = readInt(ConfigEnvironmentVariableName.LOGIN_ATTEMPT_WINDOW);\n if (typeof loginAttemptWindow !== 'undefined') {\n options.loginAttemptWindow = loginAttemptWindow;\n }\n\n // ---------------------------------------------------------------\n\n const mfaEnabled = readBoolStrict(ConfigEnvironmentVariableName.MFA_ENABLED);\n if (typeof mfaEnabled !== 'undefined') {\n options.mfaEnabled = mfaEnabled;\n }\n\n const mfaRequired = readBoolStrict(ConfigEnvironmentVariableName.MFA_REQUIRED);\n if (typeof mfaRequired !== 'undefined') {\n options.mfaRequired = mfaRequired;\n }\n\n const mfaFreshnessMaxAge = readInt(ConfigEnvironmentVariableName.MFA_FRESHNESS_MAX_AGE);\n if (typeof mfaFreshnessMaxAge !== 'undefined') {\n options.mfaFreshnessMaxAge = mfaFreshnessMaxAge;\n }\n\n const mfaTicketMaxAge = readInt(ConfigEnvironmentVariableName.MFA_TICKET_MAX_AGE);\n if (typeof mfaTicketMaxAge !== 'undefined') {\n options.mfaTicketMaxAge = mfaTicketMaxAge;\n }\n\n const secretsEncryptionKey = read(ConfigEnvironmentVariableName.SECRETS_ENCRYPTION_KEY);\n if (secretsEncryptionKey) {\n options.secretsEncryptionKey = secretsEncryptionKey;\n }\n\n // ---------------------------------------------------------------\n\n const clientBasicAuth = readBool(ConfigEnvironmentVariableName.CLIENT_AUTH_BASIC);\n if (typeof clientBasicAuth !== 'undefined') {\n options.clientAuthBasic = clientBasicAuth;\n }\n\n const clientSystemEnabled = readBool(ConfigEnvironmentVariableName.CLIENT_SYSTEM_ENABLED);\n if (typeof clientSystemEnabled !== 'undefined') {\n options.clientSystemEnabled = clientSystemEnabled;\n }\n\n const clientAdminSecret = read(ConfigEnvironmentVariableName.CLIENT_SYSTEM_SECRET);\n if (clientAdminSecret) {\n options.clientSystemSecret = clientAdminSecret;\n }\n\n const clientAdminSecretReset = readBool(ConfigEnvironmentVariableName.CLIENT_SYSTEM_SECRET_RESET);\n if (typeof clientAdminSecretReset !== 'undefined') {\n options.clientSystemSecretReset = clientAdminSecretReset;\n }\n\n // ---------------------------------------------------------------\n\n const userBasicAuth = readBool(ConfigEnvironmentVariableName.USER_AUTH_BASIC);\n if (typeof userBasicAuth !== 'undefined') {\n options.userAuthBasic = userBasicAuth;\n }\n\n const userAdminEnabled = readBool(ConfigEnvironmentVariableName.USER_ADMIN_ENABLED);\n if (typeof userAdminEnabled !== 'undefined') {\n options.userAdminEnabled = userAdminEnabled;\n }\n\n const userAdminPassword = read(ConfigEnvironmentVariableName.USER_ADMIN_PASSWORD);\n if (userAdminPassword) {\n options.userAdminPassword = userAdminPassword;\n }\n\n const userAdminPasswordReset = readBool(ConfigEnvironmentVariableName.USER_ADMIN_PASSWORD_RESET);\n if (typeof userAdminPasswordReset !== 'undefined') {\n options.userAdminPasswordReset = userAdminPasswordReset;\n }\n\n // ---------------------------------------------------------------\n\n const robotBasicAuth = readBool(ConfigEnvironmentVariableName.ROBOT_AUTH_BASIC);\n if (typeof robotBasicAuth !== 'undefined') {\n options.robotAuthBasic = robotBasicAuth;\n }\n\n const robotAdminEnabled = readBool(ConfigEnvironmentVariableName.ROBOT_ADMIN_ENABLED);\n if (typeof robotAdminEnabled !== 'undefined') {\n options.robotAdminEnabled = robotAdminEnabled;\n }\n\n const robotAdminSecret = read(ConfigEnvironmentVariableName.ROBOT_ADMIN_SECRET);\n if (robotAdminSecret) {\n options.robotAdminSecret = robotAdminSecret;\n }\n\n const robotAdminSecretReset = readBool(ConfigEnvironmentVariableName.ROBOT_ADMIN_SECRET_RESET);\n if (typeof robotAdminSecretReset !== 'undefined') {\n options.robotAdminSecretReset = robotAdminSecretReset;\n }\n\n // ---------------------------------------------------------------\n\n const permissions = readArray(ConfigEnvironmentVariableName.PERMISSIONS);\n if (permissions && permissions.length > 0) {\n options.permissions = permissions;\n }\n\n const permissionsDefaultPolicyAssignment = readBool(ConfigEnvironmentVariableName.PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT);\n if (typeof permissionsDefaultPolicyAssignment !== 'undefined') {\n options.permissionsDefaultPolicyAssignment = permissionsDefaultPolicyAssignment;\n }\n\n return options;\n}\n"],"mappings":";;;;;;;AAsBA,MAAMQ,sCAAsB,IAAIC,IAAI;CAAC;CAAQ;CAAK;CAAK;CAAO;CAAK;CAAK;AACxE,MAAMC,uCAAuB,IAAID,IAAI;CAAC;CAAS;CAAK;CAAK;CAAM;CAAK;CAAM;;;;;;GAQ1E,SAASE,eAAeC,MAAmC;CACvD,MAAMC,MAAMZ,KAAKW,IAAAA;CACjB,IAAI,OAAOC,QAAQ,YAAYA,IAAIC,KAAI,CAAA,CAAGC,WAAW,GACjD;CAGJ,MAAME,aAAaJ,IAAIC,KAAI,CAAA,CAAGI,YAAW;CACzC,IAAIV,oBAAoBW,IAAIF,UAAAA,GACxB,OAAO;CAEX,IAAIP,qBAAqBS,IAAIF,UAAAA,GACzB,OAAO;CAGX,MAAM,IAAIG,MAAM,4B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AA0B;CAChG,IAAI,OAAOD,2BAA2B,aAClC1E,QAAQ4E,0BAA0BF;CAKtC,MAAMG,gBAAgBhG,SAASI,8BAA8B6F,eAAe;CAC5E,IAAI,OAAOD,kBAAkB,aACzB7E,QAAQ+E,gBAAgBF;CAG5B,MAAMG,mBAAmBnG,SAASI,8BAA8BgG,kBAAkB;CAClF,IAAI,OAAOD,qBAAqB,aAC5BhF,QAAQgF,mBAAmBA;CAG/B,MAAME,oBAAoBvG,KAAKM,8BAA8BkG,mBAAmB;CAChF,IAAID,mBACAlF,QAAQkF,oBAAoBA;CAGhC,MAAME,yBAAyBvG,SAASI,8BAA8BoG,yBAAyB;CAC/F,IAAI,OAAOD,2BAA2B,aAClCpF,QAAQoF,yBAAyBA;CAKrC,MAAME,iBAAiBzG,SAASI,8BAA8BsG,gBAAgB;CAC9E,IAAI,OAAOD,mBAAmB,aAC1BtF,QAAQwF,iBAAiBF;CAG7B,MAAMG,oBAAoB5G,SAASI,8BAA8ByG,mBAAmB;CACpF,IAAI,OAAOD,sBAAsB,aAC7BzF,QAAQyF,oBAAoBA;CAGhC,MAAME,mBAAmBhH,KAAKM,8BAA8B2G,kBAAkB;CAC9E,IAAID,kBACA3F,QAAQ2F,mBAAmBA;CAG/B,MAAME,wBAAwBhH,SAASI,8BAA8B6G,wBAAwB;CAC7F,IAAI,OAAOD,0BAA0B,aACjC7F,QAAQ6F,wBAAwBA;CAKpC,MAAME,cAAcnH,UAAUK,8BAA8B+G,WAAW;CACvE,IAAID,eAAeA,YAAYtG,SAAS,GACpCO,QAAQ+F,cAAcA;CAG1B,MAAME,qCAAqCpH,SAASI,8BAA8BiH,qCAAqC;CACvH,IAAI,OAAOD,uCAAuC,aAC9CjG,QAAQiG,qCAAqCA;CAGjD,OAAOjG;AACX"}
|
|
@@ -8,6 +8,7 @@ import type { UIOptions as SwaggerUIOptions } from '@routup/swagger-ui';
|
|
|
8
8
|
import type { Options as BodyOptions } from '@routup/basic/body';
|
|
9
9
|
import type { DataSourceOptions } from 'typeorm';
|
|
10
10
|
import type { SMTPOptions } from '../mail/adapter/smtp/types.ts';
|
|
11
|
+
import type { CertificateSource } from '../../../adapters/http/request/index.ts';
|
|
11
12
|
export type Config = {
|
|
12
13
|
/**
|
|
13
14
|
* Application environment (e.g., 'production').
|
|
@@ -56,6 +57,20 @@ export type Config = {
|
|
|
56
57
|
* default: http://localhost:3001
|
|
57
58
|
*/
|
|
58
59
|
publicUrl: string;
|
|
60
|
+
/**
|
|
61
|
+
* Optional externally reachable base URL dedicated to endpoints that
|
|
62
|
+
* request TLS client certificates. Published as RFC 8705 mTLS endpoint
|
|
63
|
+
* aliases. The reverse proxy may route it to the same backend listener.
|
|
64
|
+
* default: null
|
|
65
|
+
*/
|
|
66
|
+
mtlsPublicUrl: string | null;
|
|
67
|
+
/**
|
|
68
|
+
* Trusted-proxy client-certificate header contract. Enabling a source
|
|
69
|
+
* asserts that the backend listener is reachable only through a proxy that
|
|
70
|
+
* removes or overwrites the selected headers.
|
|
71
|
+
* default: disabled
|
|
72
|
+
*/
|
|
73
|
+
certificateSource: CertificateSource;
|
|
59
74
|
/**
|
|
60
75
|
* Trusted first-party app origins (besides publicUrl) — used as
|
|
61
76
|
* redirect targets for the per-realm public `web` client. Does NOT
|
|
@@ -167,6 +182,92 @@ export type Config = {
|
|
|
167
182
|
* default: 10
|
|
168
183
|
*/
|
|
169
184
|
passwordMinLength: number;
|
|
185
|
+
/**
|
|
186
|
+
* Persist security audit events (login, authorize, replay detection, ...)
|
|
187
|
+
* to the auth_events table. When disabled only the structured log line
|
|
188
|
+
* is emitted.
|
|
189
|
+
* default: true
|
|
190
|
+
*/
|
|
191
|
+
eventLogEnabled: boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Per-row retention for persisted audit events in days (stamped as
|
|
194
|
+
* expires_at at write time, swept by the event cleaner). Raise it for
|
|
195
|
+
* longer compliance windows; 0 = keep forever.
|
|
196
|
+
* default: 90
|
|
197
|
+
*/
|
|
198
|
+
eventLogRetentionDays: number;
|
|
199
|
+
/**
|
|
200
|
+
* Additionally mirror every entity create/update/delete published on the
|
|
201
|
+
* domain-event bus into the auth_events table (scope: entity). Only
|
|
202
|
+
* effective while eventLogEnabled is true.
|
|
203
|
+
* default: true
|
|
204
|
+
*/
|
|
205
|
+
eventLogEntityEnabled: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Per-row retention for entity-CRUD audit events in days — deliberately
|
|
208
|
+
* short so entity churn self-prunes. 0 = keep forever.
|
|
209
|
+
* default: 7
|
|
210
|
+
*/
|
|
211
|
+
eventLogEntityRetentionDays: number;
|
|
212
|
+
/**
|
|
213
|
+
* Throttle failed interactive logins per (identifier, ip) pair by
|
|
214
|
+
* counting recent loginFailed audit events. Requires eventLogEnabled.
|
|
215
|
+
* default: false
|
|
216
|
+
*/
|
|
217
|
+
loginAttemptThrottleEnabled: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* Failed attempts per (identifier, ip) pair within the window before
|
|
220
|
+
* the pair is throttled.
|
|
221
|
+
* default: 5
|
|
222
|
+
*/
|
|
223
|
+
loginAttemptThreshold: number;
|
|
224
|
+
/**
|
|
225
|
+
* Sliding throttle window in seconds.
|
|
226
|
+
* default: 900
|
|
227
|
+
*/
|
|
228
|
+
loginAttemptWindow: number;
|
|
229
|
+
/**
|
|
230
|
+
* Optional base64-encoded 32-byte KEK (AES-256-GCM) wrapping the realm
|
|
231
|
+
* key store's material at rest (auth_keys.decryption_key — realm
|
|
232
|
+
* signing private keys and the per-realm enc keys the MFA seed cipher
|
|
233
|
+
* rides). Unset = material persists unwrapped (Keycloak/authentik
|
|
234
|
+
* parity); setting it later wraps rows lazily on read, removing it
|
|
235
|
+
* while wrapped rows exist fails loud at first use.
|
|
236
|
+
* default: '' (unset)
|
|
237
|
+
*/
|
|
238
|
+
secretsEncryptionKey: string;
|
|
239
|
+
/**
|
|
240
|
+
* Org-wide multi-factor authentication feature toggle. When enabled,
|
|
241
|
+
* users can enroll authenticator devices, and a user holding a
|
|
242
|
+
* confirmed device must present a second factor on interactive
|
|
243
|
+
* authorization and the password grant.
|
|
244
|
+
* default: false
|
|
245
|
+
*/
|
|
246
|
+
mfaEnabled: boolean;
|
|
247
|
+
/**
|
|
248
|
+
* Enforce MFA for every user: a user without a confirmed device is
|
|
249
|
+
* routed to inline enrollment at next interactive login
|
|
250
|
+
* (configure-inline). Requires mfaEnabled.
|
|
251
|
+
* default: false
|
|
252
|
+
*/
|
|
253
|
+
mfaRequired: boolean;
|
|
254
|
+
/**
|
|
255
|
+
* Max age (seconds) of the session's second-factor proof (mfa_at) an
|
|
256
|
+
* `acr_values=urn:authup:mfa` step-up request accepts before forcing
|
|
257
|
+
* a fresh challenge. Mirrors promptLoginMaxAge's semantics (the
|
|
258
|
+
* window absorbs the hosted challenge round-trip).
|
|
259
|
+
* default: 60
|
|
260
|
+
*/
|
|
261
|
+
mfaFreshnessMaxAge: number;
|
|
262
|
+
/**
|
|
263
|
+
* Lifetime (seconds) of the "MFA-pending" login ticket the password
|
|
264
|
+
* grant issues when the second factor cannot ride the single POST
|
|
265
|
+
* (email / WebAuthn) — and of the pending session backing it (extended
|
|
266
|
+
* to the full session lifetime on completion). Sized to cover the
|
|
267
|
+
* email-OTP window (code expiry: 10 minutes).
|
|
268
|
+
* default: 600
|
|
269
|
+
*/
|
|
270
|
+
mfaTicketMaxAge: number;
|
|
170
271
|
/**
|
|
171
272
|
* default: false
|
|
172
273
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,Y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IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAIhC;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,qBAAqB,EAAE,OAAO,CAAC;IAI/B;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE/B;;;;;;OAMG;IACH,kCAAkC,EAAE,OAAO,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE1C,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/validator.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/validator.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGzC,qBAAa,eAAgB,SAAQ,SAAS,CAAC,MAAM,CAAC;cAC/B,UAAU;CAgHhC"}
|
|
@@ -2,6 +2,8 @@ import "node:path";
|
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
4
|
import { expandToOrigins } from "./origins.mjs";
|
|
5
|
+
import { CERTIFICATE_SOURCES } from "../../../adapters/http/request/constants.mjs";
|
|
6
|
+
import "../../../adapters/http/request/index.mjs";
|
|
5
7
|
import { isObject } from "@authup/kit";
|
|
6
8
|
import { USER_PASSWORD_MAX_LENGTH } from "@authup/core-kit";
|
|
7
9
|
import { Container } from "validup";
|
|
@@ -28,6 +30,8 @@ var ConfigValidator = class extends Container {
|
|
|
28
30
|
port: nonNegativeNumberValidator,
|
|
29
31
|
host: stringValidator,
|
|
30
32
|
publicUrl: createValidator(z.url()),
|
|
33
|
+
mtlsPublicUrl: createValidator(z.url().nullable()),
|
|
34
|
+
certificateSource: createValidator(z.enum(CERTIFICATE_SOURCES)),
|
|
31
35
|
trustedOrigins: createValidator(z.array(z.string().refine((value) => {
|
|
32
36
|
try {
|
|
33
37
|
expandToOrigins(value);
|
|
@@ -52,6 +56,18 @@ var ConfigValidator = class extends Container {
|
|
|
52
56
|
emailVerificationEnabled: booleanValidator,
|
|
53
57
|
passwordRecoveryEnabled: booleanValidator,
|
|
54
58
|
passwordMinLength: createValidator(z.number().int().positive().max(USER_PASSWORD_MAX_LENGTH)),
|
|
59
|
+
eventLogEnabled: booleanValidator,
|
|
60
|
+
eventLogRetentionDays: nonNegativeNumberValidator,
|
|
61
|
+
eventLogEntityEnabled: booleanValidator,
|
|
62
|
+
eventLogEntityRetentionDays: nonNegativeNumberValidator,
|
|
63
|
+
loginAttemptThrottleEnabled: booleanValidator,
|
|
64
|
+
loginAttemptThreshold: createValidator(z.number().int().positive()),
|
|
65
|
+
loginAttemptWindow: createValidator(z.number().int().positive()),
|
|
66
|
+
secretsEncryptionKey: createValidator(z.union([z.literal(""), z.base64()])),
|
|
67
|
+
mfaEnabled: booleanValidator,
|
|
68
|
+
mfaRequired: booleanValidator,
|
|
69
|
+
mfaFreshnessMaxAge: nonNegativeNumberValidator,
|
|
70
|
+
mfaTicketMaxAge: createValidator(z.number().int().positive()),
|
|
55
71
|
clientAuthBasic: booleanValidator,
|
|
56
72
|
clientSystemEnabled: booleanValidator,
|
|
57
73
|
clientSystemSecret: secretValidator,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.mjs","names":["USER_PASSWORD_MAX_LENGTH","isObject","createValidator","Container","z","expandToOrigins","ConfigValidator","initialize","stringValidator","string","booleanValidator","boolean","nonNegativeNumberValidator","number","nonnegative","secretValidator","min","max","middlewareValidator","or","record","any","serviceValidator","custom","value","validators","env","rootPath","writableDirectoryPath","logger","db","redis","smtp","port","host","publicUrl","url","trustedOrigins","array","refine","middlewareBody","middlewareCors","middlewareCookie","middlewareQuery","middlewarePrometheus","middlewareRateLimit","middlewareSwagger","tokenAccessMaxAge","tokenRefreshMaxAge","tokenRefreshGracePeriod","promptLoginMaxAge","endSessionHintGracePeriod","registrationEnabled","emailVerificationEnabled","passwordRecoveryEnabled","passwordMinLength","int","positive","clientAuthBasic","clientSystemEnabled","clientSystemSecret","clientSystemSecretReset","userAuthBasic","userAdminEnabled","userAdminPassword","userAdminPasswordReset","robotAuthBasic","robotAdminEnabled","robotAdminSecret","robotAdminSecretReset","permissions","permissionsDefaultPolicyAssignment","keys","Object","key","mount","optional"],"sources":["../../../../src/app/modules/config/validator.ts"],"sourcesContent":["/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { USER_PASSWORD_MAX_LENGTH } from '@authup/core-kit';\nimport { isObject } from '@authup/kit';\nimport { createValidator } from '@validup/zod';\nimport type { BetterSqlite3ConnectionOptions } from 'typeorm/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js';\nimport type { MysqlConnectionOptions } from 'typeorm/driver/mysql/MysqlConnectionOptions.js';\nimport type { PostgresConnectionOptions } from 'typeorm/driver/postgres/PostgresConnectionOptions.js';\nimport type { ValidatorDescriptor } from 'validup';\nimport { Container } from 'validup';\nimport { z } from 'zod';\nimport { expandToOrigins } from './origins.ts';\nimport type { Config } from './types.ts';\n\nexport class ConfigValidator extends Container<Config> {\n protected override initialize() {\n super.initialize();\n\n const stringValidator = createValidator(z.string());\n const booleanValidator = createValidator(z.boolean());\n const nonNegativeNumberValidator = createValidator(z.number().nonnegative());\n const secretValidator = createValidator(z.string().min(3).max(256));\n const middlewareValidator = createValidator(\n z.boolean().or(z.record(z.string(), z.any())),\n );\n const serviceValidator = createValidator(\n z.string()\n .or(z.boolean())\n .or(z.custom<Record<string, any>>((value) => isObject(value))),\n );\n\n // Record<keyof Config, ...> is the compile-time exhaustiveness\n // guard: a Config key without a validator here fails the build\n // instead of being silently stripped by run().\n const validators: Record<keyof Config, ValidatorDescriptor> = {\n env: stringValidator,\n rootPath: stringValidator,\n writableDirectoryPath: stringValidator,\n\n logger: booleanValidator,\n db: createValidator(\n z.custom<MysqlConnectionOptions | PostgresConnectionOptions | BetterSqlite3ConnectionOptions>(\n (value) => isObject(value),\n ),\n ),\n redis: serviceValidator,\n smtp: serviceValidator,\n\n port: nonNegativeNumberValidator,\n host: stringValidator,\n publicUrl: createValidator(z.url()),\n trustedOrigins: createValidator(\n z.array(z.string().refine((value) => {\n try {\n expandToOrigins(value);\n return true;\n } catch {\n return false;\n }\n }, 'must be a http(s) origin or a bare host[:port]')),\n ),\n\n middlewareBody: middlewareValidator,\n middlewareCors: middlewareValidator,\n middlewareCookie: middlewareValidator,\n middlewareQuery: middlewareValidator,\n middlewarePrometheus: middlewareValidator,\n middlewareRateLimit: middlewareValidator,\n middlewareSwagger: booleanValidator,\n\n tokenAccessMaxAge: nonNegativeNumberValidator,\n tokenRefreshMaxAge: nonNegativeNumberValidator,\n tokenRefreshGracePeriod: nonNegativeNumberValidator,\n promptLoginMaxAge: nonNegativeNumberValidator,\n endSessionHintGracePeriod: nonNegativeNumberValidator,\n registrationEnabled: booleanValidator,\n emailVerificationEnabled: booleanValidator,\n passwordRecoveryEnabled: booleanValidator,\n passwordMinLength: createValidator(\n z.number().int().positive().max(USER_PASSWORD_MAX_LENGTH),\n ),\n\n clientAuthBasic: booleanValidator,\n clientSystemEnabled: booleanValidator,\n clientSystemSecret: secretValidator,\n clientSystemSecretReset: booleanValidator,\n\n userAuthBasic: booleanValidator,\n userAdminEnabled: booleanValidator,\n userAdminPassword: secretValidator,\n userAdminPasswordReset: booleanValidator,\n\n robotAuthBasic: booleanValidator,\n robotAdminEnabled: booleanValidator,\n robotAdminSecret: secretValidator,\n robotAdminSecretReset: booleanValidator,\n\n permissions: createValidator(\n z.string().or(z.array(z.string())),\n ),\n permissionsDefaultPolicyAssignment: booleanValidator,\n };\n\n const keys = Object.keys(validators) as (keyof Config)[];\n for (const key of keys) {\n this.mount(key, { optional: true }, validators[key]);\n }\n }\n}\n"],"mappings":";;;;;;;;;;AAmBA,IAAaM,kBAAb,cAAqCH,UAAAA;CACdI,aAAa;EAC5B,MAAMA,WAAAA;EAEN,MAAMC,kBAAkBN,gBAAgBE,EAAEK,OAAM,CAAA;EAChD,MAAMC,mBAAmBR,gBAAgBE,EAAEO,QAAO,CAAA;EAClD,MAAMC,6BAA6BV,gBAAgBE,EAAES,OAAM,CAAA,CAAGC,YAAW,CAAA;EACzE,MAAMC,kBAAkBb,gBAAgBE,EAAEK,OAAM,CAAA,CAAGO,IAAI,CAAA,CAAA,CAAGC,IAAI,GAAA,CAAA;EAC9D,MAAMC,sBAAsBhB,gBACxBE,EAAEO,QAAO,CAAA,CAAGQ,GAAGf,EAAEgB,OAAOhB,EAAEK,OAAM,GAAIL,EAAEiB,IAAG,CAAA,CAAA,CAAA;EAE7C,MAAMC,mBAAmBpB,gBACrBE,EAAEK,OAAM,CAAA,CACHU,GAAGf,EAAEO,QAAO,CAAA,CAAA,CACZQ,GAAGf,EAAEmB,QAA6BC,UAAUvB,SAASuB,KAAAA,CAAAA,CAAAA,CAAAA;EAM9D,MAAMC,aAAwD;GAC1DC,KAAKlB;GACLmB,UAAUnB;GACVoB,uBAAuBpB;GAEvBqB,QAAQnB;GACRoB,IAAI5B,gBACAE,EAAEmB,QACGC,UAAUvB,SAASuB,KAAAA,CAAAA,CAAAA;GAG5BO,OAAOT;GACPU,MAAMV;GAENW,MAAMrB;GACNsB,MAAM1B;GACN2B,WAAWjC,gBAAgBE,EAAEgC,IAAG,CAAA;GAChCC,gBAAgBnC,gBACZE,EAAEkC,MAAMlC,EAAEK,OAAM,CAAA,CAAG8B,QAAQf,UAAAA;IACvB,IAAI;KACAnB,gBAAgBmB,KAAAA;KAChB,OAAO;IACX,QAAQ;KACJ,OAAO;IACX;GACJ,GAAG,gDAAA,CAAA,CAAA;GAGPgB,gBAAgBtB;GAChBuB,gBAAgBvB;GAChBwB,kBAAkBxB;GAClByB,iBAAiBzB;GACjB0B,sBAAsB1B;GACtB2B,qBAAqB3B;GACrB4B,mBAAmBpC;GAEnBqC,mBAAmBnC;GACnBoC,oBAAoBpC;GACpBqC,yBAAyBrC;GACzBsC,mBAAmBtC;GACnBuC,2BAA2BvC;GAC3BwC,qBAAqB1C;GACrB2C,0BAA0B3C;GAC1B4C,yBAAyB5C;GACzB6C,mBAAmBrD,gBACfE,EAAES,OAAM,CAAA,CAAG2C,IAAG,CAAA,CAAGC,SAAQ,CAAA,CAAGxC,IAAIjB,wBAAAA,CAAAA;GAGpC0D,iBAAiBhD;GACjBiD,qBAAqBjD;GACrBkD,oBAAoB7C;GACpB8C,yBAAyBnD;GAEzBoD,eAAepD;GACfqD,kBAAkBrD;GAClBsD,mBAAmBjD;GACnBkD,wBAAwBvD;GAExBwD,gBAAgBxD;GAChByD,mBAAmBzD;GACnB0D,kBAAkBrD;GAClBsD,uBAAuB3D;GAEvB4D,aAAapE,gBACTE,EAAEK,OAAM,CAAA,CAAGU,GAAGf,EAAEkC,MAAMlC,EAAEK,OAAM,CAAA,CAAA,CAAA;GAElC8D,oCAAoC7D;EACxC;EAEA,MAAM8D,OAAOC,OAAOD,KAAK/C,UAAAA;EACzB,KAAK,MAAMiD,OAAOF,MACd,KAAKG,MAAMD,KAAK,EAAEE,UAAU,KAAK,GAAGnD,WAAWiD,IAAI;CAE3D;AACJ"}
|
|
1
|
+
{"version":3,"file":"validator.mjs","names":["USER_PASSWORD_MAX_LENGTH","isObject","createValidator","Container","z","expandToOrigins","CERTIFICATE_SOURCES","ConfigValidator","initialize","stringValidator","string","booleanValidator","boolean","nonNegativeNumberValidator","number","nonnegative","secretValidator","min","max","middlewareValidator","or","record","any","serviceValidator","custom","value","validators","env","rootPath","writableDirectoryPath","logger","db","redis","smtp","port","host","publicUrl","url","mtlsPublicUrl","nullable","certificateSource","enum","trustedOrigins","array","refine","middlewareBody","middlewareCors","middlewareCookie","middlewareQuery","middlewarePrometheus","middlewareRateLimit","middlewareSwagger","tokenAccessMaxAge","tokenRefreshMaxAge","tokenRefreshGracePeriod","promptLoginMaxAge","endSessionHintGracePeriod","registrationEnabled","emailVerificationEnabled","passwordRecoveryEnabled","passwordMinLength","int","positive","eventLogEnabled","eventLogRetentionDays","eventLogEntityEnabled","eventLogEntityRetentionDays","loginAttemptThrottleEnabled","loginAttemptThreshold","loginAttemptWindow","secretsEncryptionKey","union","literal","base64","mfaEnabled","mfaRequired","mfaFreshnessMaxAge","mfaTicketMaxAge","clientAuthBasic","clientSystemEnabled","clientSystemSecret","clientSystemSecretReset","userAuthBasic","userAdminEnabled","userAdminPassword","userAdminPasswordReset","robotAuthBasic","robotAdminEnabled","robotAdminSecret","robotAdminSecretReset","permissions","permissionsDefaultPolicyAssignment","keys","Object","key","mount","optional"],"sources":["../../../../src/app/modules/config/validator.ts"],"sourcesContent":["/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { USER_PASSWORD_MAX_LENGTH } from '@authup/core-kit';\nimport { isObject } from '@authup/kit';\nimport { createValidator } from '@validup/zod';\nimport type { BetterSqlite3ConnectionOptions } from 'typeorm/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js';\nimport type { MysqlConnectionOptions } from 'typeorm/driver/mysql/MysqlConnectionOptions.js';\nimport type { PostgresConnectionOptions } from 'typeorm/driver/postgres/PostgresConnectionOptions.js';\nimport type { ValidatorDescriptor } from 'validup';\nimport { Container } from 'validup';\nimport { z } from 'zod';\nimport { expandToOrigins } from './origins.ts';\nimport type { Config } from './types.ts';\nimport { CERTIFICATE_SOURCES } from '../../../adapters/http/request/index.ts';\n\nexport class ConfigValidator extends Container<Config> {\n protected override initialize() {\n super.initialize();\n\n const stringValidator = createValidator(z.string());\n const booleanValidator = createValidator(z.boolean());\n const nonNegativeNumberValidator = createValidator(z.number().nonnegative());\n const secretValidator = createValidator(z.string().min(3).max(256));\n const middlewareValidator = createValidator(\n z.boolean().or(z.record(z.string(), z.any())),\n );\n const serviceValidator = createValidator(\n z.string()\n .or(z.boolean())\n .or(z.custom<Record<string, any>>((value) => isObject(value))),\n );\n\n // Record<keyof Config, ...> is the compile-time exhaustiveness\n // guard: a Config key without a validator here fails the build\n // instead of being silently stripped by run().\n const validators: Record<keyof Config, ValidatorDescriptor> = {\n env: stringValidator,\n rootPath: stringValidator,\n writableDirectoryPath: stringValidator,\n\n logger: booleanValidator,\n db: createValidator(\n z.custom<MysqlConnectionOptions | PostgresConnectionOptions | BetterSqlite3ConnectionOptions>(\n (value) => isObject(value),\n ),\n ),\n redis: serviceValidator,\n smtp: serviceValidator,\n\n port: nonNegativeNumberValidator,\n host: stringValidator,\n publicUrl: createValidator(z.url()),\n mtlsPublicUrl: createValidator(z.url().nullable()),\n certificateSource: createValidator(z.enum(CERTIFICATE_SOURCES)),\n trustedOrigins: createValidator(\n z.array(z.string().refine((value) => {\n try {\n expandToOrigins(value);\n return true;\n } catch {\n return false;\n }\n }, 'must be a http(s) origin or a bare host[:port]')),\n ),\n\n middlewareBody: middlewareValidator,\n middlewareCors: middlewareValidator,\n middlewareCookie: middlewareValidator,\n middlewareQuery: middlewareValidator,\n middlewarePrometheus: middlewareValidator,\n middlewareRateLimit: middlewareValidator,\n middlewareSwagger: booleanValidator,\n\n tokenAccessMaxAge: nonNegativeNumberValidator,\n tokenRefreshMaxAge: nonNegativeNumberValidator,\n tokenRefreshGracePeriod: nonNegativeNumberValidator,\n promptLoginMaxAge: nonNegativeNumberValidator,\n endSessionHintGracePeriod: nonNegativeNumberValidator,\n registrationEnabled: booleanValidator,\n emailVerificationEnabled: booleanValidator,\n passwordRecoveryEnabled: booleanValidator,\n passwordMinLength: createValidator(\n z.number().int().positive().max(USER_PASSWORD_MAX_LENGTH),\n ),\n\n eventLogEnabled: booleanValidator,\n eventLogRetentionDays: nonNegativeNumberValidator,\n eventLogEntityEnabled: booleanValidator,\n eventLogEntityRetentionDays: nonNegativeNumberValidator,\n loginAttemptThrottleEnabled: booleanValidator,\n loginAttemptThreshold: createValidator(z.number().int().positive()),\n loginAttemptWindow: createValidator(z.number().int().positive()),\n\n // '' = unset; otherwise a base64 string (normalizeConfig enforces\n // the decoded 32-byte length at boot).\n secretsEncryptionKey: createValidator(z.union([z.literal(''), z.base64()])),\n\n mfaEnabled: booleanValidator,\n mfaRequired: booleanValidator,\n mfaFreshnessMaxAge: nonNegativeNumberValidator,\n mfaTicketMaxAge: createValidator(z.number().int().positive()),\n\n clientAuthBasic: booleanValidator,\n clientSystemEnabled: booleanValidator,\n clientSystemSecret: secretValidator,\n clientSystemSecretReset: booleanValidator,\n\n userAuthBasic: booleanValidator,\n userAdminEnabled: booleanValidator,\n userAdminPassword: secretValidator,\n userAdminPasswordReset: booleanValidator,\n\n robotAuthBasic: booleanValidator,\n robotAdminEnabled: booleanValidator,\n robotAdminSecret: secretValidator,\n robotAdminSecretReset: booleanValidator,\n\n permissions: createValidator(\n z.string().or(z.array(z.string())),\n ),\n permissionsDefaultPolicyAssignment: booleanValidator,\n };\n\n const keys = Object.keys(validators) as (keyof Config)[];\n for (const key of keys) {\n this.mount(key, { optional: true }, validators[key]);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAaO,kBAAb,cAAqCJ,UAAAA;CACdK,aAAa;EAC5B,MAAMA,WAAAA;EAEN,MAAMC,kBAAkBP,gBAAgBE,EAAEM,OAAM,CAAA;EAChD,MAAMC,mBAAmBT,gBAAgBE,EAAEQ,QAAO,CAAA;EAClD,MAA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AEE,UAAU,KAAK,GAAGtE,WAAWoE,IAAI;CAE3D;AACJ"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { IDomainEventPublisher } from '@authup/server-kit';
|
|
2
2
|
import type { DataSource } from 'typeorm';
|
|
3
3
|
import { TypedToken } from 'eldin';
|
|
4
|
+
import type { IEventRepository, IEventService } from '../../../core/index.ts';
|
|
4
5
|
export declare const DatabaseInjectionKey: {
|
|
5
6
|
readonly DataSource: TypedToken<DataSource>;
|
|
6
7
|
readonly DomainEventPublisher: TypedToken<IDomainEventPublisher>;
|
|
8
|
+
readonly EventRepository: TypedToken<IEventRepository>;
|
|
9
|
+
readonly EventService: TypedToken<IEventService>;
|
|
7
10
|
};
|
|
8
11
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/database/constants.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/database/constants.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE9E,eAAO,MAAM,oBAAoB;;;;;CAKvB,CAAC"}
|
|
@@ -5,7 +5,9 @@ import { TypedToken } from "eldin";
|
|
|
5
5
|
//#region src/app/modules/database/constants.ts
|
|
6
6
|
const DatabaseInjectionKey = {
|
|
7
7
|
DataSource: new TypedToken("DataSource"),
|
|
8
|
-
DomainEventPublisher: new TypedToken("DomainEventPublisher")
|
|
8
|
+
DomainEventPublisher: new TypedToken("DomainEventPublisher"),
|
|
9
|
+
EventRepository: new TypedToken("EventRepository"),
|
|
10
|
+
EventService: new TypedToken("EventService")
|
|
9
11
|
};
|
|
10
12
|
//#endregion
|
|
11
13
|
export { DatabaseInjectionKey };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","names":["TypedToken","DatabaseInjectionKey","DataSource","DomainEventPublisher"],"sources":["../../../../src/app/modules/database/constants.ts"],"sourcesContent":["/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { IDomainEventPublisher } from '@authup/server-kit';\nimport type { DataSource } from 'typeorm';\nimport { TypedToken } from 'eldin';\n\nexport const DatabaseInjectionKey = {\n DataSource: new TypedToken<DataSource>('DataSource'),\n DomainEventPublisher: new TypedToken<IDomainEventPublisher>('DomainEventPublisher'),\n} as const;\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"constants.mjs","names":["TypedToken","DatabaseInjectionKey","DataSource","DomainEventPublisher","EventRepository","EventService"],"sources":["../../../../src/app/modules/database/constants.ts"],"sourcesContent":["/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { IDomainEventPublisher } from '@authup/server-kit';\nimport type { DataSource } from 'typeorm';\nimport { TypedToken } from 'eldin';\nimport type { IEventRepository, IEventService } from '../../../core/index.ts';\n\nexport const DatabaseInjectionKey = {\n DataSource: new TypedToken<DataSource>('DataSource'),\n DomainEventPublisher: new TypedToken<IDomainEventPublisher>('DomainEventPublisher'),\n EventRepository: new TypedToken<IEventRepository>('EventRepository'),\n EventService: new TypedToken<IEventService>('EventService'),\n} as const;\n"],"mappings":";;;;;AAYA,MAAaC,uBAAuB;CAChCC,YAAY,IAAIF,WAAuB,YAAA;CACvCG,sBAAsB,IAAIH,WAAkC,sBAAA;CAC5DI,iBAAiB,IAAIJ,WAA6B,iBAAA;CAClDK,cAAc,IAAIL,WAA0B,cAAA;AAChD"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import "node:path";
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
|
-
import { DatabaseInjectionKey } from "./constants.mjs";
|
|
5
|
-
import { DatabaseModule } from "./module.mjs";
|
|
6
4
|
import { RealmRepositoryAdapter } from "./repositories/realm/repository.mjs";
|
|
7
5
|
import { ClientRepositoryAdapter } from "./repositories/client/repository.mjs";
|
|
8
6
|
import { ClientPermissionRepositoryAdapter } from "./repositories/client-permission/repository.mjs";
|
|
9
7
|
import { ClientRoleRepositoryAdapter } from "./repositories/client-role/repository.mjs";
|
|
10
8
|
import { ClientScopeRepositoryAdapter } from "./repositories/client-scope/repository.mjs";
|
|
9
|
+
import { EventRepositoryAdapter } from "./repositories/event/repository.mjs";
|
|
11
10
|
import { IdentityProviderRepositoryAdapter } from "./repositories/identity-provider/repository.mjs";
|
|
11
|
+
import { KeyRepositoryAdapter } from "./repositories/key/repository.mjs";
|
|
12
12
|
import { PermissionRepositoryAdapter } from "./repositories/permission/repository.mjs";
|
|
13
13
|
import { PermissionPolicyRepositoryAdapter } from "./repositories/permission-policy/repository.mjs";
|
|
14
14
|
import { PermissionDatabaseProvider } from "./repositories/permission-provider/module.mjs";
|
|
@@ -20,10 +20,14 @@ import { RoleRepositoryAdapter } from "./repositories/role/repository.mjs";
|
|
|
20
20
|
import { RoleAttributeRepositoryAdapter } from "./repositories/role-attribute/repository.mjs";
|
|
21
21
|
import { RolePermissionRepositoryAdapter } from "./repositories/role-permission/repository.mjs";
|
|
22
22
|
import { ScopeRepositoryAdapter } from "./repositories/scope/repository.mjs";
|
|
23
|
+
import { TrustAnchorRepositoryAdapter } from "./repositories/trust-anchor/repository.mjs";
|
|
23
24
|
import { UserRepositoryAdapter } from "./repositories/user/repository.mjs";
|
|
24
25
|
import { UserAttributeRepositoryAdapter } from "./repositories/user-attribute/repository.mjs";
|
|
26
|
+
import { UserAuthenticatorRepositoryAdapter } from "./repositories/user-authenticator/repository.mjs";
|
|
25
27
|
import { UserPermissionRepositoryAdapter } from "./repositories/user-permission/repository.mjs";
|
|
26
28
|
import { UserRoleRepositoryAdapter } from "./repositories/user-role/repository.mjs";
|
|
27
29
|
import { IdentityProviderRoleMappingRepositoryAdapter } from "./repositories/identity-provider-role-mapping/repository.mjs";
|
|
28
30
|
import "./repositories/index.mjs";
|
|
29
|
-
|
|
31
|
+
import { DatabaseInjectionKey } from "./constants.mjs";
|
|
32
|
+
import { DatabaseModule } from "./module.mjs";
|
|
33
|
+
export { ClientPermissionRepositoryAdapter, ClientRepositoryAdapter, ClientRoleRepositoryAdapter, ClientScopeRepositoryAdapter, DatabaseInjectionKey, DatabaseModule, EventRepositoryAdapter, IdentityProviderRepositoryAdapter, IdentityProviderRoleMappingRepositoryAdapter, KeyRepositoryAdapter, PermissionDatabaseProvider, PermissionPolicyRepositoryAdapter, PermissionRepositoryAdapter, PolicyRepositoryAdapter, RealmRepositoryAdapter, RobotPermissionRepositoryAdapter, RobotRepositoryAdapter, RobotRoleRepositoryAdapter, RoleAttributeRepositoryAdapter, RolePermissionRepositoryAdapter, RoleRepositoryAdapter, ScopeRepositoryAdapter, TrustAnchorRepositoryAdapter, UserAttributeRepositoryAdapter, UserAuthenticatorRepositoryAdapter, UserPermissionRepositoryAdapter, UserRepositoryAdapter, UserRoleRepositoryAdapter };
|
|
@@ -31,5 +31,6 @@ export declare class DatabaseModule implements IModule {
|
|
|
31
31
|
protected buildDataSourceOptions(container: IContainer): Promise<DataSourceOptions>;
|
|
32
32
|
protected registerRepositories(container: IContainer, dataSource: DataSource): void;
|
|
33
33
|
protected registerEventPublisher(container: IContainer, dataSource: DataSource): void;
|
|
34
|
+
protected registerEvents(container: IContainer, dataSource: DataSource): void;
|
|
34
35
|
}
|
|
35
36
|
//# sourceMappingURL=module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/database/module.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,oBAAoB,EAIvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,UAAU,EAAmB,MAAM,SAAS,CAAC;AAMtD,OAAO,EACH,wBAAwB,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/database/module.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,oBAAoB,EAIvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,UAAU,EAAmB,MAAM,SAAS,CAAC;AAMtD,OAAO,EACH,wBAAwB,EAM3B,MAAM,qCAAqC,CAAC;AAM7C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAIrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGxC,MAAM,MAAM,qBAAqB,GAAG;IAChC,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7E,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9E,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