@authup/server-core 1.0.0-beta.63 → 1.0.0-beta.64
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 +1 -0
- package/dist/adapters/database/data-source/options/module.d.ts.map +1 -1
- package/dist/adapters/database/data-source/options/module.mjs +33 -4
- package/dist/adapters/database/data-source/options/module.mjs.map +1 -1
- package/dist/adapters/database/domains/client/entity.d.ts +1 -2
- package/dist/adapters/database/domains/client/entity.d.ts.map +1 -1
- package/dist/adapters/database/domains/client/entity.mjs +7 -14
- package/dist/adapters/database/domains/client/entity.mjs.map +1 -1
- package/dist/adapters/database/domains/identity-provider-attribute/subscriber.d.ts +2 -1
- package/dist/adapters/database/domains/identity-provider-attribute/subscriber.d.ts.map +1 -1
- package/dist/adapters/database/domains/identity-provider-attribute/subscriber.mjs +2 -2
- package/dist/adapters/database/domains/identity-provider-attribute/subscriber.mjs.map +1 -1
- package/dist/adapters/database/domains/session/entity.d.ts +8 -0
- package/dist/adapters/database/domains/session/entity.d.ts.map +1 -1
- package/dist/adapters/database/domains/session/entity.mjs +19 -0
- package/dist/adapters/database/domains/session/entity.mjs.map +1 -1
- package/dist/adapters/database/domains/user/entity.d.ts +1 -0
- package/dist/adapters/database/domains/user/entity.d.ts.map +1 -1
- package/dist/adapters/database/domains/user/entity.mjs +6 -0
- package/dist/adapters/database/domains/user/entity.mjs.map +1 -1
- package/dist/adapters/database/extra-attribute-repository/repository.mjs +1 -1
- package/dist/adapters/database/extra-attribute-repository/repository.mjs.map +1 -1
- package/dist/adapters/database/extra-attribute-repository/tree/adapter.mjs +4 -2
- package/dist/adapters/database/extra-attribute-repository/tree/adapter.mjs.map +1 -1
- package/dist/adapters/database/extra-attribute-repository/tree/repository.mjs +1 -1
- package/dist/adapters/database/extra-attribute-repository/tree/repository.mjs.map +1 -1
- package/dist/adapters/database/index.mjs +3 -3
- package/dist/adapters/database/migrations/mysql/1787571998009-SessionUserAndClientColumns.d.ts +56 -0
- package/dist/adapters/database/migrations/mysql/1787571998009-SessionUserAndClientColumns.d.ts.map +1 -0
- package/dist/adapters/database/migrations/mysql/1787571998009-SessionUserAndClientColumns.mjs +105 -0
- package/dist/adapters/database/migrations/mysql/1787571998009-SessionUserAndClientColumns.mjs.map +1 -0
- package/dist/adapters/database/migrations/postgres/1787571998009-SessionUserAndClientColumns.d.ts +56 -0
- package/dist/adapters/database/migrations/postgres/1787571998009-SessionUserAndClientColumns.d.ts.map +1 -0
- package/dist/adapters/database/migrations/postgres/1787571998009-SessionUserAndClientColumns.mjs +104 -0
- package/dist/adapters/database/migrations/postgres/1787571998009-SessionUserAndClientColumns.mjs.map +1 -0
- package/dist/adapters/database/subscriber/module.d.ts +6 -2
- package/dist/adapters/database/subscriber/module.d.ts.map +1 -1
- package/dist/adapters/database/subscriber/module.mjs +9 -5
- package/dist/adapters/database/subscriber/module.mjs.map +1 -1
- package/dist/adapters/http/adapters/oauth2/authorization/module.mjs +1 -1
- package/dist/adapters/http/adapters/oauth2/authorization/module.mjs.map +1 -1
- package/dist/adapters/http/constants.d.ts +18 -0
- package/dist/adapters/http/constants.d.ts.map +1 -0
- package/dist/adapters/http/constants.mjs +23 -0
- package/dist/adapters/http/constants.mjs.map +1 -0
- package/dist/adapters/http/controllers/entities/identity-provider/module.mjs +3 -3
- package/dist/adapters/http/controllers/entities/identity-provider/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/entities/identity-provider/types.d.ts +6 -0
- package/dist/adapters/http/controllers/entities/identity-provider/types.d.ts.map +1 -1
- package/dist/adapters/http/controllers/entities/realm/module.d.ts.map +1 -1
- package/dist/adapters/http/controllers/entities/realm/module.mjs +2 -0
- package/dist/adapters/http/controllers/entities/realm/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/entities/session/module.d.ts +33 -1
- package/dist/adapters/http/controllers/entities/session/module.d.ts.map +1 -1
- package/dist/adapters/http/controllers/entities/session/module.mjs +74 -0
- package/dist/adapters/http/controllers/entities/session/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/index.mjs +3 -1
- package/dist/adapters/http/controllers/workflows/account/index.d.ts +1 -0
- package/dist/adapters/http/controllers/workflows/account/index.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/account/module.d.ts +25 -16
- package/dist/adapters/http/controllers/workflows/account/module.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/account/module.mjs +40 -17
- package/dist/adapters/http/controllers/workflows/account/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/workflows/account/types.d.ts +33 -0
- package/dist/adapters/http/controllers/workflows/account/types.d.ts.map +1 -0
- package/dist/adapters/http/controllers/workflows/activate/module.d.ts +8 -4
- package/dist/adapters/http/controllers/workflows/activate/module.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/activate/module.mjs +7 -9
- package/dist/adapters/http/controllers/workflows/activate/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/workflows/admin/index.d.ts.map +1 -0
- package/dist/adapters/http/controllers/workflows/admin/index.mjs +5 -0
- package/dist/adapters/http/controllers/workflows/admin/module.d.ts +30 -0
- package/dist/adapters/http/controllers/workflows/admin/module.d.ts.map +1 -0
- package/dist/adapters/http/controllers/workflows/admin/module.mjs +88 -0
- package/dist/adapters/http/controllers/workflows/admin/module.mjs.map +1 -0
- package/dist/adapters/http/controllers/workflows/admin/types.d.ts +14 -0
- package/dist/adapters/http/controllers/workflows/admin/types.d.ts.map +1 -0
- package/dist/adapters/http/controllers/workflows/auth-console.d.ts +16 -0
- package/dist/adapters/http/controllers/workflows/auth-console.d.ts.map +1 -0
- package/dist/adapters/http/controllers/workflows/auth-console.mjs +32 -0
- package/dist/adapters/http/controllers/workflows/auth-console.mjs.map +1 -0
- package/dist/adapters/http/controllers/workflows/authorize/module.d.ts +16 -1
- package/dist/adapters/http/controllers/workflows/authorize/module.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/authorize/module.mjs +40 -22
- package/dist/adapters/http/controllers/workflows/authorize/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/workflows/authorize/types.d.ts +5 -0
- package/dist/adapters/http/controllers/workflows/authorize/types.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/console-login/index.d.ts +3 -0
- package/dist/adapters/http/controllers/workflows/console-login/index.d.ts.map +1 -0
- package/dist/adapters/http/controllers/workflows/console-login/index.mjs +5 -0
- package/dist/adapters/http/controllers/workflows/console-login/module.d.ts +83 -0
- package/dist/adapters/http/controllers/workflows/console-login/module.d.ts.map +1 -0
- package/dist/adapters/http/controllers/workflows/console-login/module.mjs +230 -0
- package/dist/adapters/http/controllers/workflows/console-login/module.mjs.map +1 -0
- package/dist/adapters/http/controllers/workflows/console-login/types.d.ts +58 -0
- package/dist/adapters/http/controllers/workflows/console-login/types.d.ts.map +1 -0
- package/dist/adapters/http/controllers/workflows/index.d.ts +2 -0
- package/dist/adapters/http/controllers/workflows/index.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/index.mjs +5 -1
- package/dist/adapters/http/controllers/workflows/logout/module.d.ts +32 -3
- package/dist/adapters/http/controllers/workflows/logout/module.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/logout/module.mjs +48 -24
- package/dist/adapters/http/controllers/workflows/logout/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/workflows/logout/types.d.ts +1 -1
- package/dist/adapters/http/controllers/workflows/logout/types.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/password-forgot/module.d.ts +8 -4
- package/dist/adapters/http/controllers/workflows/password-forgot/module.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/password-forgot/module.mjs +7 -9
- package/dist/adapters/http/controllers/workflows/password-forgot/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/workflows/password-reset/module.d.ts +8 -4
- package/dist/adapters/http/controllers/workflows/password-reset/module.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/password-reset/module.mjs +7 -10
- package/dist/adapters/http/controllers/workflows/password-reset/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/workflows/register/module.d.ts +8 -4
- package/dist/adapters/http/controllers/workflows/register/module.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/register/module.mjs +7 -9
- package/dist/adapters/http/controllers/workflows/register/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/workflows/status/module.mjs +1 -1
- package/dist/adapters/http/controllers/workflows/token/module.d.ts +45 -2
- package/dist/adapters/http/controllers/workflows/token/module.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/token/module.mjs +102 -24
- package/dist/adapters/http/controllers/workflows/token/module.mjs.map +1 -1
- package/dist/adapters/http/cookie/index.d.ts +2 -0
- package/dist/adapters/http/cookie/index.d.ts.map +1 -0
- package/dist/adapters/http/cookie/index.mjs +5 -0
- package/dist/adapters/http/cookie/session.d.ts +35 -0
- package/dist/adapters/http/cookie/session.d.ts.map +1 -0
- package/dist/adapters/http/cookie/session.mjs +62 -0
- package/dist/adapters/http/cookie/session.mjs.map +1 -0
- package/dist/adapters/http/index.d.ts +2 -0
- package/dist/adapters/http/index.d.ts.map +1 -1
- package/dist/adapters/http/index.mjs +20 -16
- package/dist/adapters/http/internal-client/index.d.ts +3 -0
- package/dist/adapters/http/internal-client/index.d.ts.map +1 -0
- package/dist/adapters/http/internal-client/index.mjs +5 -0
- package/dist/adapters/http/internal-client/module.d.ts +21 -0
- package/dist/adapters/http/internal-client/module.d.ts.map +1 -0
- package/dist/adapters/http/{ui/auth-console/http-client.mjs → internal-client/module.mjs} +16 -15
- package/dist/adapters/http/internal-client/module.mjs.map +1 -0
- package/dist/adapters/http/internal-client/types.d.ts +13 -0
- package/dist/adapters/http/internal-client/types.d.ts.map +1 -0
- package/dist/adapters/http/middleware/built-in/authorization/index.d.ts +1 -0
- package/dist/adapters/http/middleware/built-in/authorization/index.d.ts.map +1 -1
- package/dist/adapters/http/middleware/built-in/authorization/index.mjs +2 -1
- package/dist/adapters/http/middleware/built-in/authorization/issuance.d.ts +45 -0
- package/dist/adapters/http/middleware/built-in/authorization/issuance.d.ts.map +1 -0
- package/dist/adapters/http/middleware/built-in/authorization/issuance.mjs +61 -0
- package/dist/adapters/http/middleware/built-in/authorization/issuance.mjs.map +1 -0
- package/dist/adapters/http/middleware/built-in/authorization/module.d.ts +26 -2
- package/dist/adapters/http/middleware/built-in/authorization/module.d.ts.map +1 -1
- package/dist/adapters/http/middleware/built-in/authorization/module.mjs +67 -1
- package/dist/adapters/http/middleware/built-in/authorization/module.mjs.map +1 -1
- package/dist/adapters/http/middleware/built-in/authorization/types.d.ts +21 -1
- package/dist/adapters/http/middleware/built-in/authorization/types.d.ts.map +1 -1
- package/dist/adapters/http/middleware/built-in/basic.d.ts +2 -2
- package/dist/adapters/http/middleware/built-in/basic.d.ts.map +1 -1
- package/dist/adapters/http/middleware/built-in/basic.mjs.map +1 -1
- package/dist/adapters/http/middleware/built-in/cors.d.ts +8 -2
- package/dist/adapters/http/middleware/built-in/cors.d.ts.map +1 -1
- package/dist/adapters/http/middleware/built-in/cors.mjs +20 -3
- package/dist/adapters/http/middleware/built-in/cors.mjs.map +1 -1
- package/dist/adapters/http/middleware/built-in/error.d.ts +2 -2
- package/dist/adapters/http/middleware/built-in/error.d.ts.map +1 -1
- package/dist/adapters/http/middleware/built-in/error.mjs.map +1 -1
- package/dist/adapters/http/middleware/built-in/index.d.ts +1 -4
- package/dist/adapters/http/middleware/built-in/index.d.ts.map +1 -1
- package/dist/adapters/http/middleware/built-in/index.mjs +3 -4
- package/dist/adapters/http/middleware/built-in/internal-http-client.d.ts +17 -0
- package/dist/adapters/http/middleware/built-in/internal-http-client.d.ts.map +1 -0
- package/dist/adapters/http/middleware/built-in/internal-http-client.mjs +27 -0
- package/dist/adapters/http/middleware/built-in/internal-http-client.mjs.map +1 -0
- package/dist/adapters/http/middleware/built-in/logger.mjs +1 -1
- package/dist/adapters/http/middleware/built-in/logger.mjs.map +1 -1
- package/dist/adapters/http/middleware/built-in/prometheus.d.ts +6 -5
- package/dist/adapters/http/middleware/built-in/prometheus.d.ts.map +1 -1
- package/dist/adapters/http/middleware/built-in/prometheus.mjs +3 -2
- package/dist/adapters/http/middleware/built-in/prometheus.mjs.map +1 -1
- package/dist/adapters/http/middleware/built-in/rate-limit.d.ts +2 -2
- package/dist/adapters/http/middleware/built-in/rate-limit.d.ts.map +1 -1
- package/dist/adapters/http/middleware/built-in/rate-limit.mjs +15 -0
- package/dist/adapters/http/middleware/built-in/rate-limit.mjs.map +1 -1
- package/dist/adapters/http/middleware/index.mjs +3 -4
- package/dist/adapters/http/request/constants.d.ts +1 -1
- package/dist/adapters/http/request/constants.d.ts.map +1 -1
- package/dist/adapters/http/request/constants.mjs +1 -5
- package/dist/adapters/http/request/constants.mjs.map +1 -1
- package/dist/adapters/http/request/helpers/index.d.ts +1 -1
- package/dist/adapters/http/request/helpers/index.d.ts.map +1 -1
- package/dist/adapters/http/request/helpers/index.mjs +2 -2
- package/dist/adapters/http/request/helpers/locale.d.ts +2 -1
- package/dist/adapters/http/request/helpers/locale.d.ts.map +1 -1
- package/dist/adapters/http/request/helpers/locale.mjs +1 -1
- package/dist/adapters/http/request/helpers/locale.mjs.map +1 -1
- package/dist/adapters/http/request/helpers/same-origin.d.ts +38 -0
- package/dist/adapters/http/request/helpers/same-origin.d.ts.map +1 -0
- package/dist/adapters/http/request/helpers/same-origin.mjs +68 -0
- package/dist/adapters/http/request/helpers/same-origin.mjs.map +1 -0
- package/dist/adapters/http/request/index.mjs +2 -2
- package/dist/adapters/http/request/permission/module.mjs +1 -1
- package/dist/adapters/http/request/permission/module.mjs.map +1 -1
- package/dist/adapters/http/request/types.d.ts +1 -2
- package/dist/adapters/http/request/types.d.ts.map +1 -1
- package/dist/adapters/shared/ldap/module.d.ts.map +1 -1
- package/dist/adapters/shared/ldap/module.mjs +4 -1
- package/dist/adapters/shared/ldap/module.mjs.map +1 -1
- package/dist/app/builder.d.ts +4 -4
- package/dist/app/builder.d.ts.map +1 -1
- package/dist/app/builder.mjs +7 -4
- package/dist/app/builder.mjs.map +1 -1
- package/dist/app/factory.d.ts +10 -0
- package/dist/app/factory.d.ts.map +1 -1
- package/dist/app/factory.mjs +26 -2
- package/dist/app/factory.mjs.map +1 -1
- package/dist/app/index.mjs +17 -19
- package/dist/app/modules/authentication/module.d.ts.map +1 -1
- package/dist/app/modules/authentication/module.mjs +15 -2
- package/dist/app/modules/authentication/module.mjs.map +1 -1
- package/dist/app/modules/authentication/repositories/session.d.ts +4 -1
- package/dist/app/modules/authentication/repositories/session.d.ts.map +1 -1
- package/dist/app/modules/authentication/repositories/session.mjs +20 -3
- package/dist/app/modules/authentication/repositories/session.mjs.map +1 -1
- package/dist/app/modules/components/index.d.ts +1 -0
- package/dist/app/modules/components/index.d.ts.map +1 -1
- package/dist/app/modules/components/module.d.ts +3 -1
- package/dist/app/modules/components/module.d.ts.map +1 -1
- package/dist/app/modules/components/module.mjs +26 -7
- package/dist/app/modules/components/module.mjs.map +1 -1
- package/dist/app/modules/components/types.d.ts +11 -0
- package/dist/app/modules/components/types.d.ts.map +1 -0
- package/dist/app/modules/config/app-origins.d.ts +10 -0
- package/dist/app/modules/config/app-origins.d.ts.map +1 -0
- package/dist/app/modules/config/app-origins.mjs +21 -0
- package/dist/app/modules/config/app-origins.mjs.map +1 -0
- package/dist/app/modules/config/constants.d.ts +23 -50
- package/dist/app/modules/config/constants.d.ts.map +1 -1
- package/dist/app/modules/config/constants.mjs +34 -51
- package/dist/app/modules/config/constants.mjs.map +1 -1
- package/dist/app/modules/config/index.d.ts +2 -3
- package/dist/app/modules/config/index.d.ts.map +1 -1
- package/dist/app/modules/config/index.mjs +4 -8
- package/dist/app/modules/config/module.d.ts +2 -2
- package/dist/app/modules/config/module.d.ts.map +1 -1
- package/dist/app/modules/config/module.mjs +1 -1
- package/dist/app/modules/config/module.mjs.map +1 -1
- package/dist/app/modules/config/read.d.ts +29 -0
- package/dist/app/modules/config/read.d.ts.map +1 -0
- package/dist/app/modules/config/read.mjs +65 -0
- package/dist/app/modules/config/read.mjs.map +1 -0
- package/dist/app/modules/config/types.d.ts +30 -405
- 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 +3 -87
- package/dist/app/modules/config/validator.mjs.map +1 -1
- package/dist/app/modules/database/index.d.ts +1 -0
- package/dist/app/modules/database/index.d.ts.map +1 -1
- package/dist/app/modules/database/index.mjs +2 -1
- package/dist/app/modules/database/migration.d.ts +33 -0
- package/dist/app/modules/database/migration.d.ts.map +1 -0
- package/dist/app/modules/database/migration.mjs +52 -0
- package/dist/app/modules/database/migration.mjs.map +1 -0
- package/dist/app/modules/database/module.d.ts.map +1 -1
- package/dist/app/modules/database/module.mjs +12 -6
- package/dist/app/modules/database/module.mjs.map +1 -1
- package/dist/app/modules/database/repositories/client/repository.d.ts +6 -1
- package/dist/app/modules/database/repositories/client/repository.d.ts.map +1 -1
- package/dist/app/modules/database/repositories/client/repository.mjs +21 -4
- package/dist/app/modules/database/repositories/client/repository.mjs.map +1 -1
- package/dist/app/modules/database/repositories/event/repository.d.ts +29 -2
- package/dist/app/modules/database/repositories/event/repository.d.ts.map +1 -1
- package/dist/app/modules/database/repositories/event/repository.mjs +42 -24
- package/dist/app/modules/database/repositories/event/repository.mjs.map +1 -1
- package/dist/app/modules/database/repositories/helpers.d.ts +24 -1
- package/dist/app/modules/database/repositories/helpers.d.ts.map +1 -1
- package/dist/app/modules/database/repositories/helpers.mjs +38 -1
- package/dist/app/modules/database/repositories/helpers.mjs.map +1 -1
- package/dist/app/modules/database/repositories/identity-provider/repository.mjs +1 -1
- package/dist/app/modules/database/repositories/identity-provider-account/repository.mjs +4 -2
- package/dist/app/modules/database/repositories/identity-provider-account/repository.mjs.map +1 -1
- package/dist/app/modules/database/repositories/key/repository.mjs +1 -1
- package/dist/app/modules/database/repositories/permission/repository.mjs +1 -1
- package/dist/app/modules/database/repositories/policy/repository.mjs +1 -1
- package/dist/app/modules/database/repositories/role/repository.mjs +1 -1
- package/dist/app/modules/database/repositories/scope/repository.mjs +1 -1
- package/dist/app/modules/database/repositories/trust-anchor/repository.mjs +1 -1
- package/dist/app/modules/database/repositories/user/repository.d.ts +7 -2
- package/dist/app/modules/database/repositories/user/repository.d.ts.map +1 -1
- package/dist/app/modules/database/repositories/user/repository.mjs +21 -4
- package/dist/app/modules/database/repositories/user/repository.mjs.map +1 -1
- package/dist/app/modules/http/constants.d.ts +3 -1
- package/dist/app/modules/http/constants.d.ts.map +1 -1
- package/dist/app/modules/http/constants.mjs +3 -2
- package/dist/app/modules/http/constants.mjs.map +1 -1
- package/dist/app/modules/http/module.d.ts +30 -9
- package/dist/app/modules/http/module.d.ts.map +1 -1
- package/dist/app/modules/http/module.mjs +31 -33
- package/dist/app/modules/http/module.mjs.map +1 -1
- package/dist/app/modules/http/modules/controller.d.ts +4 -3
- package/dist/app/modules/http/modules/controller.d.ts.map +1 -1
- package/dist/app/modules/http/modules/controller.mjs +65 -36
- package/dist/app/modules/http/modules/controller.mjs.map +1 -1
- package/dist/app/modules/http/modules/middleware.d.ts +13 -22
- package/dist/app/modules/http/modules/middleware.d.ts.map +1 -1
- package/dist/app/modules/http/modules/middleware.mjs +20 -36
- package/dist/app/modules/http/modules/middleware.mjs.map +1 -1
- package/dist/app/modules/identity/module.mjs +4 -4
- package/dist/app/modules/identity/repositories/client.mjs +4 -2
- package/dist/app/modules/identity/repositories/client.mjs.map +1 -1
- package/dist/app/modules/identity/repositories/user.mjs +4 -2
- package/dist/app/modules/identity/repositories/user.mjs.map +1 -1
- package/dist/app/modules/index.mjs +21 -23
- package/dist/app/modules/logger/module.mjs +1 -1
- package/dist/app/modules/logger/module.mjs.map +1 -1
- package/dist/app/modules/mail/module.d.ts.map +1 -1
- package/dist/app/modules/mail/module.mjs.map +1 -1
- package/dist/app/modules/oauth2/constants.d.ts +2 -1
- package/dist/app/modules/oauth2/constants.d.ts.map +1 -1
- package/dist/app/modules/oauth2/constants.mjs +1 -0
- 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 +9 -4
- package/dist/app/modules/oauth2/module.mjs.map +1 -1
- package/dist/app/modules/oauth2/repositories/client/repository.mjs +4 -2
- package/dist/app/modules/oauth2/repositories/client/repository.mjs.map +1 -1
- package/dist/app/modules/oauth2/repositories/consent/repository.d.ts.map +1 -1
- package/dist/app/modules/oauth2/repositories/consent/repository.mjs +3 -2
- package/dist/app/modules/oauth2/repositories/consent/repository.mjs.map +1 -1
- package/dist/app/modules/oauth2/repositories/console-login/index.d.ts +2 -0
- package/dist/app/modules/oauth2/repositories/console-login/index.d.ts.map +1 -0
- package/dist/app/modules/oauth2/repositories/console-login/index.mjs +5 -0
- package/dist/app/modules/oauth2/repositories/console-login/store.d.ts +19 -0
- package/dist/app/modules/oauth2/repositories/console-login/store.d.ts.map +1 -0
- package/dist/app/modules/oauth2/repositories/console-login/store.mjs +47 -0
- package/dist/app/modules/oauth2/repositories/console-login/store.mjs.map +1 -0
- package/dist/app/modules/oauth2/repositories/constants.d.ts +1 -0
- package/dist/app/modules/oauth2/repositories/constants.d.ts.map +1 -1
- package/dist/app/modules/oauth2/repositories/constants.mjs +1 -0
- package/dist/app/modules/oauth2/repositories/constants.mjs.map +1 -1
- package/dist/app/modules/oauth2/repositories/index.d.ts +1 -0
- package/dist/app/modules/oauth2/repositories/index.d.ts.map +1 -1
- package/dist/app/modules/oauth2/repositories/index.mjs +3 -1
- package/dist/app/modules/oauth2/repositories/session-token/repository.d.ts +2 -2
- package/dist/app/modules/oauth2/repositories/session-token/repository.d.ts.map +1 -1
- package/dist/app/modules/oauth2/repositories/session-token/repository.mjs +5 -3
- package/dist/app/modules/oauth2/repositories/session-token/repository.mjs.map +1 -1
- package/dist/app/modules/provisioning/module.d.ts.map +1 -1
- package/dist/app/modules/provisioning/module.mjs +5 -6
- package/dist/app/modules/provisioning/module.mjs.map +1 -1
- package/dist/app/modules/provisioning/sources/composite/module.d.ts.map +1 -1
- package/dist/app/modules/provisioning/sources/composite/module.mjs +2 -1
- package/dist/app/modules/provisioning/sources/composite/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 +2 -1
- package/dist/app/modules/provisioning/sources/default/module.mjs.map +1 -1
- package/dist/app/modules/runtime/module.d.ts.map +1 -1
- package/dist/app/modules/runtime/module.mjs +2 -1
- package/dist/app/modules/runtime/module.mjs.map +1 -1
- package/dist/app/types.d.ts +16 -0
- package/dist/app/types.d.ts.map +1 -1
- package/dist/cli/commands/config.d.ts +40 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.mjs +65 -0
- package/dist/cli/commands/config.mjs.map +1 -0
- package/dist/cli/commands/healthcheck.d.ts +3 -2
- package/dist/cli/commands/healthcheck.d.ts.map +1 -1
- package/dist/cli/commands/healthcheck.mjs +6 -3
- package/dist/cli/commands/healthcheck.mjs.map +1 -1
- package/dist/cli/commands/index.d.ts +3 -0
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.mjs +3 -1
- package/dist/cli/commands/migration.d.ts +3 -10
- package/dist/cli/commands/migration.d.ts.map +1 -1
- package/dist/cli/commands/migration.mjs +17 -9
- package/dist/cli/commands/migration.mjs.map +1 -1
- package/dist/cli/commands/shutdown.d.ts +16 -0
- package/dist/cli/commands/shutdown.d.ts.map +1 -0
- package/dist/cli/commands/shutdown.mjs +41 -0
- package/dist/cli/commands/shutdown.mjs.map +1 -0
- package/dist/cli/commands/start.d.ts +3 -2
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.mjs +3 -21
- package/dist/cli/commands/start.mjs.map +1 -1
- package/dist/cli/commands/types.d.ts.map +1 -0
- package/dist/cli/index.d.ts +8 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/module.d.ts +0 -2
- package/dist/cli/module.d.ts.map +1 -1
- package/dist/cli/module.mjs +4 -3
- package/dist/cli/module.mjs.map +1 -1
- package/dist/components/oauth2-cleaner/module.d.ts +2 -2
- package/dist/components/oauth2-cleaner/module.d.ts.map +1 -1
- package/dist/components/oauth2-cleaner/module.mjs +10 -7
- package/dist/components/oauth2-cleaner/module.mjs.map +1 -1
- package/dist/core/authentication/index.mjs +2 -1
- package/dist/core/authentication/session/constants.d.ts +10 -0
- package/dist/core/authentication/session/constants.d.ts.map +1 -0
- package/dist/core/authentication/session/constants.mjs +16 -0
- package/dist/core/authentication/session/constants.mjs.map +1 -0
- package/dist/core/authentication/session/index.d.ts +1 -0
- package/dist/core/authentication/session/index.d.ts.map +1 -1
- package/dist/core/authentication/session/index.mjs +2 -1
- package/dist/core/authentication/session/module.d.ts +2 -1
- package/dist/core/authentication/session/module.d.ts.map +1 -1
- package/dist/core/authentication/session/module.mjs +7 -1
- package/dist/core/authentication/session/module.mjs.map +1 -1
- package/dist/core/authentication/session/types.d.ts +70 -1
- package/dist/core/authentication/session/types.d.ts.map +1 -1
- package/dist/core/authentication/session/types.mjs.map +1 -1
- package/dist/core/entities/client/schema.d.ts.map +1 -1
- package/dist/core/entities/client/schema.mjs +1 -2
- package/dist/core/entities/client/schema.mjs.map +1 -1
- package/dist/core/entities/client/service.d.ts.map +1 -1
- package/dist/core/entities/client/service.mjs +15 -1
- package/dist/core/entities/client/service.mjs.map +1 -1
- package/dist/core/entities/client/system-clients.d.ts +0 -5
- package/dist/core/entities/client/system-clients.d.ts.map +1 -1
- package/dist/core/entities/client/system-clients.mjs +0 -6
- package/dist/core/entities/client/system-clients.mjs.map +1 -1
- package/dist/core/entities/client/types.d.ts +12 -0
- package/dist/core/entities/client/types.d.ts.map +1 -1
- package/dist/core/entities/client-permission/service.mjs +1 -1
- package/dist/core/entities/client-permission/service.mjs.map +1 -1
- package/dist/core/entities/event/constants.d.ts +1 -6
- package/dist/core/entities/event/constants.d.ts.map +1 -1
- package/dist/core/entities/event/constants.mjs +1 -5
- package/dist/core/entities/event/constants.mjs.map +1 -1
- package/dist/core/entities/event/entity-event-handler.d.ts.map +1 -1
- package/dist/core/entities/event/entity-event-handler.mjs +3 -2
- package/dist/core/entities/event/entity-event-handler.mjs.map +1 -1
- package/dist/core/entities/event/service.d.ts.map +1 -1
- package/dist/core/entities/event/service.mjs +3 -3
- package/dist/core/entities/event/service.mjs.map +1 -1
- package/dist/core/entities/event/types.d.ts +15 -1
- package/dist/core/entities/event/types.d.ts.map +1 -1
- package/dist/core/entities/permission/service.mjs +1 -2
- package/dist/core/entities/permission/service.mjs.map +1 -1
- package/dist/core/entities/role-permission/service.mjs +1 -1
- package/dist/core/entities/role-permission/service.mjs.map +1 -1
- package/dist/core/entities/session/service.d.ts +13 -1
- package/dist/core/entities/session/service.d.ts.map +1 -1
- package/dist/core/entities/session/service.mjs +19 -16
- package/dist/core/entities/session/service.mjs.map +1 -1
- package/dist/core/entities/user/schema.d.ts.map +1 -1
- package/dist/core/entities/user/schema.mjs +1 -0
- package/dist/core/entities/user/schema.mjs.map +1 -1
- package/dist/core/entities/user/service.d.ts.map +1 -1
- package/dist/core/entities/user/service.mjs +21 -1
- package/dist/core/entities/user/service.mjs.map +1 -1
- package/dist/core/entities/user/types.d.ts +12 -0
- package/dist/core/entities/user/types.d.ts.map +1 -1
- package/dist/core/entities/user-permission/service.mjs +1 -1
- package/dist/core/entities/user-permission/service.mjs.map +1 -1
- package/dist/core/identity/permission/junction-grant.mjs +1 -1
- package/dist/core/identity/permission/junction-grant.mjs.map +1 -1
- package/dist/core/identity/provider/account/module.mjs +1 -1
- package/dist/core/identity/provider/account/module.mjs.map +1 -1
- package/dist/core/identity/provider/authentication/protocols/oauth2/assurance.mjs +1 -1
- package/dist/core/identity/provider/authentication/protocols/oauth2/assurance.mjs.map +1 -1
- package/dist/core/identity/registration/service.d.ts.map +1 -1
- package/dist/core/identity/registration/service.mjs +2 -1
- package/dist/core/identity/registration/service.mjs.map +1 -1
- package/dist/core/index.mjs +11 -3
- package/dist/core/oauth2/authorization/helpers.d.ts +14 -0
- package/dist/core/oauth2/authorization/helpers.d.ts.map +1 -1
- package/dist/core/oauth2/authorization/helpers.mjs +9 -1
- 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.mjs +1 -1
- package/dist/core/oauth2/authorization/module.mjs.map +1 -1
- package/dist/core/oauth2/backchannel-logout/constants.d.ts +16 -0
- package/dist/core/oauth2/backchannel-logout/constants.d.ts.map +1 -0
- package/dist/core/oauth2/backchannel-logout/constants.mjs +20 -0
- package/dist/core/oauth2/backchannel-logout/constants.mjs.map +1 -0
- package/dist/core/oauth2/backchannel-logout/index.d.ts +4 -0
- package/dist/core/oauth2/backchannel-logout/index.d.ts.map +1 -0
- package/dist/core/oauth2/backchannel-logout/index.mjs +6 -0
- package/dist/core/oauth2/backchannel-logout/module.d.ts +26 -0
- package/dist/core/oauth2/backchannel-logout/module.d.ts.map +1 -0
- package/dist/core/oauth2/backchannel-logout/module.mjs +78 -0
- package/dist/core/oauth2/backchannel-logout/module.mjs.map +1 -0
- package/dist/core/oauth2/backchannel-logout/types.d.ts +29 -0
- package/dist/core/oauth2/backchannel-logout/types.d.ts.map +1 -0
- package/dist/core/oauth2/console-login/constants.d.ts +19 -0
- package/dist/core/oauth2/console-login/constants.d.ts.map +1 -0
- package/dist/core/oauth2/console-login/constants.mjs +24 -0
- package/dist/core/oauth2/console-login/constants.mjs.map +1 -0
- package/dist/core/oauth2/console-login/index.d.ts +3 -0
- package/dist/core/oauth2/console-login/index.d.ts.map +1 -0
- package/dist/core/oauth2/console-login/index.mjs +5 -0
- package/dist/core/oauth2/console-login/types.d.ts +53 -0
- package/dist/core/oauth2/console-login/types.d.ts.map +1 -0
- package/dist/core/oauth2/end-session/service.mjs +1 -1
- package/dist/core/oauth2/end-session/service.mjs.map +1 -1
- package/dist/core/oauth2/federated-login/module.mjs +3 -3
- package/dist/core/oauth2/federated-login/module.mjs.map +1 -1
- package/dist/core/oauth2/index.d.ts +4 -0
- package/dist/core/oauth2/index.d.ts.map +1 -1
- package/dist/core/oauth2/index.mjs +13 -3
- package/dist/core/oauth2/introspection/index.d.ts +3 -0
- package/dist/core/oauth2/introspection/index.d.ts.map +1 -0
- package/dist/core/oauth2/introspection/index.mjs +5 -0
- package/dist/core/oauth2/introspection/module.d.ts +14 -0
- package/dist/core/oauth2/introspection/module.d.ts.map +1 -0
- package/dist/core/oauth2/introspection/module.mjs +49 -0
- package/dist/core/oauth2/introspection/module.mjs.map +1 -0
- package/dist/core/oauth2/introspection/types.d.ts +45 -0
- package/dist/core/oauth2/introspection/types.d.ts.map +1 -0
- package/dist/core/oauth2/introspection/types.mjs +4 -0
- package/dist/core/oauth2/openid/claims.d.ts +20 -2
- package/dist/core/oauth2/openid/claims.d.ts.map +1 -1
- package/dist/core/oauth2/openid/claims.mjs +18 -4
- package/dist/core/oauth2/openid/claims.mjs.map +1 -1
- package/dist/core/oauth2/session-credential/constants.d.ts +30 -0
- package/dist/core/oauth2/session-credential/constants.d.ts.map +1 -0
- package/dist/core/oauth2/session-credential/constants.mjs +34 -0
- package/dist/core/oauth2/session-credential/constants.mjs.map +1 -0
- package/dist/core/oauth2/session-credential/index.d.ts +3 -0
- package/dist/core/oauth2/session-credential/index.d.ts.map +1 -0
- package/dist/core/oauth2/session-credential/index.mjs +6 -0
- package/dist/core/oauth2/session-credential/module.d.ts +31 -0
- package/dist/core/oauth2/session-credential/module.d.ts.map +1 -0
- package/dist/core/oauth2/session-credential/module.mjs +43 -0
- package/dist/core/oauth2/session-credential/module.mjs.map +1 -0
- package/dist/core/oauth2/session-token/constants.d.ts +10 -0
- package/dist/core/oauth2/session-token/constants.d.ts.map +1 -0
- package/dist/core/oauth2/session-token/constants.mjs +16 -0
- package/dist/core/oauth2/session-token/constants.mjs.map +1 -0
- package/dist/core/oauth2/session-token/index.d.ts +1 -0
- package/dist/core/oauth2/session-token/index.d.ts.map +1 -1
- package/dist/core/oauth2/session-token/index.mjs +2 -1
- package/dist/core/oauth2/session-token/types.d.ts +13 -2
- package/dist/core/oauth2/session-token/types.d.ts.map +1 -1
- package/dist/core/provisioning/merge/module.mjs +5 -3
- package/dist/core/provisioning/merge/module.mjs.map +1 -1
- package/dist/core/query/module.mjs +1 -1
- package/dist/core/query/module.mjs.map +1 -1
- package/dist/core/security/policy/evaluator.mjs +1 -1
- package/dist/core/security/policy/evaluator.mjs.map +1 -1
- package/dist/index.mjs +62 -59
- package/dist/path.mjs +1 -1
- package/dist/swagger.json +466 -104
- package/dist/utils/error.d.ts +6 -0
- package/dist/utils/error.d.ts.map +1 -1
- package/dist/utils/error.mjs +6 -2
- package/dist/utils/error.mjs.map +1 -1
- package/dist/utils/index.mjs +2 -2
- package/package.json +31 -25
- package/dist/adapters/http/middleware/built-in/assets.d.ts +0 -11
- package/dist/adapters/http/middleware/built-in/assets.d.ts.map +0 -1
- package/dist/adapters/http/middleware/built-in/assets.mjs +0 -91
- package/dist/adapters/http/middleware/built-in/assets.mjs.map +0 -1
- package/dist/adapters/http/middleware/built-in/theme.d.ts +0 -15
- package/dist/adapters/http/middleware/built-in/theme.d.ts.map +0 -1
- package/dist/adapters/http/middleware/built-in/theme.mjs +0 -27
- package/dist/adapters/http/middleware/built-in/theme.mjs.map +0 -1
- package/dist/adapters/http/middleware/built-in/types.d.ts +0 -14
- package/dist/adapters/http/middleware/built-in/types.d.ts.map +0 -1
- package/dist/adapters/http/middleware/built-in/ui-http-client.d.ts +0 -15
- package/dist/adapters/http/middleware/built-in/ui-http-client.d.ts.map +0 -1
- package/dist/adapters/http/middleware/built-in/ui-http-client.mjs +0 -25
- package/dist/adapters/http/middleware/built-in/ui-http-client.mjs.map +0 -1
- package/dist/adapters/http/request/helpers/redirect.d.ts +0 -14
- package/dist/adapters/http/request/helpers/redirect.d.ts.map +0 -1
- package/dist/adapters/http/request/helpers/redirect.mjs +0 -36
- package/dist/adapters/http/request/helpers/redirect.mjs.map +0 -1
- package/dist/adapters/http/ui/account-console/index.d.ts +0 -4
- package/dist/adapters/http/ui/account-console/index.d.ts.map +0 -1
- package/dist/adapters/http/ui/account-console/index.mjs +0 -6
- package/dist/adapters/http/ui/account-console/module.d.ts +0 -28
- package/dist/adapters/http/ui/account-console/module.d.ts.map +0 -1
- package/dist/adapters/http/ui/account-console/module.mjs +0 -80
- package/dist/adapters/http/ui/account-console/module.mjs.map +0 -1
- package/dist/adapters/http/ui/account-console/ref.d.ts +0 -30
- package/dist/adapters/http/ui/account-console/ref.d.ts.map +0 -1
- package/dist/adapters/http/ui/account-console/ref.mjs +0 -50
- package/dist/adapters/http/ui/account-console/ref.mjs.map +0 -1
- package/dist/adapters/http/ui/account-console/types.d.ts +0 -11
- package/dist/adapters/http/ui/account-console/types.d.ts.map +0 -1
- package/dist/adapters/http/ui/auth-console/http-client.d.ts +0 -22
- package/dist/adapters/http/ui/auth-console/http-client.d.ts.map +0 -1
- package/dist/adapters/http/ui/auth-console/http-client.mjs.map +0 -1
- package/dist/adapters/http/ui/auth-console/index.d.ts +0 -6
- package/dist/adapters/http/ui/auth-console/index.d.ts.map +0 -1
- package/dist/adapters/http/ui/auth-console/index.mjs +0 -8
- package/dist/adapters/http/ui/auth-console/module.d.ts +0 -4
- package/dist/adapters/http/ui/auth-console/module.d.ts.map +0 -1
- package/dist/adapters/http/ui/auth-console/module.mjs +0 -73
- package/dist/adapters/http/ui/auth-console/module.mjs.map +0 -1
- package/dist/adapters/http/ui/auth-console/resolve.d.ts +0 -21
- package/dist/adapters/http/ui/auth-console/resolve.d.ts.map +0 -1
- package/dist/adapters/http/ui/auth-console/resolve.mjs +0 -53
- package/dist/adapters/http/ui/auth-console/resolve.mjs.map +0 -1
- package/dist/adapters/http/ui/auth-console/serve.d.ts +0 -9
- package/dist/adapters/http/ui/auth-console/serve.d.ts.map +0 -1
- package/dist/adapters/http/ui/auth-console/serve.mjs +0 -35
- package/dist/adapters/http/ui/auth-console/serve.mjs.map +0 -1
- package/dist/adapters/http/ui/auth-console/types.d.ts +0 -26
- package/dist/adapters/http/ui/auth-console/types.d.ts.map +0 -1
- package/dist/adapters/http/ui/console-packages/index.d.ts.map +0 -1
- package/dist/adapters/http/ui/console-packages/index.mjs +0 -5
- package/dist/adapters/http/ui/console-packages/module.d.ts +0 -33
- package/dist/adapters/http/ui/console-packages/module.d.ts.map +0 -1
- package/dist/adapters/http/ui/console-packages/module.mjs +0 -70
- package/dist/adapters/http/ui/console-packages/module.mjs.map +0 -1
- package/dist/adapters/http/ui/console-packages/types.d.ts +0 -12
- package/dist/adapters/http/ui/console-packages/types.d.ts.map +0 -1
- package/dist/adapters/http/ui/index.d.ts +0 -6
- package/dist/adapters/http/ui/index.d.ts.map +0 -1
- package/dist/adapters/http/ui/index.mjs +0 -25
- package/dist/adapters/http/ui/shared/html.d.ts +0 -76
- package/dist/adapters/http/ui/shared/html.d.ts.map +0 -1
- package/dist/adapters/http/ui/shared/html.mjs +0 -104
- package/dist/adapters/http/ui/shared/html.mjs.map +0 -1
- package/dist/adapters/http/ui/shared/index.d.ts +0 -2
- package/dist/adapters/http/ui/shared/index.d.ts.map +0 -1
- package/dist/adapters/http/ui/shared/index.mjs +0 -5
- package/dist/adapters/http/ui/theme/apply.d.ts +0 -12
- package/dist/adapters/http/ui/theme/apply.d.ts.map +0 -1
- package/dist/adapters/http/ui/theme/apply.mjs +0 -29
- package/dist/adapters/http/ui/theme/apply.mjs.map +0 -1
- package/dist/adapters/http/ui/theme/assets.d.ts +0 -20
- package/dist/adapters/http/ui/theme/assets.d.ts.map +0 -1
- package/dist/adapters/http/ui/theme/assets.mjs +0 -86
- package/dist/adapters/http/ui/theme/assets.mjs.map +0 -1
- package/dist/adapters/http/ui/theme/constants.d.ts +0 -16
- package/dist/adapters/http/ui/theme/constants.d.ts.map +0 -1
- package/dist/adapters/http/ui/theme/constants.mjs +0 -20
- package/dist/adapters/http/ui/theme/constants.mjs.map +0 -1
- package/dist/adapters/http/ui/theme/contract/constants.d.ts +0 -120
- package/dist/adapters/http/ui/theme/contract/constants.d.ts.map +0 -1
- package/dist/adapters/http/ui/theme/contract/constants.mjs +0 -136
- package/dist/adapters/http/ui/theme/contract/constants.mjs.map +0 -1
- package/dist/adapters/http/ui/theme/contract/head.d.ts +0 -12
- package/dist/adapters/http/ui/theme/contract/head.d.ts.map +0 -1
- package/dist/adapters/http/ui/theme/contract/head.mjs +0 -61
- package/dist/adapters/http/ui/theme/contract/head.mjs.map +0 -1
- package/dist/adapters/http/ui/theme/contract/index.d.ts +0 -6
- package/dist/adapters/http/ui/theme/contract/index.d.ts.map +0 -1
- package/dist/adapters/http/ui/theme/contract/index.mjs +0 -8
- package/dist/adapters/http/ui/theme/contract/manifest.d.ts +0 -25
- package/dist/adapters/http/ui/theme/contract/manifest.d.ts.map +0 -1
- package/dist/adapters/http/ui/theme/contract/manifest.mjs +0 -77
- package/dist/adapters/http/ui/theme/contract/manifest.mjs.map +0 -1
- package/dist/adapters/http/ui/theme/contract/types.d.ts +0 -26
- package/dist/adapters/http/ui/theme/contract/types.d.ts.map +0 -1
- package/dist/adapters/http/ui/theme/contract/utils.d.ts +0 -11
- package/dist/adapters/http/ui/theme/contract/utils.d.ts.map +0 -1
- package/dist/adapters/http/ui/theme/contract/utils.mjs +0 -22
- package/dist/adapters/http/ui/theme/contract/utils.mjs.map +0 -1
- package/dist/adapters/http/ui/theme/index.d.ts +0 -7
- package/dist/adapters/http/ui/theme/index.d.ts.map +0 -1
- package/dist/adapters/http/ui/theme/index.mjs +0 -13
- package/dist/adapters/http/ui/theme/module.d.ts +0 -79
- package/dist/adapters/http/ui/theme/module.d.ts.map +0 -1
- package/dist/adapters/http/ui/theme/module.mjs +0 -206
- package/dist/adapters/http/ui/theme/module.mjs.map +0 -1
- package/dist/adapters/http/ui/theme/types.d.ts +0 -42
- package/dist/adapters/http/ui/theme/types.d.ts.map +0 -1
- package/dist/app/modules/config/helpers.d.ts +0 -9
- package/dist/app/modules/config/helpers.d.ts.map +0 -1
- package/dist/app/modules/config/helpers.mjs +0 -22
- package/dist/app/modules/config/helpers.mjs.map +0 -1
- package/dist/app/modules/config/normalize.d.ts +0 -3
- package/dist/app/modules/config/normalize.d.ts.map +0 -1
- package/dist/app/modules/config/normalize.mjs +0 -117
- package/dist/app/modules/config/normalize.mjs.map +0 -1
- package/dist/app/modules/config/origins.d.ts +0 -25
- package/dist/app/modules/config/origins.d.ts.map +0 -1
- package/dist/app/modules/config/origins.mjs +0 -46
- package/dist/app/modules/config/origins.mjs.map +0 -1
- package/dist/app/modules/config/read/env.d.ts +0 -3
- package/dist/app/modules/config/read/env.d.ts.map +0 -1
- package/dist/app/modules/config/read/env.mjs +0 -139
- package/dist/app/modules/config/read/env.mjs.map +0 -1
- package/dist/app/modules/config/read/fs.d.ts +0 -3
- package/dist/app/modules/config/read/fs.d.ts.map +0 -1
- package/dist/app/modules/config/read/fs.mjs +0 -60
- package/dist/app/modules/config/read/fs.mjs.map +0 -1
- package/dist/app/modules/config/read/index.d.ts +0 -5
- package/dist/app/modules/config/read/index.d.ts.map +0 -1
- package/dist/app/modules/config/read/index.mjs +0 -7
- package/dist/app/modules/config/read/module.d.ts +0 -4
- package/dist/app/modules/config/read/module.d.ts.map +0 -1
- package/dist/app/modules/config/read/module.mjs +0 -29
- package/dist/app/modules/config/read/module.mjs.map +0 -1
- package/dist/app/modules/config/read/types.d.ts +0 -9
- package/dist/app/modules/config/read/types.d.ts.map +0 -1
- package/dist/app/modules/config/trust-proxy.d.ts +0 -28
- package/dist/app/modules/config/trust-proxy.d.ts.map +0 -1
- package/dist/app/modules/config/trust-proxy.mjs +0 -64
- package/dist/app/modules/config/trust-proxy.mjs.map +0 -1
- package/dist/cli/config.d.ts +0 -18
- package/dist/cli/config.d.ts.map +0 -1
- package/dist/cli/config.mjs +0 -34
- package/dist/cli/config.mjs.map +0 -1
- package/dist/cli/types.d.ts.map +0 -1
- package/dist/utils/host.d.ts +0 -2
- package/dist/utils/host.d.ts.map +0 -1
- package/dist/utils/host.mjs +0 -12
- package/dist/utils/host.mjs.map +0 -1
- /package/dist/adapters/http/{middleware/built-in → controllers/workflows/account}/types.mjs +0 -0
- /package/dist/adapters/http/{ui/console-packages → controllers/workflows/admin}/index.d.ts +0 -0
- /package/dist/adapters/http/{ui/account-console → controllers/workflows/admin}/types.mjs +0 -0
- /package/dist/adapters/http/{ui/auth-console → controllers/workflows/console-login}/types.mjs +0 -0
- /package/dist/adapters/http/{ui/console-packages → internal-client}/types.mjs +0 -0
- /package/dist/{adapters/http/ui/theme/contract → app/modules/components}/types.mjs +0 -0
- /package/dist/cli/{types.d.ts → commands/types.d.ts} +0 -0
- /package/dist/{adapters/http/ui/theme → cli/commands}/types.mjs +0 -0
- /package/dist/{app/modules/config/read → core/oauth2/backchannel-logout}/types.mjs +0 -0
- /package/dist/{cli → core/oauth2/console-login}/types.mjs +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.mjs","names":["OAuth2Authorization","OAuth2AuthorizationCodeRequestValidator","readFromLocations","useRequestIdentityOrFail","useRequestSessionId","HTTPOAuth2Authorizer","codeRequestVerifier","requestValidator","consentService","logger","ctx","authorizeWithRequest","event","codeRequestValidated","validateWithRequest","data","client","redirectUriVerified","verify","identity","result","authorize","raw","sessionId","builtIn","record","clientId","id","realmId","owner","sub","subKind","type","scope","e","warn","error","run"],"sources":["../../../../../../src/adapters/http/adapters/oauth2/authorization/module.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 { IAppEvent } from 'routup';\nimport type { Logger } from '@authup/server-kit';\nimport type { OAuth2AuthorizationCodeRequest } from '@authup/core-kit';\nimport type { IConsentService, IOAuth2AuthorizationCodeRequestVerifier, OAuth2AuthorizationResult } from '../../../../../core/index.ts';\nimport { OAuth2Authorization, OAuth2AuthorizationCodeRequestValidator } from '../../../../../core/index.ts';\nimport { readFromLocations, useRequestIdentityOrFail, useRequestSessionId } from '../../../request/index.ts';\nimport type { HTTPOAuth2AuthorizationManagerContext } from './types.ts';\n\nexport class HTTPOAuth2Authorizer extends OAuth2Authorization {\n protected codeRequestVerifier : IOAuth2AuthorizationCodeRequestVerifier;\n\n protected requestValidator : OAuth2AuthorizationCodeRequestValidator;\n\n protected consentService? : IConsentService;\n\n protected logger? : Logger;\n\n constructor(ctx: HTTPOAuth2AuthorizationManagerContext) {\n super(ctx);\n\n this.codeRequestVerifier = ctx.codeRequestVerifier;\n this.consentService = ctx.consentService;\n this.logger = ctx.logger;\n\n this.requestValidator = new OAuth2AuthorizationCodeRequestValidator();\n }\n\n async authorizeWithRequest(event: IAppEvent) : Promise<OAuth2AuthorizationResult> {\n const codeRequestValidated = await this.validateWithRequest(event);\n\n const {\n data,\n client,\n redirectUriVerified,\n } = await this.codeRequestVerifier.verify(codeRequestValidated);\n\n const identity = useRequestIdentityOrFail(event);\n\n const result = await this.authorize(data, identity.raw, {\n sessionId: useRequestSessionId(event),\n client,\n redirectUriVerified,\n });\n\n // Persisted per-scope consent (plan 055): recorded only after a\n // successful approval — an access-policy denial throws inside\n // authorize() above, so a denied identity never writes a row.\n // built_in clients keep zero rows (locked); insert-missing makes\n // re-recording idempotent (union/keep).\n if (this.consentService &&
|
|
1
|
+
{"version":3,"file":"module.mjs","names":["OAuth2Authorization","OAuth2AuthorizationCodeRequestValidator","readFromLocations","useRequestIdentityOrFail","useRequestSessionId","HTTPOAuth2Authorizer","codeRequestVerifier","requestValidator","consentService","logger","ctx","authorizeWithRequest","event","codeRequestValidated","validateWithRequest","data","client","redirectUriVerified","verify","identity","result","authorize","raw","sessionId","builtIn","record","clientId","id","realmId","owner","sub","subKind","type","scope","e","warn","error","run"],"sources":["../../../../../../src/adapters/http/adapters/oauth2/authorization/module.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 { IAppEvent } from 'routup';\nimport type { Logger } from '@authup/server-kit';\nimport type { OAuth2AuthorizationCodeRequest } from '@authup/core-kit';\nimport type { IConsentService, IOAuth2AuthorizationCodeRequestVerifier, OAuth2AuthorizationResult } from '../../../../../core/index.ts';\nimport { OAuth2Authorization, OAuth2AuthorizationCodeRequestValidator } from '../../../../../core/index.ts';\nimport { readFromLocations, useRequestIdentityOrFail, useRequestSessionId } from '../../../request/index.ts';\nimport type { HTTPOAuth2AuthorizationManagerContext } from './types.ts';\n\nexport class HTTPOAuth2Authorizer extends OAuth2Authorization {\n protected codeRequestVerifier : IOAuth2AuthorizationCodeRequestVerifier;\n\n protected requestValidator : OAuth2AuthorizationCodeRequestValidator;\n\n protected consentService? : IConsentService;\n\n protected logger? : Logger;\n\n constructor(ctx: HTTPOAuth2AuthorizationManagerContext) {\n super(ctx);\n\n this.codeRequestVerifier = ctx.codeRequestVerifier;\n this.consentService = ctx.consentService;\n this.logger = ctx.logger;\n\n this.requestValidator = new OAuth2AuthorizationCodeRequestValidator();\n }\n\n async authorizeWithRequest(event: IAppEvent) : Promise<OAuth2AuthorizationResult> {\n const codeRequestValidated = await this.validateWithRequest(event);\n\n const {\n data,\n client,\n redirectUriVerified,\n } = await this.codeRequestVerifier.verify(codeRequestValidated);\n\n const identity = useRequestIdentityOrFail(event);\n\n const result = await this.authorize(data, identity.raw, {\n sessionId: useRequestSessionId(event),\n client,\n redirectUriVerified,\n });\n\n // Persisted per-scope consent (plan 055): recorded only after a\n // successful approval — an access-policy denial throws inside\n // authorize() above, so a denied identity never writes a row.\n // built_in clients keep zero rows (locked); insert-missing makes\n // re-recording idempotent (union/keep).\n if (client && this.consentService && !client.builtIn) {\n try {\n await this.consentService.record({\n clientId: client.id,\n realmId: client.realmId,\n owner: {\n sub: identity.raw.data.id,\n subKind: identity.raw.type,\n },\n scope: data.scope ?? null,\n });\n } catch (e) {\n // never fail an issued code over a consent-write failure\n this.logger?.warn('Recording the OAuth2 consent grant failed.', {\n clientId: client.id,\n error: e,\n });\n }\n }\n\n return result;\n }\n\n /**\n * Validate authorization request.\n *\n * @throws OAuth2Error\n */\n async validateWithRequest(\n event: IAppEvent,\n ) : Promise<OAuth2AuthorizationCodeRequest> {\n const data = await readFromLocations(event, ['body', 'query']);\n return this.requestValidator.run(data);\n }\n}\n"],"mappings":";;;;;;;;;;;AAeA,IAAaK,uBAAb,cAA0CL,oBAAAA;CAC5BM;CAEAC;CAEAC;CAEAC;CAEV,YAAYC,KAA4C;EACpD,MAAMA,GAAAA;EAEN,KAAKJ,sBAAsBI,IAAIJ;EAC/B,KAAKE,iBAAiBE,IAAIF;EAC1B,KAAKC,SAASC,IAAID;EAElB,KAAKF,mBAAmB,IAAIN,wCAAAA;CAChC;CAEA,MAAMU,qBAAqBC,OAAuD;EAC9E,MAAMC,uBAAuB,MAAM,KAAKC,oBAAoBF,KAAAA;EAE5D,MAAM,EACFG,MACAC,QACAC,wBACA,MAAM,KAAKX,oBAAoBY,OAAOL,oBAAAA;EAE1C,MAAMM,WAAWhB,yBAAyBS,KAAAA;EAE1C,MAAMQ,SAAS,MAAM,KAAKC,UAAUN,MAAMI,SAASG,KAAK;GACpDC,WAAWnB,oBAAoBQ,KAAAA;GAC/BI;GACAC;EACJ,CAAA;EAOA,IAAID,UAAU,KAAKR,kBAAkB,CAACQ,OAAOQ,SACzC,IAAI;GACA,MAAM,KAAKhB,eAAeiB,OAAO;IAC7BC,UAAUV,OAAOW;IACjBC,SAASZ,OAAOY;IAChBC,OAAO;KACHC,KAAKX,SAASG,IAAIP,KAAKY;KACvBI,SAASZ,SAASG,IAAIU;IAC1B;IACAC,OAAOlB,KAAKkB,SAAS;GACzB,CAAA;EACJ,SAASC,GAAG;GAER,KAAKzB,QAAQ0B,KAAK,8CAA8C;IAC5DT,UAAUV,OAAOW;IACjBS,OAAOF;GACX,CAAA;EACJ;EAGJ,OAAOd;CACX;;;;;IAOA,MAAMN,oBACFF,OACwC;EACxC,MAAMG,OAAO,MAAMb,kBAAkBU,OAAO,CAAC,QAAQ,OAAQ,CAAA;EAC7D,OAAO,KAAKL,iBAAiB8B,IAAItB,IAAAA;CACrC;AACJ"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The path segments the served consoles live under. Each is spelled ONCE:
|
|
3
|
+
* the controller mount, the login cookie scope, the callback URL, the asset
|
|
4
|
+
* mount and the shell's rebased vite base all derive from it, so a move
|
|
5
|
+
* cannot drift the login flow away from the page. The vite `base` in each
|
|
6
|
+
* console workspace is a hand-synced literal (a vite config cannot import a
|
|
7
|
+
* server constant); the page specs catch a bundle built against another.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ADMIN_CONSOLE_SEGMENT = "console/admin";
|
|
10
|
+
export declare const ACCOUNT_CONSOLE_SEGMENT = "console/account";
|
|
11
|
+
/**
|
|
12
|
+
* The auth console's namespace, under which ONLY its assets are mounted
|
|
13
|
+
* (`<segment>/assets`, the same shape as the two static consoles). Its
|
|
14
|
+
* PAGES stay on their protocol routes (`/authorize`, `/logout`, the
|
|
15
|
+
* workflow paths), so `/console/auth` itself serves nothing.
|
|
16
|
+
*/
|
|
17
|
+
export declare const AUTH_CONSOLE_SEGMENT = "console/auth";
|
|
18
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/adapters/http/constants.ts"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,kBAAkB,CAAC;AAErD,eAAO,MAAM,uBAAuB,oBAAoB,CAAC;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
//#region src/adapters/http/constants.ts
|
|
5
|
+
/**
|
|
6
|
+
* The path segments the served consoles live under. Each is spelled ONCE:
|
|
7
|
+
* the controller mount, the login cookie scope, the callback URL, the asset
|
|
8
|
+
* mount and the shell's rebased vite base all derive from it, so a move
|
|
9
|
+
* cannot drift the login flow away from the page. The vite `base` in each
|
|
10
|
+
* console workspace is a hand-synced literal (a vite config cannot import a
|
|
11
|
+
* server constant); the page specs catch a bundle built against another.
|
|
12
|
+
*/ const ADMIN_CONSOLE_SEGMENT = "console/admin";
|
|
13
|
+
const ACCOUNT_CONSOLE_SEGMENT = "console/account";
|
|
14
|
+
/**
|
|
15
|
+
* The auth console's namespace, under which ONLY its assets are mounted
|
|
16
|
+
* (`<segment>/assets`, the same shape as the two static consoles). Its
|
|
17
|
+
* PAGES stay on their protocol routes (`/authorize`, `/logout`, the
|
|
18
|
+
* workflow paths), so `/console/auth` itself serves nothing.
|
|
19
|
+
*/ const AUTH_CONSOLE_SEGMENT = "console/auth";
|
|
20
|
+
//#endregion
|
|
21
|
+
export { ACCOUNT_CONSOLE_SEGMENT, ADMIN_CONSOLE_SEGMENT, AUTH_CONSOLE_SEGMENT };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.mjs","names":["ADMIN_CONSOLE_SEGMENT","ACCOUNT_CONSOLE_SEGMENT","AUTH_CONSOLE_SEGMENT"],"sources":["../../../src/adapters/http/constants.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\n/**\n * The path segments the served consoles live under. Each is spelled ONCE:\n * the controller mount, the login cookie scope, the callback URL, the asset\n * mount and the shell's rebased vite base all derive from it, so a move\n * cannot drift the login flow away from the page. The vite `base` in each\n * console workspace is a hand-synced literal (a vite config cannot import a\n * server constant); the page specs catch a bundle built against another.\n */\nexport const ADMIN_CONSOLE_SEGMENT = 'console/admin';\n\nexport const ACCOUNT_CONSOLE_SEGMENT = 'console/account';\n\n/**\n * The auth console's namespace, under which ONLY its assets are mounted\n * (`<segment>/assets`, the same shape as the two static consoles). Its\n * PAGES stay on their protocol routes (`/authorize`, `/logout`, the\n * workflow paths), so `/console/auth` itself serves nothing.\n */\nexport const AUTH_CONSOLE_SEGMENT = 'console/auth';\n"],"mappings":";;;;;;;;;;;GAeA,MAAaA,wBAAwB;AAErC,MAAaC,0BAA0B;;;;;;GAQvC,MAAaC,uBAAuB"}
|
|
@@ -5,10 +5,10 @@ import { RECORD_QUERY_PARAMETERS, describeQuerySchema } from "../../../../../cor
|
|
|
5
5
|
import { identityProviderSchema } from "../../../../../core/entities/identity-provider/schema.mjs";
|
|
6
6
|
import { decodeQuery } from "../../../../../core/query/module.mjs";
|
|
7
7
|
import { OAuth2AuthorizationCodeRequestValidator } from "../../../../../core/oauth2/authorization/code-request/validator.mjs";
|
|
8
|
-
import { OAUTH2_FEDERATED_LOGIN_COOKIE, OAUTH2_FEDERATED_LOGIN_TTL } from "../../../../../core/oauth2/federated-login/constants.mjs";
|
|
9
8
|
import { describeError } from "../../../../../utils/error.mjs";
|
|
10
9
|
import { resolveURL } from "../../../../../utils/url.mjs";
|
|
11
10
|
import "../../../../../utils/index.mjs";
|
|
11
|
+
import { OAUTH2_FEDERATED_LOGIN_COOKIE, OAUTH2_FEDERATED_LOGIN_TTL } from "../../../../../core/oauth2/federated-login/constants.mjs";
|
|
12
12
|
import { createIdentityProviderOAuth2Authenticator } from "../../../../../core/identity/provider/authentication/factory.mjs";
|
|
13
13
|
import "../../../../../core/index.mjs";
|
|
14
14
|
import { useRequestPermissionEvaluator } from "../../../request/permission/helper.mjs";
|
|
@@ -184,7 +184,7 @@ var IdentityProviderController = class {
|
|
|
184
184
|
if (link) return this.completeLink(event, entity, data, link);
|
|
185
185
|
if (!data.codeRequest) throw OAuth2RequestError.malformed("The state carries no authorization code request.");
|
|
186
186
|
const browserNonce = useRequestCookie(event, OAUTH2_FEDERATED_LOGIN_COOKIE);
|
|
187
|
-
if (
|
|
187
|
+
if (typeof browserNonce !== "string" || !data.browserNonce || browserNonce !== data.browserNonce) return sendRedirect(event, this.buildHostedAuthorizeURL(data.codeRequest).href);
|
|
188
188
|
const { code, error } = useRequestQuery(event);
|
|
189
189
|
if (typeof error === "string" && error.length > 0) {
|
|
190
190
|
this.logger?.info(`The identity provider ${entity.id} answered the authorization with ${JSON.stringify(error.slice(0, 64))}.`);
|
|
@@ -294,7 +294,7 @@ var IdentityProviderController = class {
|
|
|
294
294
|
* running the login path. No auth code and no session is minted; the
|
|
295
295
|
* browser lands back on the account console with a marker param.
|
|
296
296
|
*/ async completeLink(event, provider, state, link) {
|
|
297
|
-
const url = new URL(resolveURL(this.options.
|
|
297
|
+
const url = new URL(resolveURL(this.options.accountConsoleUrl, "connected-accounts"));
|
|
298
298
|
const { code } = useRequestQuery(event);
|
|
299
299
|
try {
|
|
300
300
|
if (link.providerId !== provider.id || !provider.enabled) throw new BadRequestError("The identity provider is not available for account linking.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.mjs","names":["BuiltInPolicyType","definePolicyData","ValidatorGroup","base64URLDecode","createNanoID","getURLBasePath","isObject","isUUID","DBody","DContext","DController","DDelete","DGet","DPath","DPost","DPut","DTags","getRequestHeader","getRequestIP","sendRedirect","EventName","EventRefType","EventScope","IdentityProviderAttributesValidator","IdentityProviderValidator","IdentityType","PermissionName","isOAuth2IdentityProvider","isOpenIDIdentityProvider","BadRequestError","EntityNotFoundError","describeError","resolveURL","useRequestQuery","setResponseCookie","unsetResponseCookie","useRequestCookie","readRequestBody","OAuth2RequestError","IDENTITY_PROVIDER_LOGIN_NOT_PENDING","URL","OAUTH2_FEDERATED_LOGIN_COOKIE","OAUTH2_FEDERATED_LOGIN_TTL","OAuth2AuthorizationCodeRequestValidator","RECORD_QUERY_PARAMETERS","createIdentityProviderOAuth2Authenticator","decodeQuery","describeQuerySchema","identityProviderSchema","applyRouteRealmIDToBody","buildActorContext","getBodyRealmID","getRequestParamID","getRequestRealmID","useRequestEventContext","useRequestIdentityOrFail","useRequestParamID","useRequestPermissionEvaluator","ForceLoggedInMiddleware","IdentityProviderController","options","repository","accountManager","linkStore","codeRequestVerifier","codeRequestValidator","stateManager","loginService","eventService","logger","ctx","getProviders","event","data","meta","findMany","schema","actor","getProvider","id","paramId","entity","findOneByIdOrName","evaluateOneOf","name","IDENTITY_PROVIDER_READ","IDENTITY_PROVIDER_UPDATE","IDENTITY_PROVIDER_DELETE","ATTRIBUTES","REALM_MATCH","realmId","editProvider","user","write","updateOnly","put","dropProvider","permissionEvaluator","preEvaluate","findOneBy","evaluate","entityId","remove","response","status","addProvider","authorizeOut","_id","resolve","enabled","query","codeRequest","malformed","codeRequestDecoded","JSON","parse","codeRequestValidated","run","verify","client","authenticator","buildProviderAuthenticator","browserNonce","setFederatedLoginCookie","state","saveAuthorizationState","buildRedirectURL","linkRequest","identity","type","USER","link","userId","providerId","url","authorizeIn","Error","protocol","verifyAuthorizationState","completeLink","buildHostedAuthorizeURL","href","code","error","length","info","stringify","slice","result","complete","provider","request","ipAddress","userAgent","kind","searchParams","set","pendingLoginId","completeLogin","assertSameOrigin","message","reason","path","buildFederatedLoginCookiePath","completeHandoff","group","body","where","UPDATE","IDENTITY_PROVIDER_CREATE","CREATE","validator","attributesValidator","attributes","validateJoinColumns","checkUniqueness","undefined","keepAll","merge","saveWithEA","create","baseURL","resolveIdentity","handle","save","providerUserId","providerUserName","pickIdentityCandidate","providerUserEmail","e","confirmLink","_data","consume","account","attributeCandidates","email","requestContext","record","scope","IDENTITY","IDENTITY_PROVIDER_LINKED","refType","IDENTITY_PROVIDER_ACCOUNT","refId","userRealmId","actorType","actorId","actorName","sessionId","requestPath","requestMethod","requestIpAddress","requestUserAgent","providerName","key","candidates","candidate","codeRequestKeys","Object","keys","codeRequestKey_","codeRequestKey","codeRequestValue","String","findOneById","clientId","value","httpOnly","sameSite","secure","maxAge","origin","ip","stateInvalid"],"sources":["../../../../../../src/adapters/http/controllers/entities/identity-provider/module.ts"],"sourcesContent":["/*\n * Copyright (c) 2022.\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 { BuiltInPolicyType, definePolicyData } from '@authup/access';\nimport {\n ValidatorGroup,\n base64URLDecode,\n createNanoID,\n getURLBasePath,\n isObject,\n isUUID,\n} from '@authup/kit';\nimport {\n DBody,\n DContext,\n DController,\n DDelete,\n DGet,\n DPath,\n DPost,\n DPut,\n DTags,\n} from '@routup/decorators';\nimport type { IAppEvent } from 'routup';\nimport {\n getRequestHeader,\n getRequestIP,\n sendRedirect,\n} from 'routup';\nimport type {\n IdentityProvider,\n IdentityProviderAccount,\n OAuth2AuthorizationCodeRequest,\n OAuth2IdentityProvider,\n OpenIDIdentityProvider,\n} from '@authup/core-kit';\nimport {\n EventName,\n EventRefType,\n EventScope,\n IdentityProviderAttributesValidator,\n IdentityProviderValidator,\n IdentityType,\n PermissionName,\n isOAuth2IdentityProvider,\n isOpenIDIdentityProvider,\n} from '@authup/core-kit';\nimport { BadRequestError, EntityNotFoundError } from '@authup/errors';\nimport type { Logger } from '@authup/server-kit';\nimport { describeError, resolveURL } from '../../../../../utils/index.ts';\nimport { useRequestQuery } from '@routup/basic/query';\nimport { setResponseCookie, unsetResponseCookie, useRequestCookie } from '@routup/basic/cookie';\nimport { readRequestBody } from '@routup/basic/body';\nimport type { OAuth2TokenGrantResponse } from '@authup/specs';\nimport { OAuth2RequestError } from '@authup/specs';\nimport type {\n EntityCollectionResponse,\n EntityRecordResponse,\n IdentityProviderCreatePayload,\n IdentityProviderLinkConfirmPayload,\n IdentityProviderLinkRequestResponse,\n IdentityProviderSavePayload,\n IdentityProviderUpdatePayload,\n} from '@authup/core-http-kit';\nimport { IDENTITY_PROVIDER_LOGIN_NOT_PENDING } from '@authup/core-http-kit';\nimport { URL } from 'node:url';\nimport type {\n IEventService,\n IIdentityProviderAccountLinkStore,\n IIdentityProviderAccountManager,\n IIdentityProviderRepository,\n IOAuth2AuthorizationCodeRequestVerifier,\n IOAuth2AuthorizationStateManager,\n IOAuth2FederatedLoginService,\n IdentityProviderIdentity,\n OAuth2AuthorizationState,\n OAuth2AuthorizationStateLink,\n} from '../../../../../core/index.ts';\nimport {\n OAUTH2_FEDERATED_LOGIN_COOKIE,\n OAUTH2_FEDERATED_LOGIN_TTL,\n OAuth2AuthorizationCodeRequestValidator,\n RECORD_QUERY_PARAMETERS,\n createIdentityProviderOAuth2Authenticator,\n decodeQuery,\n describeQuerySchema,\n identityProviderSchema,\n} from '../../../../../core/index.ts';\nimport {\n applyRouteRealmIDToBody,\n buildActorContext,\n getBodyRealmID,\n getRequestParamID,\n getRequestRealmID,\n useRequestEventContext,\n useRequestIdentityOrFail,\n useRequestParamID,\n useRequestPermissionEvaluator,\n} from '../../../request/index.ts';\nimport { ForceLoggedInMiddleware } from '../../../middleware/index.ts';\nimport type { IdentityProviderControllerContext, IdentityProviderControllerOptions } from './types.ts';\n\n@DTags('identity')\n@DController(['/identity-providers', '/realms/:realmId/identity-providers'])\nexport class IdentityProviderController {\n protected options: IdentityProviderControllerOptions;\n\n protected repository: IIdentityProviderRepository;\n\n protected accountManager: IIdentityProviderAccountManager;\n\n protected linkStore: IIdentityProviderAccountLinkStore;\n\n protected codeRequestVerifier : IOAuth2AuthorizationCodeRequestVerifier;\n\n protected codeRequestValidator : OAuth2AuthorizationCodeRequestValidator;\n\n protected stateManager : IOAuth2AuthorizationStateManager;\n\n protected loginService : IOAuth2FederatedLoginService;\n\n protected eventService? : IEventService;\n\n protected logger? : Logger;\n\n // ---------------------------------------------------------\n\n constructor(ctx: IdentityProviderControllerContext) {\n this.options = ctx.options;\n this.repository = ctx.repository;\n this.accountManager = ctx.accountManager;\n this.linkStore = ctx.linkStore;\n this.codeRequestVerifier = ctx.codeRequestVerifier;\n this.codeRequestValidator = new OAuth2AuthorizationCodeRequestValidator();\n this.stateManager = ctx.stateManager;\n this.loginService = ctx.loginService;\n this.eventService = ctx.eventService;\n this.logger = ctx.logger;\n }\n\n // ---------------------------------------------------------\n\n // Deliberately anonymous and ungated: the hosted login page lists a\n // realm's providers before anyone signs in. Safe only because findMany\n // does not extend with extra attributes, so the response is the schema's\n // fields.default projection. The record read below carries them and is\n // gated for exactly that reason.\n @DGet('', [])\n async getProviders(\n @DContext() event: IAppEvent,\n ): Promise<EntityCollectionResponse<IdentityProvider>> {\n const {\n data,\n meta,\n } = await this.repository.findMany(\n await decodeQuery(useRequestQuery(event), {\n schema: identityProviderSchema,\n actor: buildActorContext(event),\n }),\n );\n\n return {\n data,\n meta: {\n ...meta,\n schema: describeQuerySchema(identityProviderSchema),\n },\n };\n }\n\n @DGet('/:id', [ForceLoggedInMiddleware])\n async getProvider(\n @DPath('id') id: string,\n @DContext() event: IAppEvent,\n ): Promise<EntityRecordResponse<IdentityProvider>> {\n const paramId = useRequestParamID(event, { isUUID: false });\n\n const entity = await this.repository.findOneByIdOrName(\n paramId,\n getRequestRealmID(event),\n );\n\n if (!entity) {\n throw new EntityNotFoundError();\n }\n\n await useRequestPermissionEvaluator(event).evaluateOneOf({\n name: [\n PermissionName.IDENTITY_PROVIDER_READ,\n PermissionName.IDENTITY_PROVIDER_UPDATE,\n PermissionName.IDENTITY_PROVIDER_DELETE,\n ],\n data: definePolicyData({ [BuiltInPolicyType.ATTRIBUTES]: entity, [BuiltInPolicyType.REALM_MATCH]: entity.realmId ?? null }),\n });\n\n return { data: entity, meta: { schema: describeQuerySchema(identityProviderSchema, RECORD_QUERY_PARAMETERS) } };\n }\n\n @DPost('/:id', [ForceLoggedInMiddleware])\n async editProvider(\n @DPath('id') id: string,\n @DBody() user: IdentityProviderUpdatePayload,\n @DContext() event: IAppEvent,\n ) : Promise<EntityRecordResponse<IdentityProvider>> {\n return this.write(event, { updateOnly: true });\n }\n\n @DPut('/:id', [ForceLoggedInMiddleware])\n async put(\n @DPath('id') id: string,\n @DBody() user: IdentityProviderSavePayload,\n @DContext() event: IAppEvent,\n ) : Promise<EntityRecordResponse<IdentityProvider>> {\n return this.write(event);\n }\n\n @DDelete('/:id', [ForceLoggedInMiddleware])\n async dropProvider(\n @DPath('id') id: string,\n @DContext() event: IAppEvent,\n ) : Promise<EntityRecordResponse<IdentityProvider>> {\n const paramId = useRequestParamID(event);\n\n const permissionEvaluator = useRequestPermissionEvaluator(event);\n await permissionEvaluator.preEvaluate({ name: PermissionName.IDENTITY_PROVIDER_DELETE });\n\n const entity = await this.repository.findOneBy({ id: paramId });\n\n if (!entity) {\n throw new EntityNotFoundError();\n }\n\n await permissionEvaluator.evaluate({\n name: PermissionName.IDENTITY_PROVIDER_DELETE,\n data: definePolicyData({ [BuiltInPolicyType.ATTRIBUTES]: entity, [BuiltInPolicyType.REALM_MATCH]: entity.realmId ?? null }),\n });\n\n const { id: entityId } = entity;\n\n await this.repository.remove(entity);\n\n entity.id = entityId;\n\n event.response.status = 202;\n\n return { data: entity, meta: {} };\n }\n\n @DPost('', [ForceLoggedInMiddleware])\n async addProvider(\n @DBody() user: IdentityProviderCreatePayload,\n @DContext() event: IAppEvent,\n ) : Promise<EntityRecordResponse<IdentityProvider>> {\n return this.write(event);\n }\n\n // ---------------------------------------------------------\n\n @DGet('/:id/authorize-out', [])\n async authorizeOut(\n @DPath('id') _id: string,\n @DContext() event: IAppEvent,\n ) {\n const id = useRequestParamID(event);\n const entity = await this.resolve(id);\n\n if (!isOAuth2IdentityProvider(entity) && !isOpenIDIdentityProvider(entity)) {\n throw new BadRequestError('Only an identity-provider based on the oauth protocol supports authorize redirect.');\n }\n\n // Refused here as well as at the callback, so a disabled provider\n // costs no provider round trip.\n if (!entity.enabled) {\n throw new BadRequestError('The identity provider is not enabled.');\n }\n\n // A federated login completes an RP's authorization request: the\n // callback mints a code bound to that request and delivers it to the\n // request's redirect_uri. Without one there is nowhere to deliver a\n // code (the callback used to mint an unbound one and hand it to the\n // server root, issue #3457), so the login must not start.\n const query = useRequestQuery(event);\n if (typeof query.codeRequest !== 'string') {\n throw OAuth2RequestError.malformed('A federated login requires an authorization code request.');\n }\n\n let codeRequestDecoded: OAuth2AuthorizationCodeRequest;\n\n try {\n codeRequestDecoded = JSON.parse(base64URLDecode(query.codeRequest));\n } catch {\n throw OAuth2RequestError.malformed('The code request is malformed and can not be parsed.');\n }\n\n const codeRequestValidated = await this.codeRequestValidator.run(codeRequestDecoded);\n const data = await this.codeRequestVerifier.verify(codeRequestValidated);\n\n if (\n data.client.realmId &&\n entity.realmId &&\n entity.realmId !== data.client.realmId\n ) {\n throw OAuth2RequestError.malformed('The provider and client realm do not match.');\n }\n\n const authenticator = this.buildProviderAuthenticator(entity);\n\n // Ties this login to THIS browser. The callback requires the cookie\n // to match, so a crafted callback URL opened in someone else's\n // browser cannot make authup establish a session there (login CSRF).\n // The state's ip / user agent cannot carry that: both are chosen by\n // whoever mints the state (#3439). Keycloak and Authentik bind the\n // same hop to a cookie for the same reason.\n const browserNonce = createNanoID();\n this.setFederatedLoginCookie(event, browserNonce);\n\n const state = await this.saveAuthorizationState(event, {\n codeRequest: data.data,\n browserNonce,\n });\n\n return sendRedirect(event, authenticator.buildRedirectURL({ state }));\n }\n\n @DPost('/:id/link-request', [ForceLoggedInMiddleware])\n async linkRequest(\n @DPath('id') _id: string,\n @DContext() event: IAppEvent,\n ) : Promise<IdentityProviderLinkRequestResponse> {\n const id = useRequestParamID(event);\n const entity = await this.resolve(id);\n\n if (!isOAuth2IdentityProvider(entity) && !isOpenIDIdentityProvider(entity)) {\n throw new BadRequestError('Only an identity-provider based on the oauth protocol supports account linking.');\n }\n\n if (!entity.enabled) {\n throw new BadRequestError('The identity provider is not enabled.');\n }\n\n const identity = useRequestIdentityOrFail(event);\n if (identity.type !== IdentityType.USER) {\n throw new BadRequestError('Only a user can link an identity provider account.');\n }\n\n if (entity.realmId && entity.realmId !== identity.realmId) {\n throw new BadRequestError('The identity provider does not belong to the user realm.');\n }\n\n const authenticator = this.buildProviderAuthenticator(entity);\n\n const state = await this.saveAuthorizationState(event, { link: { userId: identity.id, providerId: entity.id } });\n\n return { url: authenticator.buildRedirectURL({ state }) };\n }\n\n @DGet('/:id/authorize-in', [])\n async authorizeIn(\n @DPath('id') _id: string,\n @DContext() event: IAppEvent,\n ) {\n const id = useRequestParamID(event);\n\n const entity = await this.resolve(id);\n\n if (!isOAuth2IdentityProvider(entity) && !isOpenIDIdentityProvider(entity)) {\n throw new Error(`The provider protocol ${entity.protocol} is not valid.`);\n }\n\n const data = await this.verifyAuthorizationState(event);\n\n const { link } = data;\n if (link) {\n return this.completeLink(event, entity, data, link);\n }\n\n // authorize-out no longer mints a login state without a code request;\n // this refuses the ones minted before that (issue #3457).\n if (!data.codeRequest) {\n throw OAuth2RequestError.malformed('The state carries no authorization code request.');\n }\n\n // The browser that started this login is the only one that may\n // finish it. Refused before the provider's single-use code is spent\n // and before any session exists. A state minted before this shipped\n // carries no nonce and is refused the same way; the hosted page\n // re-renders the request and the next attempt carries one.\n const browserNonce = useRequestCookie(event, OAUTH2_FEDERATED_LOGIN_COOKIE);\n if (\n !data.browserNonce ||\n typeof browserNonce !== 'string' ||\n browserNonce !== data.browserNonce\n ) {\n return sendRedirect(event, this.buildHostedAuthorizeURL(data.codeRequest).href);\n }\n\n const { code, error } = useRequestQuery(event);\n\n // RFC 6749 section 4.1.2.1: a provider answers a refused or failed\n // authorization (the person cancelled at the provider, the provider\n // is down) with `error` and no code. A top-level browser navigation\n // like every other refusal here, so it lands on the hosted login\n // again. Nothing of the provider's answer is echoed: whoever controls\n // the provider's redirect shapes those values.\n if (typeof error === 'string' && error.length > 0) {\n // JSON-quoted: a raw query value must not be able to forge a log line\n this.logger?.info(`The identity provider ${entity.id} answered the authorization with ${JSON.stringify(error.slice(0, 64))}.`);\n\n return sendRedirect(event, this.buildHostedAuthorizeURL(data.codeRequest).href);\n }\n\n if (typeof code !== 'string' || code.length === 0) {\n throw new BadRequestError('The authorization code is missing.');\n }\n\n const result = await this.loginService.complete({\n provider: entity,\n codeRequest: data.codeRequest,\n code,\n request: {\n ipAddress: getRequestIP(event),\n userAgent: getRequestHeader(event, 'user-agent'),\n },\n });\n\n // A refusal is a decision the person at the browser has to be told\n // about, and this is a top-level navigation, so it lands on the\n // hosted login rather than in a JSON body (issue #3458). A marker is\n // only attached when the refusal carries one; without it the page\n // re-runs the same verifier over the same request and states the\n // reason itself, so nothing is echoed.\n const url = this.buildHostedAuthorizeURL(result.codeRequest);\n\n if (result.kind === 'refused') {\n if (result.error) {\n url.searchParams.set('error', result.error);\n }\n\n return sendRedirect(event, url.href);\n }\n\n // The application's code is NOT minted here. The browser goes back to\n // the hosted authorize page, which completes the login and runs the\n // ladder an interactive login runs (prompt freshness, consent) before\n // any code exists (plan 094). So a custom-scheme redirect_uri needs no\n // interstitial on this leg either: it is navigated at the end of the\n // ladder, exactly as it is for an interactive login.\n //\n // The pending login rides a cookie rather than the URL, which is what\n // Keycloak and Authentik both do: only the browser that started the\n // login carries it, no other origin can set it, and nothing redeemable\n // reaches history, a log or a referrer. `SameSite=Lax` keeps it off\n // cross-site requests, so a page on another origin cannot drive the\n // completion. `provider` stays in the URL as a routing hint, and is no\n // secret.\n this.setFederatedLoginCookie(event, result.pendingLoginId);\n\n url.searchParams.set('provider', entity.id);\n\n return sendRedirect(event, url.href);\n }\n\n @DPost('/:id/login-complete', [])\n async completeLogin(\n @DPath('id') _id: string,\n @DContext() event: IAppEvent,\n ) : Promise<OAuth2TokenGrantResponse> {\n const id = useRequestParamID(event);\n\n this.assertSameOrigin(event);\n\n const pendingLoginId = useRequestCookie(event, OAUTH2_FEDERATED_LOGIN_COOKIE);\n if (typeof pendingLoginId !== 'string' || pendingLoginId.length === 0) {\n // Marked, because this refusal alone means the completion never\n // began: the caller was not in a federated login at all. The\n // hosted page reads it to skip the session teardown it performs\n // for a redemption that genuinely failed.\n throw new BadRequestError({\n message: 'The login request is unknown or expired.',\n data: { reason: IDENTITY_PROVIDER_LOGIN_NOT_PENDING },\n });\n }\n\n // Cleared whichever way the completion goes: it is single use, and a\n // cookie outliving its pending login only produces a confusing\n // refusal on some later page load.\n unsetResponseCookie(event, OAUTH2_FEDERATED_LOGIN_COOKIE, { path: this.buildFederatedLoginCookiePath() });\n\n return this.loginService.completeHandoff({\n pendingLoginId,\n providerId: id,\n });\n }\n\n // ---------------------------------------------------------\n\n private async write(event: IAppEvent, options: {\n updateOnly?: boolean\n } = {}): Promise<EntityRecordResponse<IdentityProvider>> {\n let group: string;\n const id = getRequestParamID(event, { isUUID: false });\n const body = await readRequestBody(event);\n applyRouteRealmIDToBody(event, body);\n const realmId = getRequestRealmID(event) ?? getBodyRealmID(body);\n\n let entity: IdentityProvider | null | undefined;\n if (id) {\n const where: Record<string, any> = {};\n if (isUUID(id)) {\n where.id = id;\n } else {\n where.name = id;\n }\n\n if (realmId) {\n where.realmId = realmId;\n }\n\n entity = await this.repository.findOneBy(where);\n // Only a NAME key may upsert-create. A UUID addresses one specific\n // row, so a miss is a 404 (creating would write a different id).\n if (!entity && (options.updateOnly || where.id)) {\n throw new EntityNotFoundError();\n }\n } else if (options.updateOnly) {\n throw new EntityNotFoundError();\n }\n\n const permissionEvaluator = useRequestPermissionEvaluator(event);\n if (entity) {\n await permissionEvaluator.preEvaluate({ name: PermissionName.IDENTITY_PROVIDER_UPDATE });\n\n group = ValidatorGroup.UPDATE;\n } else {\n await permissionEvaluator.preEvaluate({ name: PermissionName.IDENTITY_PROVIDER_CREATE });\n\n group = ValidatorGroup.CREATE;\n }\n\n const validator = new IdentityProviderValidator();\n const data = await validator.run(body, { group });\n\n const attributesValidator = new IdentityProviderAttributesValidator();\n const attributes = await attributesValidator.run(body);\n\n await this.repository.validateJoinColumns(data);\n\n if (entity) {\n await permissionEvaluator.evaluate({\n name: PermissionName.IDENTITY_PROVIDER_UPDATE,\n data: definePolicyData({\n [BuiltInPolicyType.ATTRIBUTES]: {\n ...entity,\n ...data,\n },\n [BuiltInPolicyType.REALM_MATCH]: data.realmId ?? entity.realmId ?? null,\n }),\n });\n } else {\n if (!data.realmId) {\n const identity = useRequestIdentityOrFail(event);\n data.realmId = identity.realmId;\n }\n\n await permissionEvaluator.evaluate({\n name: PermissionName.IDENTITY_PROVIDER_CREATE,\n data: definePolicyData({ [BuiltInPolicyType.ATTRIBUTES]: data, [BuiltInPolicyType.REALM_MATCH]: data.realmId ?? null }),\n });\n }\n\n await this.repository.checkUniqueness(data, entity || undefined);\n\n if (entity) {\n // A partial update must not delete attributes it never mentioned.\n // The payload is partial by contract, so automation written before\n // `requiredAmr` / `requiredAcr` existed would otherwise turn the\n // upstream assurance gate off by saying nothing about it. A caller\n // clears an attribute by sending it as `null`, which is what the\n // console submits for a blank field.\n //\n // A protocol switch is the exception and still replaces: the old\n // protocol's rows (an LDAP bind password) are dead configuration\n // no code reads any more, and keeping them leaves a secret behind.\n const keepAll = entity.protocol === data.protocol;\n\n entity = this.repository.merge(entity, data);\n await this.repository.saveWithEA(entity, attributes, { keepAll });\n\n event.response.status = 202;\n\n return { data: entity, meta: {} };\n }\n\n entity = this.repository.create(data);\n await this.repository.saveWithEA(entity, attributes);\n\n event.response.status = 201;\n\n return { data: entity, meta: {} };\n }\n\n // ---------------------------------------------------------\n\n /**\n * Callback half of the account-linking round-trip (plan 091): the\n * external identity is bound to the state-referenced user instead of\n * running the login path. No auth code and no session is minted; the\n * browser lands back on the account console with a marker param.\n */\n private async completeLink(\n event: IAppEvent,\n provider: OAuth2IdentityProvider | OpenIDIdentityProvider,\n state: OAuth2AuthorizationState,\n link: OAuth2AuthorizationStateLink,\n ) {\n // Fixed, server-derived return target (the account console page).\n // No client-supplied redirect exists on this path.\n const url = new URL(resolveURL(this.options.baseURL, 'account/connected-accounts'));\n\n const { code } = useRequestQuery(event);\n\n try {\n // The state is bound to the provider it was minted for, and the\n // provider must still be enabled at completion — a state cannot\n // be replayed against a different provider's callback, nor\n // complete a link after its provider was disabled.\n if (link.providerId !== provider.id || !provider.enabled) {\n throw new BadRequestError('The identity provider is not available for account linking.');\n }\n\n if (typeof code !== 'string' || code.length === 0) {\n throw new BadRequestError('The authorization code is missing.');\n }\n\n const authenticator = this.buildProviderAuthenticator(provider);\n\n const identity = await authenticator.resolveIdentity({ code });\n\n // A provider answering without a subject has nothing to bind. The\n // callback used to reach `link()`, which rejected it; the stash\n // would otherwise carry an empty providerUserId to the confirm.\n if (!identity.id) {\n throw new BadRequestError('The identity provider returned no subject.');\n }\n\n // Nothing is written here. This request is unauthenticated — the\n // browser round-trip cannot carry a bearer — so the only thing\n // distinguishing the browser that started the link from any other\n // would be the state's ip / user-agent binding, and both values\n // are chosen by whoever minted the state. An attacker minting a\n // state carrying their OWN userId and getting a victim to follow\n // it would otherwise bind the VICTIM's external identity to the\n // attacker's account (issue #3439).\n //\n // The resolved identity is stashed under a one-time handle\n // instead, and the account console confirms it with its bearer.\n // The stash keeps the requesting userId so the confirm can\n // require it to equal the AUTHENTICATED user: the handle is a\n // URL parameter, so it reaches browser history and proxy logs,\n // and on its own it must authorize nothing.\n const handle = await this.linkStore.save({\n providerId: provider.id,\n userId: link.userId,\n providerUserId: identity.id,\n providerUserName: this.pickIdentityCandidate(identity, 'name'),\n providerUserEmail: this.pickIdentityCandidate(identity, 'email'),\n });\n\n url.searchParams.set('linkHandle', handle);\n url.searchParams.set('provider', provider.id);\n } catch (e) {\n // The failure is swallowed into a redirect marker, so the log is\n // the only surface it can reach. Without this an unreachable or\n // rejecting provider is indistinguishable from a stale state.\n this.logger?.error(describeError(e, 'The identity-provider account link failed.'));\n\n url.searchParams.set('linkError', 'link_failed');\n }\n\n return sendRedirect(event, url.href);\n }\n\n /**\n * The bearer-authenticated half of the link (issue #3439): the account\n * row is written here, for the AUTHENTICATED user, never in the callback.\n */\n @DPost('/:id/link-confirm', [ForceLoggedInMiddleware])\n async confirmLink(\n @DPath('id') _id: string,\n @DBody() _data: IdentityProviderLinkConfirmPayload,\n @DContext() event: IAppEvent,\n ) : Promise<EntityRecordResponse<IdentityProviderAccount>> {\n const id = useRequestParamID(event);\n const provider = await this.resolve(id);\n\n if (!isOAuth2IdentityProvider(provider) && !isOpenIDIdentityProvider(provider)) {\n throw new BadRequestError('Only an identity-provider based on the oauth protocol supports account linking.');\n }\n\n if (!provider.enabled) {\n throw new BadRequestError('The identity provider is not enabled.');\n }\n\n const identity = useRequestIdentityOrFail(event);\n if (identity.type !== IdentityType.USER) {\n throw new BadRequestError('Only a user can link an identity provider account.');\n }\n\n const body = await readRequestBody(event);\n const handle = isObject(body) ? body.handle : undefined;\n if (typeof handle !== 'string' || handle.length === 0) {\n throw new BadRequestError('The account link handle is missing.');\n }\n\n const link = await this.linkStore.consume(handle);\n if (!link) {\n throw new BadRequestError('The account link request is unknown or expired.');\n }\n\n // The two checks that make the handle inert on its own: it may only\n // be redeemed by the user it was minted for, and only against the\n // provider it was minted for.\n if (link.userId !== identity.id || link.providerId !== provider.id) {\n throw new BadRequestError('The account link request does not belong to the authenticated user.');\n }\n\n const account = await this.accountManager.link(\n {\n id: link.providerUserId,\n // deliberately rebuilt from the stashed scalars: the resolved\n // identity carries the provider secret and the raw external\n // token payload, neither of which belongs in a cache\n attributeCandidates: {\n name: [link.providerUserName],\n email: [link.providerUserEmail],\n },\n data: {},\n provider,\n },\n identity.id,\n );\n\n // the confirm runs under a bearer, so unlike the callback it CAN be\n // attributed to a session and a route (the unlink emit's shape)\n const requestContext = useRequestEventContext();\n\n await this.eventService?.record({\n scope: EventScope.IDENTITY,\n name: EventName.IDENTITY_PROVIDER_LINKED,\n refType: EventRefType.IDENTITY_PROVIDER_ACCOUNT,\n refId: account.id,\n realmId: account.userRealmId ?? provider.realmId ?? null,\n actorType: IdentityType.USER,\n actorId: account.userId,\n actorName: identity.data.name ?? null,\n sessionId: requestContext?.sessionId ?? null,\n requestPath: requestContext?.requestPath ?? null,\n requestMethod: requestContext?.requestMethod ?? null,\n requestIpAddress: requestContext?.requestIpAddress ?? getRequestIP(event) ?? null,\n requestUserAgent: requestContext?.requestUserAgent ?? getRequestHeader(event, 'user-agent') ?? null,\n data: { providerId: provider.id, providerName: provider.name },\n });\n\n return { data: account, meta: {} };\n }\n\n private pickIdentityCandidate(\n identity: IdentityProviderIdentity,\n key: 'name' | 'email',\n ) : string | null {\n const candidates = identity.attributeCandidates?.[key] || [];\n for (const candidate of candidates) {\n if (typeof candidate === 'string' && candidate.length > 0) {\n return candidate;\n }\n }\n\n return null;\n }\n\n // ---------------------------------------------------------\n\n private buildHostedAuthorizeURL(codeRequest: OAuth2AuthorizationCodeRequest): URL {\n const url = new URL(resolveURL(this.options.baseURL, 'authorize'));\n\n const codeRequestKeys = Object.keys(codeRequest);\n for (const codeRequestKey_ of codeRequestKeys) {\n const codeRequestKey = codeRequestKey_ as keyof OAuth2AuthorizationCodeRequest;\n const codeRequestValue = codeRequest[codeRequestKey];\n // Preserve meaningful falsy values (e.g. max_age=0, which OIDC\n // treats as prompt=login) — only skip absent ones.\n if (typeof codeRequestValue !== 'undefined' && codeRequestValue !== null) {\n url.searchParams.set(codeRequestKey, String(codeRequestValue));\n }\n }\n\n return url;\n }\n\n // ---------------------------------------------------------\n\n private async resolve(id: string) {\n const entity = await this.repository.findOneById(id);\n\n if (!entity) {\n throw new EntityNotFoundError();\n }\n\n return entity;\n }\n\n // ---------------------------------------------------------\n\n private buildProviderAuthenticator(\n provider: OAuth2IdentityProvider | OpenIDIdentityProvider,\n options: { clientId?: string } = {},\n ) {\n return createIdentityProviderOAuth2Authenticator({\n accountManager: this.accountManager,\n provider,\n logger: this.logger,\n options: {\n baseURL: this.options.baseURL,\n clientId: options.clientId,\n },\n });\n }\n\n /**\n * Scoped to the routes that read it, so the cookie never rides an\n * ordinary API request, and to publicUrl's base path, since a sub-path\n * deployment mounts every route under it.\n */\n private buildFederatedLoginCookiePath() : string {\n return `${getURLBasePath(this.options.baseURL)}/identity-providers`;\n }\n\n private setFederatedLoginCookie(event: IAppEvent, value: string) : void {\n setResponseCookie(event, OAUTH2_FEDERATED_LOGIN_COOKIE, value, {\n httpOnly: true,\n sameSite: 'lax',\n // The scheme is read from the parsed URL rather than the raw\n // string: `publicUrl` is validated but never canonicalized, so a\n // configured `HTTPS://...` would leave a prefix test false and\n // drop the flag from the one cookie the login is bound to.\n secure: new URL(this.options.baseURL).protocol === 'https:',\n path: this.buildFederatedLoginCookiePath(),\n maxAge: OAUTH2_FEDERATED_LOGIN_TTL / 1000,\n });\n }\n\n /**\n * The completion answers with a token pair and authenticates on a cookie\n * alone, so it must be reachable only from the hosted page's own origin.\n *\n * CORS cannot carry that here: the default reflects every origin WITH\n * credentials, and `SameSite` is scoped to the registrable domain rather\n * than the origin, so a sibling subdomain's script is same-site and would\n * both send the cookie and be allowed to read the response. A browser\n * sends `Origin` on every POST, so requiring it to be publicUrl's own is\n * what closes that. A request without the header is not a browser and\n * carries no cookie of ours to begin with.\n */\n private assertSameOrigin(event: IAppEvent) : void {\n const origin = getRequestHeader(event, 'origin');\n if (typeof origin !== 'string' || origin.length === 0) {\n return;\n }\n\n if (origin !== new URL(this.options.baseURL).origin) {\n throw new BadRequestError('The login request is unknown or expired.');\n }\n }\n\n private async saveAuthorizationState(\n event: IAppEvent,\n data: Pick<OAuth2AuthorizationState, 'codeRequest' | 'link' | 'browserNonce'> = {},\n ) : Promise<string> {\n return this.stateManager.save({\n ...data,\n ip: getRequestIP(event) ?? '',\n userAgent: getRequestHeader(event, 'user-agent') ?? undefined,\n });\n }\n\n private async verifyAuthorizationState(event: IAppEvent): Promise<OAuth2AuthorizationState> {\n const query = useRequestQuery(event);\n if (typeof query.state !== 'string') {\n throw OAuth2RequestError.stateInvalid();\n }\n\n return this.stateManager.verify(query.state, {\n ip: getRequestIP(event) ?? '',\n userAgent: getRequestHeader(event, 'user-agent') ?? undefined,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4GA,IAAa2D,6BAAb,MAAaA;CACCC;CAEAC;CAEAC;CAEAC;CAEAC;CAEAC;CAEAC;CAEAC;CAEAC;CAEAC;CAIV,YAAYC,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oID","getURLBasePath","isObject","isUUID","DBody","DContext","DController","DDelete","DGet","DPath","DPost","DPut","DTags","getRequestHeader","getRequestIP","sendRedirect","EventName","EventRefType","EventScope","IdentityProviderAttributesValidator","IdentityProviderValidator","IdentityType","PermissionName","isOAuth2IdentityProvider","isOpenIDIdentityProvider","BadRequestError","EntityNotFoundError","describeError","resolveURL","useRequestQuery","setResponseCookie","unsetResponseCookie","useRequestCookie","readRequestBody","OAuth2RequestError","IDENTITY_PROVIDER_LOGIN_NOT_PENDING","URL","OAUTH2_FEDERATED_LOGIN_COOKIE","OAUTH2_FEDERATED_LOGIN_TTL","OAuth2AuthorizationCodeRequestValidator","RECORD_QUERY_PARAMETERS","createIdentityProviderOAuth2Authenticator","decodeQuery","describeQuerySchema","identityProviderSchema","applyRouteRealmIDToBody","buildActorContext","getBodyRealmID","getRequestParamID","getRequestRealmID","useRequestEventContext","useRequestIdentityOrFail","useRequestParamID","useRequestPermissionEvaluator","ForceLoggedInMiddleware","IdentityProviderController","options","repository","accountManager","linkStore","codeRequestVerifier","codeRequestValidator","stateManager","loginService","eventService","logger","ctx","getProviders","event","data","meta","findMany","schema","actor","getProvider","id","paramId","entity","findOneByIdOrName","evaluateOneOf","name","IDENTITY_PROVIDER_READ","IDENTITY_PROVIDER_UPDATE","IDENTITY_PROVIDER_DELETE","ATTRIBUTES","REALM_MATCH","realmId","editProvider","user","write","updateOnly","put","dropProvider","permissionEvaluator","preEvaluate","findOneBy","evaluate","entityId","remove","response","status","addProvider","authorizeOut","_id","resolve","enabled","query","codeRequest","malformed","codeRequestDecoded","JSON","parse","codeRequestValidated","run","verify","client","authenticator","buildProviderAuthenticator","browserNonce","setFederatedLoginCookie","state","saveAuthorizationState","buildRedirectURL","linkRequest","identity","type","USER","link","userId","providerId","url","authorizeIn","Error","protocol","verifyAuthorizationState","completeLink","buildHostedAuthorizeURL","href","code","error","length","info","stringify","slice","result","complete","provider","request","ipAddress","userAgent","kind","searchParams","set","pendingLoginId","completeLogin","assertSameOrigin","message","reason","path","buildFederatedLoginCookiePath","completeHandoff","group","body","where","UPDATE","IDENTITY_PROVIDER_CREATE","CREATE","validator","attributesValidator","attributes","validateJoinColumns","checkUniqueness","undefined","keepAll","merge","saveWithEA","create","accountConsoleUrl","resolveIdentity","handle","save","providerUserId","providerUserName","pickIdentityCandidate","providerUserEmail","e","confirmLink","_data","consume","account","attributeCandidates","email","requestContext","record","scope","IDENTITY","IDENTITY_PROVIDER_LINKED","refType","IDENTITY_PROVIDER_ACCOUNT","refId","userRealmId","actorType","actorId","actorName","sessionId","requestPath","requestMethod","requestIpAddress","requestUserAgent","providerName","key","candidates","candidate","baseURL","codeRequestKeys","Object","keys","codeRequestKey_","codeRequestKey","codeRequestValue","String","findOneById","clientId","value","httpOnly","sameSite","secure","maxAge","origin","ip","stateInvalid"],"sources":["../../../../../../src/adapters/http/controllers/entities/identity-provider/module.ts"],"sourcesContent":["/*\n * Copyright (c) 2022.\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 { BuiltInPolicyType, definePolicyData } from '@authup/access';\nimport {\n ValidatorGroup,\n base64URLDecode,\n createNanoID,\n getURLBasePath,\n isObject,\n isUUID,\n} from '@authup/kit';\nimport {\n DBody,\n DContext,\n DController,\n DDelete,\n DGet,\n DPath,\n DPost,\n DPut,\n DTags,\n} from '@routup/decorators';\nimport type { IAppEvent } from 'routup';\nimport {\n getRequestHeader,\n getRequestIP,\n sendRedirect,\n} from 'routup';\nimport type {\n IdentityProvider,\n IdentityProviderAccount,\n OAuth2AuthorizationCodeRequest,\n OAuth2IdentityProvider,\n OpenIDIdentityProvider,\n} from '@authup/core-kit';\nimport {\n EventName,\n EventRefType,\n EventScope,\n IdentityProviderAttributesValidator,\n IdentityProviderValidator,\n IdentityType,\n PermissionName,\n isOAuth2IdentityProvider,\n isOpenIDIdentityProvider,\n} from '@authup/core-kit';\nimport { BadRequestError, EntityNotFoundError } from '@authup/errors';\nimport type { Logger } from '@authup/server-kit';\nimport { describeError, resolveURL } from '../../../../../utils/index.ts';\nimport { useRequestQuery } from '@routup/basic/query';\nimport { setResponseCookie, unsetResponseCookie, useRequestCookie } from '@routup/basic/cookie';\nimport { readRequestBody } from '@routup/basic/body';\nimport type { OAuth2TokenGrantResponse } from '@authup/specs';\nimport { OAuth2RequestError } from '@authup/specs';\nimport type {\n EntityCollectionResponse,\n EntityRecordResponse,\n IdentityProviderCreatePayload,\n IdentityProviderLinkConfirmPayload,\n IdentityProviderLinkRequestResponse,\n IdentityProviderSavePayload,\n IdentityProviderUpdatePayload,\n} from '@authup/core-http-kit';\nimport { IDENTITY_PROVIDER_LOGIN_NOT_PENDING } from '@authup/core-http-kit';\nimport { URL } from 'node:url';\nimport type {\n IEventService,\n IIdentityProviderAccountLinkStore,\n IIdentityProviderAccountManager,\n IIdentityProviderRepository,\n IOAuth2AuthorizationCodeRequestVerifier,\n IOAuth2AuthorizationStateManager,\n IOAuth2FederatedLoginService,\n IdentityProviderIdentity,\n OAuth2AuthorizationState,\n OAuth2AuthorizationStateLink,\n} from '../../../../../core/index.ts';\nimport {\n OAUTH2_FEDERATED_LOGIN_COOKIE,\n OAUTH2_FEDERATED_LOGIN_TTL,\n OAuth2AuthorizationCodeRequestValidator,\n RECORD_QUERY_PARAMETERS,\n createIdentityProviderOAuth2Authenticator,\n decodeQuery,\n describeQuerySchema,\n identityProviderSchema,\n} from '../../../../../core/index.ts';\nimport {\n applyRouteRealmIDToBody,\n buildActorContext,\n getBodyRealmID,\n getRequestParamID,\n getRequestRealmID,\n useRequestEventContext,\n useRequestIdentityOrFail,\n useRequestParamID,\n useRequestPermissionEvaluator,\n} from '../../../request/index.ts';\nimport { ForceLoggedInMiddleware } from '../../../middleware/index.ts';\nimport type { IdentityProviderControllerContext, IdentityProviderControllerOptions } from './types.ts';\n\n@DTags('identity')\n@DController(['/identity-providers', '/realms/:realmId/identity-providers'])\nexport class IdentityProviderController {\n protected options: IdentityProviderControllerOptions;\n\n protected repository: IIdentityProviderRepository;\n\n protected accountManager: IIdentityProviderAccountManager;\n\n protected linkStore: IIdentityProviderAccountLinkStore;\n\n protected codeRequestVerifier : IOAuth2AuthorizationCodeRequestVerifier;\n\n protected codeRequestValidator : OAuth2AuthorizationCodeRequestValidator;\n\n protected stateManager : IOAuth2AuthorizationStateManager;\n\n protected loginService : IOAuth2FederatedLoginService;\n\n protected eventService? : IEventService;\n\n protected logger? : Logger;\n\n // ---------------------------------------------------------\n\n constructor(ctx: IdentityProviderControllerContext) {\n this.options = ctx.options;\n this.repository = ctx.repository;\n this.accountManager = ctx.accountManager;\n this.linkStore = ctx.linkStore;\n this.codeRequestVerifier = ctx.codeRequestVerifier;\n this.codeRequestValidator = new OAuth2AuthorizationCodeRequestValidator();\n this.stateManager = ctx.stateManager;\n this.loginService = ctx.loginService;\n this.eventService = ctx.eventService;\n this.logger = ctx.logger;\n }\n\n // ---------------------------------------------------------\n\n // Deliberately anonymous and ungated: the hosted login page lists a\n // realm's providers before anyone signs in. Safe only because findMany\n // does not extend with extra attributes, so the response is the schema's\n // fields.default projection. The record read below carries them and is\n // gated for exactly that reason.\n @DGet('', [])\n async getProviders(\n @DContext() event: IAppEvent,\n ): Promise<EntityCollectionResponse<IdentityProvider>> {\n const {\n data,\n meta,\n } = await this.repository.findMany(\n await decodeQuery(useRequestQuery(event), {\n schema: identityProviderSchema,\n actor: buildActorContext(event),\n }),\n );\n\n return {\n data,\n meta: {\n ...meta,\n schema: describeQuerySchema(identityProviderSchema),\n },\n };\n }\n\n @DGet('/:id', [ForceLoggedInMiddleware])\n async getProvider(\n @DPath('id') id: string,\n @DContext() event: IAppEvent,\n ): Promise<EntityRecordResponse<IdentityProvider>> {\n const paramId = useRequestParamID(event, { isUUID: false });\n\n const entity = await this.repository.findOneByIdOrName(\n paramId,\n getRequestRealmID(event),\n );\n\n if (!entity) {\n throw new EntityNotFoundError();\n }\n\n await useRequestPermissionEvaluator(event).evaluateOneOf({\n name: [\n PermissionName.IDENTITY_PROVIDER_READ,\n PermissionName.IDENTITY_PROVIDER_UPDATE,\n PermissionName.IDENTITY_PROVIDER_DELETE,\n ],\n data: definePolicyData({ [BuiltInPolicyType.ATTRIBUTES]: entity, [BuiltInPolicyType.REALM_MATCH]: entity.realmId ?? null }),\n });\n\n return { data: entity, meta: { schema: describeQuerySchema(identityProviderSchema, RECORD_QUERY_PARAMETERS) } };\n }\n\n @DPost('/:id', [ForceLoggedInMiddleware])\n async editProvider(\n @DPath('id') id: string,\n @DBody() user: IdentityProviderUpdatePayload,\n @DContext() event: IAppEvent,\n ) : Promise<EntityRecordResponse<IdentityProvider>> {\n return this.write(event, { updateOnly: true });\n }\n\n @DPut('/:id', [ForceLoggedInMiddleware])\n async put(\n @DPath('id') id: string,\n @DBody() user: IdentityProviderSavePayload,\n @DContext() event: IAppEvent,\n ) : Promise<EntityRecordResponse<IdentityProvider>> {\n return this.write(event);\n }\n\n @DDelete('/:id', [ForceLoggedInMiddleware])\n async dropProvider(\n @DPath('id') id: string,\n @DContext() event: IAppEvent,\n ) : Promise<EntityRecordResponse<IdentityProvider>> {\n const paramId = useRequestParamID(event);\n\n const permissionEvaluator = useRequestPermissionEvaluator(event);\n await permissionEvaluator.preEvaluate({ name: PermissionName.IDENTITY_PROVIDER_DELETE });\n\n const entity = await this.repository.findOneBy({ id: paramId });\n\n if (!entity) {\n throw new EntityNotFoundError();\n }\n\n await permissionEvaluator.evaluate({\n name: PermissionName.IDENTITY_PROVIDER_DELETE,\n data: definePolicyData({ [BuiltInPolicyType.ATTRIBUTES]: entity, [BuiltInPolicyType.REALM_MATCH]: entity.realmId ?? null }),\n });\n\n const { id: entityId } = entity;\n\n await this.repository.remove(entity);\n\n entity.id = entityId;\n\n event.response.status = 202;\n\n return { data: entity, meta: {} };\n }\n\n @DPost('', [ForceLoggedInMiddleware])\n async addProvider(\n @DBody() user: IdentityProviderCreatePayload,\n @DContext() event: IAppEvent,\n ) : Promise<EntityRecordResponse<IdentityProvider>> {\n return this.write(event);\n }\n\n // ---------------------------------------------------------\n\n @DGet('/:id/authorize-out', [])\n async authorizeOut(\n @DPath('id') _id: string,\n @DContext() event: IAppEvent,\n ) {\n const id = useRequestParamID(event);\n const entity = await this.resolve(id);\n\n if (!isOAuth2IdentityProvider(entity) && !isOpenIDIdentityProvider(entity)) {\n throw new BadRequestError('Only an identity-provider based on the oauth protocol supports authorize redirect.');\n }\n\n // Refused here as well as at the callback, so a disabled provider\n // costs no provider round trip.\n if (!entity.enabled) {\n throw new BadRequestError('The identity provider is not enabled.');\n }\n\n // A federated login completes an RP's authorization request: the\n // callback mints a code bound to that request and delivers it to the\n // request's redirect_uri. Without one there is nowhere to deliver a\n // code (the callback used to mint an unbound one and hand it to the\n // server root, issue #3457), so the login must not start.\n const query = useRequestQuery(event);\n if (typeof query.codeRequest !== 'string') {\n throw OAuth2RequestError.malformed('A federated login requires an authorization code request.');\n }\n\n let codeRequestDecoded: OAuth2AuthorizationCodeRequest;\n\n try {\n codeRequestDecoded = JSON.parse(base64URLDecode(query.codeRequest));\n } catch {\n throw OAuth2RequestError.malformed('The code request is malformed and can not be parsed.');\n }\n\n const codeRequestValidated = await this.codeRequestValidator.run(codeRequestDecoded);\n const data = await this.codeRequestVerifier.verify(codeRequestValidated);\n\n if (\n data.client.realmId &&\n entity.realmId &&\n entity.realmId !== data.client.realmId\n ) {\n throw OAuth2RequestError.malformed('The provider and client realm do not match.');\n }\n\n const authenticator = this.buildProviderAuthenticator(entity);\n\n // Ties this login to THIS browser. The callback requires the cookie\n // to match, so a crafted callback URL opened in someone else's\n // browser cannot make authup establish a session there (login CSRF).\n // The state's ip / user agent cannot carry that: both are chosen by\n // whoever mints the state (#3439). Keycloak and Authentik bind the\n // same hop to a cookie for the same reason.\n const browserNonce = createNanoID();\n this.setFederatedLoginCookie(event, browserNonce);\n\n const state = await this.saveAuthorizationState(event, {\n codeRequest: data.data,\n browserNonce,\n });\n\n return sendRedirect(event, authenticator.buildRedirectURL({ state }));\n }\n\n @DPost('/:id/link-request', [ForceLoggedInMiddleware])\n async linkRequest(\n @DPath('id') _id: string,\n @DContext() event: IAppEvent,\n ) : Promise<IdentityProviderLinkRequestResponse> {\n const id = useRequestParamID(event);\n const entity = await this.resolve(id);\n\n if (!isOAuth2IdentityProvider(entity) && !isOpenIDIdentityProvider(entity)) {\n throw new BadRequestError('Only an identity-provider based on the oauth protocol supports account linking.');\n }\n\n if (!entity.enabled) {\n throw new BadRequestError('The identity provider is not enabled.');\n }\n\n const identity = useRequestIdentityOrFail(event);\n if (identity.type !== IdentityType.USER) {\n throw new BadRequestError('Only a user can link an identity provider account.');\n }\n\n if (entity.realmId && entity.realmId !== identity.realmId) {\n throw new BadRequestError('The identity provider does not belong to the user realm.');\n }\n\n const authenticator = this.buildProviderAuthenticator(entity);\n\n const state = await this.saveAuthorizationState(event, { link: { userId: identity.id, providerId: entity.id } });\n\n return { url: authenticator.buildRedirectURL({ state }) };\n }\n\n @DGet('/:id/authorize-in', [])\n async authorizeIn(\n @DPath('id') _id: string,\n @DContext() event: IAppEvent,\n ) {\n const id = useRequestParamID(event);\n\n const entity = await this.resolve(id);\n\n if (!isOAuth2IdentityProvider(entity) && !isOpenIDIdentityProvider(entity)) {\n throw new Error(`The provider protocol ${entity.protocol} is not valid.`);\n }\n\n const data = await this.verifyAuthorizationState(event);\n\n const { link } = data;\n if (link) {\n return this.completeLink(event, entity, data, link);\n }\n\n // authorize-out no longer mints a login state without a code request;\n // this refuses the ones minted before that (issue #3457).\n if (!data.codeRequest) {\n throw OAuth2RequestError.malformed('The state carries no authorization code request.');\n }\n\n // The browser that started this login is the only one that may\n // finish it. Refused before the provider's single-use code is spent\n // and before any session exists. A state minted before this shipped\n // carries no nonce and is refused the same way; the hosted page\n // re-renders the request and the next attempt carries one.\n const browserNonce = useRequestCookie(event, OAUTH2_FEDERATED_LOGIN_COOKIE);\n if (\n typeof browserNonce !== 'string' ||\n !data.browserNonce ||\n browserNonce !== data.browserNonce\n ) {\n return sendRedirect(event, this.buildHostedAuthorizeURL(data.codeRequest).href);\n }\n\n const { code, error } = useRequestQuery(event);\n\n // RFC 6749 section 4.1.2.1: a provider answers a refused or failed\n // authorization (the person cancelled at the provider, the provider\n // is down) with `error` and no code. A top-level browser navigation\n // like every other refusal here, so it lands on the hosted login\n // again. Nothing of the provider's answer is echoed: whoever controls\n // the provider's redirect shapes those values.\n if (typeof error === 'string' && error.length > 0) {\n // JSON-quoted: a raw query value must not be able to forge a log line\n this.logger?.info(`The identity provider ${entity.id} answered the authorization with ${JSON.stringify(error.slice(0, 64))}.`);\n\n return sendRedirect(event, this.buildHostedAuthorizeURL(data.codeRequest).href);\n }\n\n if (typeof code !== 'string' || code.length === 0) {\n throw new BadRequestError('The authorization code is missing.');\n }\n\n const result = await this.loginService.complete({\n provider: entity,\n codeRequest: data.codeRequest,\n code,\n request: {\n ipAddress: getRequestIP(event),\n userAgent: getRequestHeader(event, 'user-agent'),\n },\n });\n\n // A refusal is a decision the person at the browser has to be told\n // about, and this is a top-level navigation, so it lands on the\n // hosted login rather than in a JSON body (issue #3458). A marker is\n // only attached when the refusal carries one; without it the page\n // re-runs the same verifier over the same request and states the\n // reason itself, so nothing is echoed.\n const url = this.buildHostedAuthorizeURL(result.codeRequest);\n\n if (result.kind === 'refused') {\n if (result.error) {\n url.searchParams.set('error', result.error);\n }\n\n return sendRedirect(event, url.href);\n }\n\n // The application's code is NOT minted here. The browser goes back to\n // the hosted authorize page, which completes the login and runs the\n // ladder an interactive login runs (prompt freshness, consent) before\n // any code exists (plan 094). So a custom-scheme redirect_uri needs no\n // interstitial on this leg either: it is navigated at the end of the\n // ladder, exactly as it is for an interactive login.\n //\n // The pending login rides a cookie rather than the URL, which is what\n // Keycloak and Authentik both do: only the browser that started the\n // login carries it, no other origin can set it, and nothing redeemable\n // reaches history, a log or a referrer. `SameSite=Lax` keeps it off\n // cross-site requests, so a page on another origin cannot drive the\n // completion. `provider` stays in the URL as a routing hint, and is no\n // secret.\n this.setFederatedLoginCookie(event, result.pendingLoginId);\n\n url.searchParams.set('provider', entity.id);\n\n return sendRedirect(event, url.href);\n }\n\n @DPost('/:id/login-complete', [])\n async completeLogin(\n @DPath('id') _id: string,\n @DContext() event: IAppEvent,\n ) : Promise<OAuth2TokenGrantResponse> {\n const id = useRequestParamID(event);\n\n this.assertSameOrigin(event);\n\n const pendingLoginId = useRequestCookie(event, OAUTH2_FEDERATED_LOGIN_COOKIE);\n if (typeof pendingLoginId !== 'string' || pendingLoginId.length === 0) {\n // Marked, because this refusal alone means the completion never\n // began: the caller was not in a federated login at all. The\n // hosted page reads it to skip the session teardown it performs\n // for a redemption that genuinely failed.\n throw new BadRequestError({\n message: 'The login request is unknown or expired.',\n data: { reason: IDENTITY_PROVIDER_LOGIN_NOT_PENDING },\n });\n }\n\n // Cleared whichever way the completion goes: it is single use, and a\n // cookie outliving its pending login only produces a confusing\n // refusal on some later page load.\n unsetResponseCookie(event, OAUTH2_FEDERATED_LOGIN_COOKIE, { path: this.buildFederatedLoginCookiePath() });\n\n return this.loginService.completeHandoff({\n pendingLoginId,\n providerId: id,\n });\n }\n\n // ---------------------------------------------------------\n\n private async write(event: IAppEvent, options: {\n updateOnly?: boolean\n } = {}): Promise<EntityRecordResponse<IdentityProvider>> {\n let group: string;\n const id = getRequestParamID(event, { isUUID: false });\n const body = await readRequestBody(event);\n applyRouteRealmIDToBody(event, body);\n const realmId = getRequestRealmID(event) ?? getBodyRealmID(body);\n\n let entity: IdentityProvider | null | undefined;\n if (id) {\n const where: Record<string, any> = {};\n if (isUUID(id)) {\n where.id = id;\n } else {\n where.name = id;\n }\n\n if (realmId) {\n where.realmId = realmId;\n }\n\n entity = await this.repository.findOneBy(where);\n // Only a NAME key may upsert-create. A UUID addresses one specific\n // row, so a miss is a 404 (creating would write a different id).\n if (!entity && (options.updateOnly || where.id)) {\n throw new EntityNotFoundError();\n }\n } else if (options.updateOnly) {\n throw new EntityNotFoundError();\n }\n\n const permissionEvaluator = useRequestPermissionEvaluator(event);\n if (entity) {\n await permissionEvaluator.preEvaluate({ name: PermissionName.IDENTITY_PROVIDER_UPDATE });\n\n group = ValidatorGroup.UPDATE;\n } else {\n await permissionEvaluator.preEvaluate({ name: PermissionName.IDENTITY_PROVIDER_CREATE });\n\n group = ValidatorGroup.CREATE;\n }\n\n const validator = new IdentityProviderValidator();\n const data = await validator.run(body, { group });\n\n const attributesValidator = new IdentityProviderAttributesValidator();\n const attributes = await attributesValidator.run(body);\n\n await this.repository.validateJoinColumns(data);\n\n if (entity) {\n await permissionEvaluator.evaluate({\n name: PermissionName.IDENTITY_PROVIDER_UPDATE,\n data: definePolicyData({\n [BuiltInPolicyType.ATTRIBUTES]: {\n ...entity,\n ...data,\n },\n [BuiltInPolicyType.REALM_MATCH]: data.realmId ?? entity.realmId ?? null,\n }),\n });\n } else {\n if (!data.realmId) {\n const identity = useRequestIdentityOrFail(event);\n data.realmId = identity.realmId;\n }\n\n await permissionEvaluator.evaluate({\n name: PermissionName.IDENTITY_PROVIDER_CREATE,\n data: definePolicyData({ [BuiltInPolicyType.ATTRIBUTES]: data, [BuiltInPolicyType.REALM_MATCH]: data.realmId ?? null }),\n });\n }\n\n await this.repository.checkUniqueness(data, entity || undefined);\n\n if (entity) {\n // A partial update must not delete attributes it never mentioned.\n // The payload is partial by contract, so automation written before\n // `requiredAmr` / `requiredAcr` existed would otherwise turn the\n // upstream assurance gate off by saying nothing about it. A caller\n // clears an attribute by sending it as `null`, which is what the\n // console submits for a blank field.\n //\n // A protocol switch is the exception and still replaces: the old\n // protocol's rows (an LDAP bind password) are dead configuration\n // no code reads any more, and keeping them leaves a secret behind.\n const keepAll = entity.protocol === data.protocol;\n\n entity = this.repository.merge(entity, data);\n await this.repository.saveWithEA(entity, attributes, { keepAll });\n\n event.response.status = 202;\n\n return { data: entity, meta: {} };\n }\n\n entity = this.repository.create(data);\n await this.repository.saveWithEA(entity, attributes);\n\n event.response.status = 201;\n\n return { data: entity, meta: {} };\n }\n\n // ---------------------------------------------------------\n\n /**\n * Callback half of the account-linking round-trip (plan 091): the\n * external identity is bound to the state-referenced user instead of\n * running the login path. No auth code and no session is minted; the\n * browser lands back on the account console with a marker param.\n */\n private async completeLink(\n event: IAppEvent,\n provider: OAuth2IdentityProvider | OpenIDIdentityProvider,\n state: OAuth2AuthorizationState,\n link: OAuth2AuthorizationStateLink,\n ) {\n // Fixed, server-derived return target (the account console page).\n // No client-supplied redirect exists on this path.\n const url = new URL(resolveURL(this.options.accountConsoleUrl, 'connected-accounts'));\n\n const { code } = useRequestQuery(event);\n\n try {\n // The state is bound to the provider it was minted for, and the\n // provider must still be enabled at completion — a state cannot\n // be replayed against a different provider's callback, nor\n // complete a link after its provider was disabled.\n if (link.providerId !== provider.id || !provider.enabled) {\n throw new BadRequestError('The identity provider is not available for account linking.');\n }\n\n if (typeof code !== 'string' || code.length === 0) {\n throw new BadRequestError('The authorization code is missing.');\n }\n\n const authenticator = this.buildProviderAuthenticator(provider);\n\n const identity = await authenticator.resolveIdentity({ code });\n\n // A provider answering without a subject has nothing to bind. The\n // callback used to reach `link()`, which rejected it; the stash\n // would otherwise carry an empty providerUserId to the confirm.\n if (!identity.id) {\n throw new BadRequestError('The identity provider returned no subject.');\n }\n\n // Nothing is written here. This request is unauthenticated — the\n // browser round-trip cannot carry a bearer — so the only thing\n // distinguishing the browser that started the link from any other\n // would be the state's ip / user-agent binding, and both values\n // are chosen by whoever minted the state. An attacker minting a\n // state carrying their OWN userId and getting a victim to follow\n // it would otherwise bind the VICTIM's external identity to the\n // attacker's account (issue #3439).\n //\n // The resolved identity is stashed under a one-time handle\n // instead, and the account console confirms it with its bearer.\n // The stash keeps the requesting userId so the confirm can\n // require it to equal the AUTHENTICATED user: the handle is a\n // URL parameter, so it reaches browser history and proxy logs,\n // and on its own it must authorize nothing.\n const handle = await this.linkStore.save({\n providerId: provider.id,\n userId: link.userId,\n providerUserId: identity.id,\n providerUserName: this.pickIdentityCandidate(identity, 'name'),\n providerUserEmail: this.pickIdentityCandidate(identity, 'email'),\n });\n\n url.searchParams.set('linkHandle', handle);\n url.searchParams.set('provider', provider.id);\n } catch (e) {\n // The failure is swallowed into a redirect marker, so the log is\n // the only surface it can reach. Without this an unreachable or\n // rejecting provider is indistinguishable from a stale state.\n this.logger?.error(describeError(e, 'The identity-provider account link failed.'));\n\n url.searchParams.set('linkError', 'link_failed');\n }\n\n return sendRedirect(event, url.href);\n }\n\n /**\n * The bearer-authenticated half of the link (issue #3439): the account\n * row is written here, for the AUTHENTICATED user, never in the callback.\n */\n @DPost('/:id/link-confirm', [ForceLoggedInMiddleware])\n async confirmLink(\n @DPath('id') _id: string,\n @DBody() _data: IdentityProviderLinkConfirmPayload,\n @DContext() event: IAppEvent,\n ) : Promise<EntityRecordResponse<IdentityProviderAccount>> {\n const id = useRequestParamID(event);\n const provider = await this.resolve(id);\n\n if (!isOAuth2IdentityProvider(provider) && !isOpenIDIdentityProvider(provider)) {\n throw new BadRequestError('Only an identity-provider based on the oauth protocol supports account linking.');\n }\n\n if (!provider.enabled) {\n throw new BadRequestError('The identity provider is not enabled.');\n }\n\n const identity = useRequestIdentityOrFail(event);\n if (identity.type !== IdentityType.USER) {\n throw new BadRequestError('Only a user can link an identity provider account.');\n }\n\n const body = await readRequestBody(event);\n const handle = isObject(body) ? body.handle : undefined;\n if (typeof handle !== 'string' || handle.length === 0) {\n throw new BadRequestError('The account link handle is missing.');\n }\n\n const link = await this.linkStore.consume(handle);\n if (!link) {\n throw new BadRequestError('The account link request is unknown or expired.');\n }\n\n // The two checks that make the handle inert on its own: it may only\n // be redeemed by the user it was minted for, and only against the\n // provider it was minted for.\n if (link.userId !== identity.id || link.providerId !== provider.id) {\n throw new BadRequestError('The account link request does not belong to the authenticated user.');\n }\n\n const account = await this.accountManager.link(\n {\n id: link.providerUserId,\n // deliberately rebuilt from the stashed scalars: the resolved\n // identity carries the provider secret and the raw external\n // token payload, neither of which belongs in a cache\n attributeCandidates: {\n name: [link.providerUserName],\n email: [link.providerUserEmail],\n },\n data: {},\n provider,\n },\n identity.id,\n );\n\n // the confirm runs under a bearer, so unlike the callback it CAN be\n // attributed to a session and a route (the unlink emit's shape)\n const requestContext = useRequestEventContext();\n\n await this.eventService?.record({\n scope: EventScope.IDENTITY,\n name: EventName.IDENTITY_PROVIDER_LINKED,\n refType: EventRefType.IDENTITY_PROVIDER_ACCOUNT,\n refId: account.id,\n realmId: account.userRealmId ?? provider.realmId ?? null,\n actorType: IdentityType.USER,\n actorId: account.userId,\n actorName: identity.data.name ?? null,\n sessionId: requestContext?.sessionId ?? null,\n requestPath: requestContext?.requestPath ?? null,\n requestMethod: requestContext?.requestMethod ?? null,\n requestIpAddress: requestContext?.requestIpAddress ?? getRequestIP(event) ?? null,\n requestUserAgent: requestContext?.requestUserAgent ?? getRequestHeader(event, 'user-agent') ?? null,\n data: { providerId: provider.id, providerName: provider.name },\n });\n\n return { data: account, meta: {} };\n }\n\n private pickIdentityCandidate(\n identity: IdentityProviderIdentity,\n key: 'name' | 'email',\n ) : string | null {\n const candidates = identity.attributeCandidates?.[key] || [];\n for (const candidate of candidates) {\n if (typeof candidate === 'string' && candidate.length > 0) {\n return candidate;\n }\n }\n\n return null;\n }\n\n // ---------------------------------------------------------\n\n private buildHostedAuthorizeURL(codeRequest: OAuth2AuthorizationCodeRequest): URL {\n const url = new URL(resolveURL(this.options.baseURL, 'authorize'));\n\n const codeRequestKeys = Object.keys(codeRequest);\n for (const codeRequestKey_ of codeRequestKeys) {\n const codeRequestKey = codeRequestKey_ as keyof OAuth2AuthorizationCodeRequest;\n const codeRequestValue = codeRequest[codeRequestKey];\n // Preserve meaningful falsy values (e.g. max_age=0, which OIDC\n // treats as prompt=login) — only skip absent ones.\n if (typeof codeRequestValue !== 'undefined' && codeRequestValue !== null) {\n url.searchParams.set(codeRequestKey, String(codeRequestValue));\n }\n }\n\n return url;\n }\n\n // ---------------------------------------------------------\n\n private async resolve(id: string) {\n const entity = await this.repository.findOneById(id);\n\n if (!entity) {\n throw new EntityNotFoundError();\n }\n\n return entity;\n }\n\n // ---------------------------------------------------------\n\n private buildProviderAuthenticator(\n provider: OAuth2IdentityProvider | OpenIDIdentityProvider,\n options: { clientId?: string } = {},\n ) {\n return createIdentityProviderOAuth2Authenticator({\n accountManager: this.accountManager,\n provider,\n logger: this.logger,\n options: {\n baseURL: this.options.baseURL,\n clientId: options.clientId,\n },\n });\n }\n\n /**\n * Scoped to the routes that read it, so the cookie never rides an\n * ordinary API request, and to publicUrl's base path, since a sub-path\n * deployment mounts every route under it.\n */\n private buildFederatedLoginCookiePath() : string {\n return `${getURLBasePath(this.options.baseURL)}/identity-providers`;\n }\n\n private setFederatedLoginCookie(event: IAppEvent, value: string) : void {\n setResponseCookie(event, OAUTH2_FEDERATED_LOGIN_COOKIE, value, {\n httpOnly: true,\n sameSite: 'lax',\n // The scheme is read from the parsed URL rather than the raw\n // string: `publicUrl` is validated but never canonicalized, so a\n // configured `HTTPS://...` would leave a prefix test false and\n // drop the flag from the one cookie the login is bound to.\n secure: new URL(this.options.baseURL).protocol === 'https:',\n path: this.buildFederatedLoginCookiePath(),\n maxAge: OAUTH2_FEDERATED_LOGIN_TTL / 1000,\n });\n }\n\n /**\n * The completion answers with a token pair and authenticates on a cookie\n * alone, so it must be reachable only from the hosted page's own origin.\n *\n * CORS cannot carry that here: the default reflects every origin WITH\n * credentials, and `SameSite` is scoped to the registrable domain rather\n * than the origin, so a sibling subdomain's script is same-site and would\n * both send the cookie and be allowed to read the response. A browser\n * sends `Origin` on every POST, so requiring it to be publicUrl's own is\n * what closes that. A request without the header is not a browser and\n * carries no cookie of ours to begin with.\n */\n private assertSameOrigin(event: IAppEvent) : void {\n const origin = getRequestHeader(event, 'origin');\n if (typeof origin !== 'string' || origin.length === 0) {\n return;\n }\n\n if (origin !== new URL(this.options.baseURL).origin) {\n throw new BadRequestError('The login request is unknown or expired.');\n }\n }\n\n private async saveAuthorizationState(\n event: IAppEvent,\n data: Pick<OAuth2AuthorizationState, 'codeRequest' | 'link' | 'browserNonce'> = {},\n ) : Promise<string> {\n return this.stateManager.save({\n ...data,\n ip: getRequestIP(event) ?? '',\n userAgent: getRequestHeader(event, 'user-agent') ?? undefined,\n });\n }\n\n private async verifyAuthorizationState(event: IAppEvent): Promise<OAuth2AuthorizationState> {\n const query = useRequestQuery(event);\n if (typeof query.state !== 'string') {\n throw OAuth2RequestError.stateInvalid();\n }\n\n return this.stateManager.verify(query.state, {\n ip: getRequestIP(event) ?? '',\n userAgent: getRequestHeader(event, 'user-agent') ?? undefined,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4GA,IAAa2D,6BAAb,MAAaA;CACCC;CAEAC;CAEAC;CAEAC;CAEAC;CAEAC;CAEAC;CAEAC;CAEAC;CAEAC;CAIV,YAAYC,KAAwC;EAChD,KAAKV,UAAUU,IAAIV;EACnB,KAAKC,aAAaS,IAAIT;EACtB,KAAKC,iBAAiBQ,IAAIR;EAC1B,KAAKC,YAAYO,IAAIP;EACrB,KAAKC,sBAAsBM,IAAIN;EAC/B,KAAKC,uBAAuB,IAAItB,wCAAAA;EAChC,KAAKuB,eAAeI,IAAIJ;EACxB,KAAKC,eAAeG,IAAIH;EACxB,KAAKC,eAAeE,IAAIF;EACxB,KAAKC,SAASC,IAAID;CACtB;CASA,MACME,aACF,OACmD;EACnD,MAAM,EACFE,MACAC,SACA,MAAM,KAAKb,WAAWc,SACtB,MAAM7B,YAAYb,gBAAgBuC,KAAAA,GAAQ;GACtCI,QAAQ5B;GACR6B,OAAO3B,kBAAkBsB,KAAAA;EAC7B,CAAA,CAAA;EAGJ,OAAO;GACHC;GACAC,MAAM;IACF,GAAGA;IACHE,QAAQ7B,oBAAoBC,sBAAAA;GAChC;EACJ;CACJ;CAEA,MACM8B,YACF,IACA,OAC+C;EAC/C,MAAME,UAAUxB,kBAAkBgB,OAAO,EAAEjE,QAAQ,MAAM,CAAA;EAEzD,MAAM0E,SAAS,MAAM,KAAKp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,uBAAAA,CAAAA;;;;;;;;CA4BCA,MAAAA,QAAAA,CAAAA,uBAAAA,CAAAA;;;;;;;;;;;;;CASDA,KAAAA,QAAAA,CAAAA,uBAAAA,CAAAA;;;;;;;;;;;;;CASGA,QAAAA,QAAAA,CAAAA,uBAAAA,CAAAA;;;;;;;;CAgCNA,MAAAA,IAAAA,CAAAA,uBAAAA,CAAAA;;;;;;;;;;;;;;;;CA4EiBA,MAAAA,qBAAAA,CAAAA,uBAAAA,CAAAA;;;;;;;;;;;;;;;;;;;;;;;;CA0WAA,MAAAA,qBAAAA,CAAAA,uBAAAA,CAAAA;;;;;;;;;;;;;;CAvkBnB,YAAA,CAAA,uBAAuB,qCAAA,CAAA"}
|
|
@@ -2,6 +2,12 @@ import type { Logger } from '@authup/server-kit';
|
|
|
2
2
|
import type { IEventService, IIdentityProviderAccountLinkStore, IIdentityProviderAccountManager, IIdentityProviderRepository, IOAuth2AuthorizationCodeRequestVerifier, IOAuth2AuthorizationStateManager, IOAuth2FederatedLoginService } from '../../../../../core/index.ts';
|
|
3
3
|
export type IdentityProviderControllerOptions = {
|
|
4
4
|
baseURL: string;
|
|
5
|
+
/**
|
|
6
|
+
* Where the account console is served. The link callback returns the
|
|
7
|
+
* browser there, so a console published at a path of its own must not be
|
|
8
|
+
* addressed at the default segment.
|
|
9
|
+
*/
|
|
10
|
+
accountConsoleUrl: string;
|
|
5
11
|
};
|
|
6
12
|
export type IdentityProviderControllerContext = {
|
|
7
13
|
options: IdentityProviderControllerOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/http/controllers/entities/identity-provider/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EACR,aAAa,EACb,iCAAiC,EACjC,+BAA+B,EAC/B,2BAA2B,EAC3B,uCAAuC,EACvC,gCAAgC,EAChC,4BAA4B,EAC/B,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,iCAAiC,GAAG;IAC5C,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/http/controllers/entities/identity-provider/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EACR,aAAa,EACb,iCAAiC,EACjC,+BAA+B,EAC/B,2BAA2B,EAC3B,uCAAuC,EACvC,gCAAgC,EAChC,4BAA4B,EAC/B,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,iCAAiC,GAAG;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC5C,OAAO,EAAE,iCAAiC,CAAC;IAE3C,UAAU,EAAE,2BAA2B,CAAC;IAExC,cAAc,EAAE,+BAA+B,CAAC;IAChD,SAAS,EAAE,iCAAiC,CAAC;IAC7C,mBAAmB,EAAE,uCAAuC,CAAC;IAC7D,YAAY,EAAE,gCAAgC,CAAC;IAC/C;;;OAGG;IACH,YAAY,EAAE,4BAA4B,CAAC;IAE3C,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/http/controllers/entities/realm/module.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EACR,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAMlE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAMvE,MAAM,MAAM,sBAAsB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACjC,OAAO,EAAE,sBAAsB,CAAC;IAChC,OAAO,EAAE,aAAa,CAAC;IACvB,aAAa,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;CACxC,CAAC;AAEF,qBAEa,eAAe;IACxB,SAAS,CAAC,OAAO,EAAE,sBAAsB,CAAC;IAE1C,SAAS,CAAC,OAAO,EAAE,aAAa,CAAC;IAEjC,SAAS,CAAC,aAAa,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;gBAEnC,GAAG,EAAE,sBAAsB;IAOjC,OAAO,CACG,KAAK,EAAE,SAAS,GAC7B,OAAO,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAgBrC,GAAG,CACI,IAAI,EAAE,kBAAkB,EACrB,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAUlC,GAAG,CAAc,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAOlE,sBAAsB,CACX,EAAE,EAAE,MAAM,GACxB,OAAO,CAAC,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/http/controllers/entities/realm/module.ts"],"names":[],"mappings":"AAk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OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAOlE,sBAAsB,CACX,EAAE,EAAE,MAAM,GACxB,OAAO,CAAC,sBAAsB,CAAC;IAgG5B,QAAQ,CAAc,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,gBAAgB,EAAE,CAAA;KAAE,CAAC;IAMxE,OAAO,CACI,EAAE,EAAE,MAAM,EACP,KAAK,EAAE,MAAM,GAC9B,OAAO,CAAC,gBAAgB,CAAC;IAMtB,IAAI,CACO,EAAE,EAAE,MAAM,EACd,IAAI,EAAE,kBAAkB,EACrB,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAclC,GAAG,CACQ,EAAE,EAAE,MAAM,EACd,IAAI,EAAE,gBAAgB,EACnB,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAgBlC,IAAI,CACO,EAAE,EAAE,MAAM,EACX,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;CAQ3C"}
|
|
@@ -72,6 +72,8 @@ var RealmController = class {
|
|
|
72
72
|
issuer: resolveURL(baseURL, `realms/${entity.name}`).replace(/\/+$/, ""),
|
|
73
73
|
authorization_endpoint: resolveURL(baseURL, "authorize"),
|
|
74
74
|
end_session_endpoint: resolveURL(baseURL, "logout"),
|
|
75
|
+
backchannel_logout_supported: true,
|
|
76
|
+
backchannel_logout_session_supported: true,
|
|
75
77
|
jwks_uri: resolveURL(baseURL, `realms/${entity.name}/jwks`),
|
|
76
78
|
response_types_supported: [OAuth2AuthorizationResponseType.CODE],
|
|
77
79
|
prompt_values_supported: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.mjs","names":["DBody","DContext","DController","DDelete","DGet","DPath","DPost","DPut","DTags","OAuth2AuthenticationContextClass","OAuth2AuthorizationPrompt","OAuth2AuthorizationResponseType","useRequestQuery","RECORD_QUERY_PARAMETERS","describeQuerySchema","realmSchema","getJwkRouteHandler","getJwksRouteHandler","ForceLoggedInMiddleware","buildActorContext","resolveURL","RealmController","options","service","keyRepository","ctx","getMany","event","data","meta","schema","add","actor","entity","create","response","status","get","id","getOne","getOpenIdConfiguration","baseURL","mtlsBaseURL","clientCertificatesEnabled","issuer","name","replace","authorization_endpoint","end_session_endpoint","jwks_uri","response_types_supported","CODE","prompt_values_supported","NONE","LOGIN","CONSENT","SELECT_ACCOUNT","acr_values_supported","PASSWORD","MFA","subject_types_supported","id_token_signing_alg_values_supported","token_endpoint","token_endpoint_auth_methods_supported","tls_client_certificate_bound_access_tokens","mtls_endpoint_aliases","introspection_endpoint","revocation_endpoint","userinfo_endpoint","service_documentation","getCerts","getCert","keyId","edit","update","put","created","save","undefined","drop","delete"],"sources":["../../../../../../src/adapters/http/controllers/entities/realm/module.ts"],"sourcesContent":["/*\n * Copyright (c) 2022.\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 DBody,\n DContext,\n DController,\n DDelete,\n DGet,\n DPath,\n DPost,\n DPut,\n DTags,\n} from '@routup/decorators';\nimport type { OAuth2JsonWebKey, OpenIDProviderMetadata } from '@authup/specs';\nimport { OAuth2AuthenticationContextClass, OAuth2AuthorizationPrompt, OAuth2AuthorizationResponseType } from '@authup/specs';\nimport type { IAppEvent } from 'routup';\nimport { useRequestQuery } from '@routup/basic/query';\nimport type { Repository } from 'typeorm';\nimport type {\n EntityCollectionResponse,\n EntityRecordResponse,\n RealmCreatePayload,\n RealmSavePayload,\n RealmUpdatePayload,\n} from '@authup/core-http-kit';\nimport type { Realm } from '@authup/core-kit';\nimport type { IRealmService } from '../../../../../core/index.ts';\nimport {\n RECORD_QUERY_PARAMETERS,\n describeQuerySchema,\n realmSchema,\n} from '../../../../../core/index.ts';\nimport type { KeyEntity } from '../../../../database/domains/index.ts';\nimport { getJwkRouteHandler, getJwksRouteHandler } from '../../workflows/index.ts';\nimport { ForceLoggedInMiddleware } from '../../../middleware/index.ts';\nimport { buildActorContext } from '../../../request/index.ts';\nimport { resolveURL } from '../../../../../utils/index.ts';\n\nexport type RealmControllerOptions = {\n baseURL: string,\n mtlsBaseURL?: string | null,\n clientCertificatesEnabled?: boolean,\n};\n\nexport type RealmControllerContext = {\n options: RealmControllerOptions,\n service: IRealmService,\n keyRepository: Repository<KeyEntity>,\n};\n\n@DTags('realm')\n@DController('/realms')\nexport class RealmController {\n protected options: RealmControllerOptions;\n\n protected service: IRealmService;\n\n protected keyRepository: Repository<KeyEntity>;\n\n constructor(ctx: RealmControllerContext) {\n this.options = ctx.options;\n this.service = ctx.service;\n this.keyRepository = ctx.keyRepository;\n }\n\n @DGet('', [])\n async getMany(\n @DContext() event: IAppEvent,\n ): Promise<EntityCollectionResponse<Realm>> {\n const {\n data,\n meta,\n } = await this.service.getMany(useRequestQuery(event));\n\n return {\n data,\n meta: {\n ...meta,\n schema: describeQuerySchema(realmSchema),\n },\n };\n }\n\n @DPost('', [ForceLoggedInMiddleware])\n async add(\n @DBody() data: RealmCreatePayload,\n @DContext() event: IAppEvent,\n ) : Promise<EntityRecordResponse<Realm>> {\n const actor = buildActorContext(event);\n const entity = await this.service.create(data, actor);\n\n event.response.status = 201;\n\n return { data: entity, meta: {} };\n }\n\n @DGet('/:id', [])\n async get(@DPath('id') id: string): Promise<EntityRecordResponse<Realm>> {\n const entity = await this.service.getOne(id);\n\n return { data: entity, meta: { schema: describeQuerySchema(realmSchema, RECORD_QUERY_PARAMETERS) } };\n }\n\n @DGet('/:id/.well-known/openid-configuration', [])\n async getOpenIdConfiguration(\n @DPath('id') id: string,\n ): Promise<OpenIDProviderMetadata> {\n const entity = await this.service.getOne(id);\n\n const { baseURL } = this.options;\n const { mtlsBaseURL, clientCertificatesEnabled = false } = this.options;\n\n return {\n issuer: resolveURL(baseURL, `realms/${entity.name}`).replace(/\\/+$/, ''),\n\n authorization_endpoint: resolveURL(baseURL, 'authorize'),\n\n end_session_endpoint: resolveURL(baseURL, 'logout'),\n\n jwks_uri: resolveURL(baseURL, `realms/${entity.name}/jwks`),\n\n // OAuth 2.1 posture: the authorization endpoint issues codes\n // only — implicit/hybrid response types were dropped (plan 042).\n response_types_supported: [\n OAuth2AuthorizationResponseType.CODE,\n ],\n\n // `none` (silent authentication) is handled by the hosted SSR\n // authorize page (the kit `Authorize.vue`): it either completes a\n // built_in client's auto-consent silently or redirects the OIDC\n // error (login_required / consent_required / interaction_required)\n // to a verified redirect_uri — zero UI. The server GET cannot do\n // this server-side (auth is header-only; a top-level navigation\n // carries no bearer), so the SSR page owns it (plan 042 item 10).\n prompt_values_supported: [\n OAuth2AuthorizationPrompt.NONE,\n OAuth2AuthorizationPrompt.LOGIN,\n OAuth2AuthorizationPrompt.CONSENT,\n OAuth2AuthorizationPrompt.SELECT_ACCOUNT,\n ],\n\n // two coarse levels only (urn-style — OIDC reserves the bare\n // \"0\"); `urn:authup:mfa` in `acr_values` acts as a step-up\n // trigger (plan 050).\n acr_values_supported: [\n OAuth2AuthenticationContextClass.PASSWORD,\n OAuth2AuthenticationContextClass.MFA,\n ],\n\n subject_types_supported: [\n 'public',\n ],\n\n id_token_signing_alg_values_supported: [\n 'HS256',\n 'HS384',\n 'HS512',\n 'RS256',\n 'RS384',\n 'RS512',\n 'none',\n ],\n\n token_endpoint: resolveURL(baseURL, 'token'),\n\n token_endpoint_auth_methods_supported: [\n 'none',\n 'client_secret_basic',\n 'client_secret_post',\n ...(clientCertificatesEnabled ? ['tls_client_auth'] : []),\n ],\n\n ...(clientCertificatesEnabled ? { tls_client_certificate_bound_access_tokens: true } : {}),\n\n ...(mtlsBaseURL ? {\n mtls_endpoint_aliases: {\n token_endpoint: resolveURL(mtlsBaseURL, 'token'),\n introspection_endpoint: resolveURL(mtlsBaseURL, 'token/introspect'),\n revocation_endpoint: resolveURL(mtlsBaseURL, 'token/revoke'),\n userinfo_endpoint: resolveURL(mtlsBaseURL, 'userinfo'),\n },\n } : {}),\n\n introspection_endpoint: resolveURL(baseURL, 'token/introspect'),\n\n revocation_endpoint: resolveURL(baseURL, 'token/revoke'),\n\n // -----------------------------------------------------------\n\n service_documentation: 'https://authup.org/',\n\n userinfo_endpoint: resolveURL(baseURL, 'userinfo'),\n };\n }\n\n @DGet('/:id/jwks', [])\n async getCerts(@DPath('id') id: string): Promise<{ keys: OAuth2JsonWebKey[] }> {\n const entity = await this.service.getOne(id);\n return getJwksRouteHandler(this.keyRepository, entity.id);\n }\n\n @DGet('/:id/jwks/:keyId', [])\n async getCert(\n @DPath('id') id: string,\n @DPath('keyId') keyId: string,\n ): Promise<OAuth2JsonWebKey> {\n const entity = await this.service.getOne(id);\n return getJwkRouteHandler(this.keyRepository, keyId, entity.id);\n }\n\n @DPost('/:id', [ForceLoggedInMiddleware])\n async edit(\n @DPath('id') id: string,\n @DBody() data: RealmUpdatePayload,\n @DContext() event: IAppEvent,\n ) : Promise<EntityRecordResponse<Realm>> {\n const actor = buildActorContext(event);\n const entity = await this.service.update(\n id,\n data,\n actor,\n );\n\n event.response.status = 202;\n\n return { data: entity, meta: {} };\n }\n\n @DPut('/:id', [ForceLoggedInMiddleware])\n async put(\n @DPath('id') id: string,\n @DBody() data: RealmSavePayload,\n @DContext() event: IAppEvent,\n ) : Promise<EntityRecordResponse<Realm>> {\n const actor = buildActorContext(event);\n const {\n entity,\n created,\n } = await this.service.save(\n id || undefined,\n data,\n actor,\n );\n\n event.response.status = created ? 201 : 202;\n return { data: entity, meta: {} };\n }\n\n @DDelete('/:id', [ForceLoggedInMiddleware])\n async drop(\n @DPath('id') id: string,\n @DContext() event: IAppEvent,\n ) : Promise<EntityRecordResponse<Realm>> {\n const actor = buildActorContext(event);\n const entity = await this.service.delete(id, actor);\n\n event.response.status = 202;\n\n return { data: entity, meta: {} };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,IAAaqB,kBAAb,MA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AE;CACpC;CAEA,MACM8C,IACF,IACA,MACA,OACqC;EACrC,MAAM3C,QAAQb,kBAAkBQ,KAAAA;EAChC,MAAM,EACFM,QACA2C,YACA,MAAM,KAAKrD,QAAQsD,KACnBvC,MAAMwC,KAAAA,GACNlD,MACAI,KAAAA;EAGJL,MAAMQ,SAASC,SAASwC,UAAU,MAAM;EACxC,OAAO;GAAEhD,MAAMK;GAAQJ,MAAM,CAAC;EAAE;CACpC;CAEA,MACMkD,KACF,IACA,OACqC;EACrC,MAAM/C,QAAQb,kBAAkBQ,KAAAA;EAChC,MAAMM,SAAS,MAAM,KAAKV,QAAQyD,OAAO1C,IAAIN,KAAAA;EAE7CL,MAAMQ,SAASC,SAAS;EAExB,OAAO;GAAER,MAAMK;GAAQJ,MAAM,CAAC;EAAE;CACpC;AACJ;;;;;;;;;CAjLgBX,MAAAA,IAAAA,CAAAA,uBAAAA,CAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+HIA,MAAAA,QAAAA,CAAAA,uBAAAA,CAAAA;;;;;;;;;;;;;CAkBDA,KAAAA,QAAAA,CAAAA,uBAAAA,CAAAA;;;;;;;;;;;;;CAoBGA,QAAAA,QAAAA,CAAAA,uBAAAA,CAAAA"}
|
|
1
|
+
{"version":3,"file":"module.mjs","names":["DBody","DContext","DController","DDelete","DGet","DPath","DPost","DPut","DTags","OAuth2AuthenticationContextClass","OAuth2AuthorizationPrompt","OAuth2AuthorizationResponseType","useRequestQuery","RECORD_QUERY_PARAMETERS","describeQuerySchema","realmSchema","getJwkRouteHandler","getJwksRouteHandler","ForceLoggedInMiddleware","buildActorContext","resolveURL","RealmController","options","service","keyRepository","ctx","getMany","event","data","meta","schema","add","actor","entity","create","response","status","get","id","getOne","getOpenIdConfiguration","baseURL","mtlsBaseURL","clientCertificatesEnabled","issuer","name","replace","authorization_endpoint","end_session_endpoint","backchannel_logout_supported","backchannel_logout_session_supported","jwks_uri","response_types_supported","CODE","prompt_values_supported","NONE","LOGIN","CONSENT","SELECT_ACCOUNT","acr_values_supported","PASSWORD","MFA","subject_types_supported","id_token_signing_alg_values_supported","token_endpoint","token_endpoint_auth_methods_supported","tls_client_certificate_bound_access_tokens","mtls_endpoint_aliases","introspection_endpoint","revocation_endpoint","userinfo_endpoint","service_documentation","getCerts","getCert","keyId","edit","update","put","created","save","undefined","drop","delete"],"sources":["../../../../../../src/adapters/http/controllers/entities/realm/module.ts"],"sourcesContent":["/*\n * Copyright (c) 2022.\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 DBody,\n DContext,\n DController,\n DDelete,\n DGet,\n DPath,\n DPost,\n DPut,\n DTags,\n} from '@routup/decorators';\nimport type { OAuth2JsonWebKey, OpenIDProviderMetadata } from '@authup/specs';\nimport { OAuth2AuthenticationContextClass, OAuth2AuthorizationPrompt, OAuth2AuthorizationResponseType } from '@authup/specs';\nimport type { IAppEvent } from 'routup';\nimport { useRequestQuery } from '@routup/basic/query';\nimport type { Repository } from 'typeorm';\nimport type {\n EntityCollectionResponse,\n EntityRecordResponse,\n RealmCreatePayload,\n RealmSavePayload,\n RealmUpdatePayload,\n} from '@authup/core-http-kit';\nimport type { Realm } from '@authup/core-kit';\nimport type { IRealmService } from '../../../../../core/index.ts';\nimport {\n RECORD_QUERY_PARAMETERS,\n describeQuerySchema,\n realmSchema,\n} from '../../../../../core/index.ts';\nimport type { KeyEntity } from '../../../../database/domains/index.ts';\nimport { getJwkRouteHandler, getJwksRouteHandler } from '../../workflows/index.ts';\nimport { ForceLoggedInMiddleware } from '../../../middleware/index.ts';\nimport { buildActorContext } from '../../../request/index.ts';\nimport { resolveURL } from '../../../../../utils/index.ts';\n\nexport type RealmControllerOptions = {\n baseURL: string,\n mtlsBaseURL?: string | null,\n clientCertificatesEnabled?: boolean,\n};\n\nexport type RealmControllerContext = {\n options: RealmControllerOptions,\n service: IRealmService,\n keyRepository: Repository<KeyEntity>,\n};\n\n@DTags('realm')\n@DController('/realms')\nexport class RealmController {\n protected options: RealmControllerOptions;\n\n protected service: IRealmService;\n\n protected keyRepository: Repository<KeyEntity>;\n\n constructor(ctx: RealmControllerContext) {\n this.options = ctx.options;\n this.service = ctx.service;\n this.keyRepository = ctx.keyRepository;\n }\n\n @DGet('', [])\n async getMany(\n @DContext() event: IAppEvent,\n ): Promise<EntityCollectionResponse<Realm>> {\n const {\n data,\n meta,\n } = await this.service.getMany(useRequestQuery(event));\n\n return {\n data,\n meta: {\n ...meta,\n schema: describeQuerySchema(realmSchema),\n },\n };\n }\n\n @DPost('', [ForceLoggedInMiddleware])\n async add(\n @DBody() data: RealmCreatePayload,\n @DContext() event: IAppEvent,\n ) : Promise<EntityRecordResponse<Realm>> {\n const actor = buildActorContext(event);\n const entity = await this.service.create(data, actor);\n\n event.response.status = 201;\n\n return { data: entity, meta: {} };\n }\n\n @DGet('/:id', [])\n async get(@DPath('id') id: string): Promise<EntityRecordResponse<Realm>> {\n const entity = await this.service.getOne(id);\n\n return { data: entity, meta: { schema: describeQuerySchema(realmSchema, RECORD_QUERY_PARAMETERS) } };\n }\n\n @DGet('/:id/.well-known/openid-configuration', [])\n async getOpenIdConfiguration(\n @DPath('id') id: string,\n ): Promise<OpenIDProviderMetadata> {\n const entity = await this.service.getOne(id);\n\n const { baseURL } = this.options;\n const { mtlsBaseURL, clientCertificatesEnabled = false } = this.options;\n\n return {\n issuer: resolveURL(baseURL, `realms/${entity.name}`).replace(/\\/+$/, ''),\n\n authorization_endpoint: resolveURL(baseURL, 'authorize'),\n\n end_session_endpoint: resolveURL(baseURL, 'logout'),\n\n // OIDC Back-Channel Logout 1.0: every session end pushes a\n // logout token carrying `sid` to the clients that registered a\n // back-channel logout URI (plan 064).\n backchannel_logout_supported: true,\n backchannel_logout_session_supported: true,\n\n jwks_uri: resolveURL(baseURL, `realms/${entity.name}/jwks`),\n\n // OAuth 2.1 posture: the authorization endpoint issues codes\n // only — implicit/hybrid response types were dropped (plan 042).\n response_types_supported: [\n OAuth2AuthorizationResponseType.CODE,\n ],\n\n // `none` (silent authentication) is handled by the hosted SSR\n // authorize page (the kit `Authorize.vue`): it either completes a\n // built_in client's auto-consent silently or redirects the OIDC\n // error (login_required / consent_required / interaction_required)\n // to a verified redirect_uri — zero UI. The server GET cannot do\n // this server-side (auth is header-only; a top-level navigation\n // carries no bearer), so the SSR page owns it (plan 042 item 10).\n prompt_values_supported: [\n OAuth2AuthorizationPrompt.NONE,\n OAuth2AuthorizationPrompt.LOGIN,\n OAuth2AuthorizationPrompt.CONSENT,\n OAuth2AuthorizationPrompt.SELECT_ACCOUNT,\n ],\n\n // two coarse levels only (urn-style — OIDC reserves the bare\n // \"0\"); `urn:authup:mfa` in `acr_values` acts as a step-up\n // trigger (plan 050).\n acr_values_supported: [\n OAuth2AuthenticationContextClass.PASSWORD,\n OAuth2AuthenticationContextClass.MFA,\n ],\n\n subject_types_supported: [\n 'public',\n ],\n\n id_token_signing_alg_values_supported: [\n 'HS256',\n 'HS384',\n 'HS512',\n 'RS256',\n 'RS384',\n 'RS512',\n 'none',\n ],\n\n token_endpoint: resolveURL(baseURL, 'token'),\n\n token_endpoint_auth_methods_supported: [\n 'none',\n 'client_secret_basic',\n 'client_secret_post',\n ...(clientCertificatesEnabled ? ['tls_client_auth'] : []),\n ],\n\n ...(clientCertificatesEnabled ? { tls_client_certificate_bound_access_tokens: true } : {}),\n\n ...(mtlsBaseURL ? {\n mtls_endpoint_aliases: {\n token_endpoint: resolveURL(mtlsBaseURL, 'token'),\n introspection_endpoint: resolveURL(mtlsBaseURL, 'token/introspect'),\n revocation_endpoint: resolveURL(mtlsBaseURL, 'token/revoke'),\n userinfo_endpoint: resolveURL(mtlsBaseURL, 'userinfo'),\n },\n } : {}),\n\n introspection_endpoint: resolveURL(baseURL, 'token/introspect'),\n\n revocation_endpoint: resolveURL(baseURL, 'token/revoke'),\n\n // -----------------------------------------------------------\n\n service_documentation: 'https://authup.org/',\n\n userinfo_endpoint: resolveURL(baseURL, 'userinfo'),\n };\n }\n\n @DGet('/:id/jwks', [])\n async getCerts(@DPath('id') id: string): Promise<{ keys: OAuth2JsonWebKey[] }> {\n const entity = await this.service.getOne(id);\n return getJwksRouteHandler(this.keyRepository, entity.id);\n }\n\n @DGet('/:id/jwks/:keyId', [])\n async getCert(\n @DPath('id') id: string,\n @DPath('keyId') keyId: string,\n ): Promise<OAuth2JsonWebKey> {\n const entity = await this.service.getOne(id);\n return getJwkRouteHandler(this.keyRepository, keyId, entity.id);\n }\n\n @DPost('/:id', [ForceLoggedInMiddleware])\n async edit(\n @DPath('id') id: string,\n @DBody() data: RealmUpdatePayload,\n @DContext() event: IAppEvent,\n ) : Promise<EntityRecordResponse<Realm>> {\n const actor = buildActorContext(event);\n const entity = await this.service.update(\n id,\n data,\n actor,\n );\n\n event.response.status = 202;\n\n return { data: entity, meta: {} };\n }\n\n @DPut('/:id', [ForceLoggedInMiddleware])\n async put(\n @DPath('id') id: string,\n @DBody() data: RealmSavePayload,\n @DContext() event: IAppEvent,\n ) : Promise<EntityRecordResponse<Realm>> {\n const actor = buildActorContext(event);\n const {\n entity,\n created,\n } = await this.service.save(\n id || undefined,\n data,\n actor,\n );\n\n event.response.status = created ? 201 : 202;\n return { data: entity, meta: {} };\n }\n\n @DDelete('/:id', [ForceLoggedInMiddleware])\n async drop(\n @DPath('id') id: string,\n @DContext() event: IAppEvent,\n ) : Promise<EntityRecordResponse<Realm>> {\n const actor = buildActorContext(event);\n const entity = await this.service.delete(id, actor);\n\n event.response.status = 202;\n\n return { data: entity, meta: {} };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,IAAaqB,kBAAb,MAAaA;CACCC;CAEAC;CAEAC;CAEV,YAAYC,KAA6B;EACrC,KAAKH,UAAUG,IAAIH;EACnB,KAAKC,UAAUE,IAAIF;EACnB,KAAKC,gBAAgBC,IAAID;CAC7B;CAEA,MACME,QACF,OACwC;EACxC,MAAM,EACFE,MACAC,S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M0C,KAAAA,GACNpD,MACAI,KAAAA;EAGJL,MAAMQ,SAASC,SAAS0C,UAAU,MAAM;EACxC,OAAO;GAAElD,MAAMK;GAAQJ,MAAM,CAAC;EAAE;CACpC;CAEA,MACMoD,KACF,IACA,OACqC;EACrC,MAAMjD,QAAQb,kBAAkBQ,KAAAA;EAChC,MAAMM,SAAS,MAAM,KAAKV,QAAQ2D,OAAO5C,IAAIN,KAAAA;EAE7CL,MAAMQ,SAASC,SAAS;EAExB,OAAO;GAAER,MAAMK;GAAQJ,MAAM,CAAC;EAAE;CACpC;AACJ;;;;;;;;;CAvLgBX,MAAAA,IAAAA,CAAAA,uBAAAA,CAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqIIA,MAAAA,QAAAA,CAAAA,uBAAAA,CAAAA;;;;;;;;;;;;;CAkBDA,KAAAA,QAAAA,CAAAA,uBAAAA,CAAAA;;;;;;;;;;;;;CAoBGA,QAAAA,QAAAA,CAAAA,uBAAAA,CAAAA"}
|
|
@@ -1,13 +1,45 @@
|
|
|
1
1
|
import type { Session } from '@authup/core-kit';
|
|
2
2
|
import type { IAppEvent } from 'routup';
|
|
3
3
|
import type { EntityCollectionResponse, EntityRecordResponse, SessionDeleteManyResponse } from '@authup/core-http-kit';
|
|
4
|
-
import type { ISessionService } from '../../../../../core/index.ts';
|
|
4
|
+
import type { IIdentityPermissionProvider, IIdentityResolver, ISessionRepository, ISessionService } from '../../../../../core/index.ts';
|
|
5
|
+
import type { OAuth2TokenIntrospectionResponse } from '@authup/specs';
|
|
5
6
|
export type SessionControllerContext = {
|
|
7
|
+
/**
|
|
8
|
+
* Only the cookie-session additions below use these (plan 088). The entity
|
|
9
|
+
* routes delegate wholly to `service`, as every entity controller does.
|
|
10
|
+
*/
|
|
11
|
+
baseURL?: string;
|
|
12
|
+
identityResolver?: IIdentityResolver;
|
|
13
|
+
identityPermissionProvider?: IIdentityPermissionProvider;
|
|
14
|
+
sessionRepository?: ISessionRepository;
|
|
6
15
|
service: ISessionService;
|
|
7
16
|
};
|
|
8
17
|
export declare class SessionController {
|
|
9
18
|
protected service: ISessionService;
|
|
19
|
+
protected baseURL?: string;
|
|
20
|
+
protected identityResolver?: IIdentityResolver;
|
|
21
|
+
protected identityPermissionProvider?: IIdentityPermissionProvider;
|
|
22
|
+
protected sessionRepository?: ISessionRepository;
|
|
10
23
|
constructor(ctx: SessionControllerContext);
|
|
24
|
+
/**
|
|
25
|
+
* The caller's own session as a CONTEXT rather than a row: the identity
|
|
26
|
+
* claims and permission projection a console hydrates its store from, which
|
|
27
|
+
* is what `POST /token/introspect` answers minus everything token-shaped.
|
|
28
|
+
*
|
|
29
|
+
* A sibling of `@me` rather than a replacement for it: `GET /sessions/@me`
|
|
30
|
+
* returns the `auth_sessions` ROW, and a console needs the subject's claims
|
|
31
|
+
* and permissions, which are not on it. Named `introspect` because it is
|
|
32
|
+
* literally the introspection projection, keyed off the request's own
|
|
33
|
+
* credential instead of a token in the body.
|
|
34
|
+
*
|
|
35
|
+
* No client scope on the permission read, deliberately.
|
|
36
|
+
* `reduceBindingsByIdentityClient` keeps only permissions whose own
|
|
37
|
+
* `clientId` matches the one passed, so naming a console's client would
|
|
38
|
+
* drop every global permission — nearly all of them. The bearer path passes
|
|
39
|
+
* the token's `client_id` because a token IS issued to one client; a
|
|
40
|
+
* session is not.
|
|
41
|
+
*/
|
|
42
|
+
getOwnIntrospection(event: IAppEvent): Promise<OAuth2TokenIntrospectionResponse>;
|
|
11
43
|
getMany(event: IAppEvent): Promise<EntityCollectionResponse<Session>>;
|
|
12
44
|
getOne(id: string, event: IAppEvent): Promise<EntityRecordResponse<Session>>;
|
|
13
45
|
dropMany(event: IAppEvent): Promise<SessionDeleteManyResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/http/controllers/entities/session/module.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAEvH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/http/controllers/entities/session/module.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAEvH,OAAO,KAAK,EACR,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EAClB,MAAM,8BAA8B,CAAC;AAYtC,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AAMtE,MAAM,MAAM,wBAAwB,GAAG;IACnC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC,0BAA0B,CAAC,EAAE,2BAA2B,CAAC;IACzD,iBAAiB,CAAC,EAAE,kBAAkB,CAAC;IACvC,OAAO,EAAE,eAAe,CAAC;CAC5B,CAAC;AAEF,qBAEa,iBAAiB;IAC1B,SAAS,CAAC,OAAO,EAAE,eAAe,CAAC;IAEnC,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAE3B,SAAS,CAAC,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IAE/C,SAAS,CAAC,0BAA0B,CAAC,EAAE,2BAA2B,CAAC;IAEnE,SAAS,CAAC,iBAAiB,CAAC,EAAE,kBAAkB,CAAC;gBAErC,GAAG,EAAE,wBAAwB;IAQzC;;;;;;;;;;;;;;;;;OAiBG;IAEG,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