@contember/engine-tenant-api 1.2.1 → 1.3.0-alpha.2
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/src/TenantContainer.d.ts +1 -1
- package/dist/src/TenantContainer.d.ts.map +1 -1
- package/dist/src/TenantContainer.js +2 -0
- package/dist/src/TenantContainer.js.map +1 -1
- package/dist/src/bin/runMigrations.d.ts +2 -0
- package/dist/src/bin/runMigrations.d.ts.map +1 -0
- package/dist/src/bin/runMigrations.js +28 -0
- package/dist/src/bin/runMigrations.js.map +1 -0
- package/dist/src/migrations/2018-08-02-174310-init.d.ts +3 -0
- package/dist/src/migrations/2018-08-02-174310-init.d.ts.map +1 -0
- package/dist/src/migrations/2018-08-02-174310-init.js +64 -0
- package/dist/src/migrations/2018-08-02-174310-init.js.map +1 -0
- package/dist/src/migrations/2018-09-03-140621-identity-project.d.ts +3 -0
- package/dist/src/migrations/2018-09-03-140621-identity-project.d.ts.map +1 -0
- package/dist/src/migrations/2018-09-03-140621-identity-project.js +33 -0
- package/dist/src/migrations/2018-09-03-140621-identity-project.js.map +1 -0
- package/dist/src/migrations/2018-10-26-165450-setup-api-key.d.ts +3 -0
- package/dist/src/migrations/2018-10-26-165450-setup-api-key.d.ts.map +1 -0
- package/dist/src/migrations/2018-10-26-165450-setup-api-key.js +27 -0
- package/dist/src/migrations/2018-10-26-165450-setup-api-key.js.map +1 -0
- package/dist/src/migrations/2018-10-26-175155-variables.d.ts +3 -0
- package/dist/src/migrations/2018-10-26-175155-variables.d.ts.map +1 -0
- package/dist/src/migrations/2018-10-26-175155-variables.js +23 -0
- package/dist/src/migrations/2018-10-26-175155-variables.js.map +1 -0
- package/dist/src/migrations/2019-02-18-110949-project-slug.d.ts +3 -0
- package/dist/src/migrations/2019-02-18-110949-project-slug.d.ts.map +1 -0
- package/dist/src/migrations/2019-02-18-110949-project-slug.js +18 -0
- package/dist/src/migrations/2019-02-18-110949-project-slug.js.map +1 -0
- package/dist/src/migrations/2019-02-18-160155-session-expiration.d.ts +3 -0
- package/dist/src/migrations/2019-02-18-160155-session-expiration.d.ts.map +1 -0
- package/dist/src/migrations/2019-02-18-160155-session-expiration.js +11 -0
- package/dist/src/migrations/2019-02-18-160155-session-expiration.js.map +1 -0
- package/dist/src/migrations/2019-05-03-163729-api-key-disabled-at.d.ts +3 -0
- package/dist/src/migrations/2019-05-03-163729-api-key-disabled-at.d.ts.map +1 -0
- package/dist/src/migrations/2019-05-03-163729-api-key-disabled-at.js +18 -0
- package/dist/src/migrations/2019-05-03-163729-api-key-disabled-at.js.map +1 -0
- package/dist/src/migrations/2019-08-14-153300-project-slug-unique.d.ts +3 -0
- package/dist/src/migrations/2019-08-14-153300-project-slug-unique.d.ts.map +1 -0
- package/dist/src/migrations/2019-08-14-153300-project-slug-unique.js +11 -0
- package/dist/src/migrations/2019-08-14-153300-project-slug-unique.js.map +1 -0
- package/dist/src/migrations/2019-09-06-111000-membership.d.ts +3 -0
- package/dist/src/migrations/2019-09-06-111000-membership.d.ts.map +1 -0
- package/dist/src/migrations/2019-09-06-111000-membership.js +51 -0
- package/dist/src/migrations/2019-09-06-111000-membership.js.map +1 -0
- package/dist/src/migrations/2019-09-06-111001-drop-old-member.d.ts +3 -0
- package/dist/src/migrations/2019-09-06-111001-drop-old-member.d.ts.map +1 -0
- package/dist/src/migrations/2019-09-06-111001-drop-old-member.js +11 -0
- package/dist/src/migrations/2019-09-06-111001-drop-old-member.js.map +1 -0
- package/dist/src/migrations/2020-01-29-idenity-note.d.ts +3 -0
- package/dist/src/migrations/2020-01-29-idenity-note.d.ts.map +1 -0
- package/dist/src/migrations/2020-01-29-idenity-note.js +18 -0
- package/dist/src/migrations/2020-01-29-idenity-note.js.map +1 -0
- package/dist/src/migrations/2020-04-17-fix-person-index.d.ts +3 -0
- package/dist/src/migrations/2020-04-17-fix-person-index.d.ts.map +1 -0
- package/dist/src/migrations/2020-04-17-fix-person-index.js +12 -0
- package/dist/src/migrations/2020-04-17-fix-person-index.js.map +1 -0
- package/dist/src/migrations/2020-05-01-170000-api-key-index.d.ts +3 -0
- package/dist/src/migrations/2020-05-01-170000-api-key-index.d.ts.map +1 -0
- package/dist/src/migrations/2020-05-01-170000-api-key-index.js +10 -0
- package/dist/src/migrations/2020-05-01-170000-api-key-index.js.map +1 -0
- package/dist/src/migrations/2020-06-08-134000-tenant-credentials.d.ts.map +1 -1
- package/dist/src/migrations/2020-06-08-134000-tenant-credentials.js +2 -50
- package/dist/src/migrations/2020-06-08-134000-tenant-credentials.js.map +1 -1
- package/dist/src/migrations/2020-08-07-110000-person-otp.d.ts +3 -0
- package/dist/src/migrations/2020-08-07-110000-person-otp.d.ts.map +1 -0
- package/dist/src/migrations/2020-08-07-110000-person-otp.js +12 -0
- package/dist/src/migrations/2020-08-07-110000-person-otp.js.map +1 -0
- package/dist/src/migrations/2020-08-17-162200-mail-templates.d.ts +3 -0
- package/dist/src/migrations/2020-08-17-162200-mail-templates.d.ts.map +1 -0
- package/dist/src/migrations/2020-08-17-162200-mail-templates.js +23 -0
- package/dist/src/migrations/2020-08-17-162200-mail-templates.js.map +1 -0
- package/dist/src/migrations/2020-08-21-143400-person-password-reset.d.ts +3 -0
- package/dist/src/migrations/2020-08-21-143400-person-password-reset.d.ts.map +1 -0
- package/dist/src/migrations/2020-08-21-143400-person-password-reset.js +23 -0
- package/dist/src/migrations/2020-08-21-143400-person-password-reset.js.map +1 -0
- package/dist/src/migrations/2020-09-07-094200-identity-provider.d.ts +3 -0
- package/dist/src/migrations/2020-09-07-094200-identity-provider.d.ts.map +1 -0
- package/dist/src/migrations/2020-09-07-094200-identity-provider.js +17 -0
- package/dist/src/migrations/2020-09-07-094200-identity-provider.js.map +1 -0
- package/dist/src/migrations/2021-03-28-134000-timestamp.d.ts +3 -0
- package/dist/src/migrations/2021-03-28-134000-timestamp.d.ts.map +1 -0
- package/dist/src/migrations/2021-03-28-134000-timestamp.js +27 -0
- package/dist/src/migrations/2021-03-28-134000-timestamp.js.map +1 -0
- package/dist/src/migrations/2021-07-26-105000-project-config.d.ts +3 -0
- package/dist/src/migrations/2021-07-26-105000-project-config.d.ts.map +1 -0
- package/dist/src/migrations/2021-07-26-105000-project-config.js +12 -0
- package/dist/src/migrations/2021-07-26-105000-project-config.js.map +1 -0
- package/dist/src/migrations/2021-07-26-132000-project-secrets.d.ts +3 -0
- package/dist/src/migrations/2021-07-26-132000-project-secrets.d.ts.map +1 -0
- package/dist/src/migrations/2021-07-26-132000-project-secrets.js +24 -0
- package/dist/src/migrations/2021-07-26-132000-project-secrets.js.map +1 -0
- package/dist/src/migrations/2021-07-27-174000-project-alias-index.d.ts +3 -0
- package/dist/src/migrations/2021-07-27-174000-project-alias-index.d.ts.map +1 -0
- package/dist/src/migrations/2021-07-27-174000-project-alias-index.js +10 -0
- package/dist/src/migrations/2021-07-27-174000-project-alias-index.js.map +1 -0
- package/dist/src/migrations/2021-11-24-130000-person-password-null.d.ts +3 -0
- package/dist/src/migrations/2021-11-24-130000-person-password-null.d.ts.map +1 -0
- package/dist/src/migrations/2021-11-24-130000-person-password-null.js +10 -0
- package/dist/src/migrations/2021-11-24-130000-person-password-null.js.map +1 -0
- package/dist/src/migrations/2021-11-24-161500-mail-template-project-null.d.ts +3 -0
- package/dist/src/migrations/2021-11-24-161500-mail-template-project-null.d.ts.map +1 -0
- package/dist/src/migrations/2021-11-24-161500-mail-template-project-null.js +18 -0
- package/dist/src/migrations/2021-11-24-161500-mail-template-project-null.js.map +1 -0
- package/dist/src/migrations/2022-01-04-144000-person-unique-identity.d.ts +3 -0
- package/dist/src/migrations/2022-01-04-144000-person-unique-identity.d.ts.map +1 -0
- package/dist/src/migrations/2022-01-04-144000-person-unique-identity.js +11 -0
- package/dist/src/migrations/2022-01-04-144000-person-unique-identity.js.map +1 -0
- package/dist/src/migrations/2022-02-09-111800-fix-crypted.d.ts +3 -0
- package/dist/src/migrations/2022-02-09-111800-fix-crypted.d.ts.map +1 -0
- package/dist/src/migrations/2022-02-09-111800-fix-crypted.js +22 -0
- package/dist/src/migrations/2022-02-09-111800-fix-crypted.js.map +1 -0
- package/dist/src/migrations/2022-02-11-153000-idp-auto-sign-up.d.ts +3 -0
- package/dist/src/migrations/2022-02-11-153000-idp-auto-sign-up.d.ts.map +1 -0
- package/dist/src/migrations/2022-02-11-153000-idp-auto-sign-up.js +11 -0
- package/dist/src/migrations/2022-02-11-153000-idp-auto-sign-up.js.map +1 -0
- package/dist/src/migrations/2022-06-29-105000-person-idp.d.ts +3 -0
- package/dist/src/migrations/2022-06-29-105000-person-idp.d.ts.map +1 -0
- package/dist/src/migrations/2022-06-29-105000-person-idp.js +23 -0
- package/dist/src/migrations/2022-06-29-105000-person-idp.js.map +1 -0
- package/dist/src/migrations/2022-07-07-135000-person-email-opt-uniq.d.ts +3 -0
- package/dist/src/migrations/2022-07-07-135000-person-email-opt-uniq.d.ts.map +1 -0
- package/dist/src/migrations/2022-07-07-135000-person-email-opt-uniq.js +12 -0
- package/dist/src/migrations/2022-07-07-135000-person-email-opt-uniq.js.map +1 -0
- package/dist/src/migrations/2022-07-07-141000-person-display-name.d.ts +3 -0
- package/dist/src/migrations/2022-07-07-141000-person-display-name.d.ts.map +1 -0
- package/dist/src/migrations/2022-07-07-141000-person-display-name.js +13 -0
- package/dist/src/migrations/2022-07-07-141000-person-display-name.js.map +1 -0
- package/dist/src/migrations/2022-07-14-145000-person-login-options.d.ts +3 -0
- package/dist/src/migrations/2022-07-14-145000-person-login-options.d.ts.map +1 -0
- package/dist/src/migrations/2022-07-14-145000-person-login-options.js +15 -0
- package/dist/src/migrations/2022-07-14-145000-person-login-options.js.map +1 -0
- package/dist/src/migrations/2022-11-08-project-update-notification.d.ts +3 -0
- package/dist/src/migrations/2022-11-08-project-update-notification.d.ts.map +1 -0
- package/dist/src/migrations/2022-11-08-project-update-notification.js +64 -0
- package/dist/src/migrations/2022-11-08-project-update-notification.js.map +1 -0
- package/dist/src/migrations/runner.d.ts +1 -1
- package/dist/src/migrations/runner.d.ts.map +1 -1
- package/dist/src/migrations/runner.js +68 -5
- package/dist/src/migrations/runner.js.map +1 -1
- package/dist/src/migrations/snapshot-factory.d.ts +5 -0
- package/dist/src/migrations/snapshot-factory.d.ts.map +1 -0
- package/dist/src/migrations/snapshot-factory.js +18 -0
- package/dist/src/migrations/snapshot-factory.js.map +1 -0
- package/dist/src/migrations/snapshot.d.ts +4 -0
- package/dist/src/migrations/snapshot.d.ts.map +1 -0
- package/dist/src/migrations/snapshot.js +202 -0
- package/dist/src/migrations/snapshot.js.map +1 -0
- package/dist/src/migrations/tenantCredentials.d.ts +4 -0
- package/dist/src/migrations/tenantCredentials.d.ts.map +1 -0
- package/dist/src/migrations/tenantCredentials.js +57 -0
- package/dist/src/migrations/tenantCredentials.js.map +1 -0
- package/dist/src/migrations/types.d.ts +2 -0
- package/dist/src/migrations/types.d.ts.map +1 -1
- package/dist/src/model/commands/idp/UpdateIdpCommand.d.ts +1 -0
- package/dist/src/model/commands/idp/UpdateIdpCommand.d.ts.map +1 -1
- package/dist/src/model/queries/membership/ProjectMembersQuery.d.ts +3 -3
- package/dist/src/model/queries/membership/ProjectMembersQuery.d.ts.map +1 -1
- package/dist/src/model/queries/membership/ProjectMembersQuery.js +22 -10
- package/dist/src/model/queries/membership/ProjectMembersQuery.js.map +1 -1
- package/dist/src/model/service/IDPSignInManager.d.ts +3 -3
- package/dist/src/model/service/IDPSignInManager.d.ts.map +1 -1
- package/dist/src/model/service/IDPSignInManager.js +13 -5
- package/dist/src/model/service/IDPSignInManager.js.map +1 -1
- package/dist/src/model/service/ProjectMemberManager.d.ts +2 -2
- package/dist/src/model/service/ProjectMemberManager.d.ts.map +1 -1
- package/dist/src/model/service/ProjectMemberManager.js +2 -2
- package/dist/src/model/service/ProjectMemberManager.js.map +1 -1
- package/dist/src/model/service/idp/IDPHandlerRegistry.d.ts +2 -2
- package/dist/src/model/service/idp/IDPHandlerRegistry.d.ts.map +1 -1
- package/dist/src/model/service/idp/IDPHandlerRegistry.js.map +1 -1
- package/dist/src/model/service/idp/IDPManager.d.ts.map +1 -1
- package/dist/src/model/service/idp/IDPManager.js +7 -2
- package/dist/src/model/service/idp/IDPManager.js.map +1 -1
- package/dist/src/model/service/idp/IdentityProviderHandler.d.ts +6 -9
- package/dist/src/model/service/idp/IdentityProviderHandler.d.ts.map +1 -1
- package/dist/src/model/service/idp/index.d.ts +3 -1
- package/dist/src/model/service/idp/index.d.ts.map +1 -1
- package/dist/src/model/service/idp/index.js +3 -1
- package/dist/src/model/service/idp/index.js.map +1 -1
- package/dist/src/model/service/idp/providers/AppleProvider.d.ts +29 -0
- package/dist/src/model/service/idp/providers/AppleProvider.d.ts.map +1 -0
- package/dist/src/model/service/idp/providers/AppleProvider.js +79 -0
- package/dist/src/model/service/idp/providers/AppleProvider.js.map +1 -0
- package/dist/src/model/service/idp/providers/FacebookProvider.d.ts +27 -0
- package/dist/src/model/service/idp/providers/FacebookProvider.d.ts.map +1 -0
- package/dist/src/model/service/idp/providers/FacebookProvider.js +137 -0
- package/dist/src/model/service/idp/providers/FacebookProvider.js.map +1 -0
- package/dist/src/model/service/idp/providers/OIDCHelpers.d.ts +10 -0
- package/dist/src/model/service/idp/providers/OIDCHelpers.d.ts.map +1 -0
- package/dist/src/model/service/idp/providers/OIDCHelpers.js +56 -0
- package/dist/src/model/service/idp/providers/OIDCHelpers.js.map +1 -0
- package/dist/src/model/service/idp/providers/OIDCProvider.d.ts +19 -0
- package/dist/src/model/service/idp/providers/OIDCProvider.d.ts.map +1 -0
- package/dist/src/model/service/idp/providers/OIDCProvider.js +40 -0
- package/dist/src/model/service/idp/providers/OIDCProvider.js.map +1 -0
- package/dist/src/model/service/idp/providers/OIDCTypes.d.ts +62 -0
- package/dist/src/model/service/idp/providers/OIDCTypes.d.ts.map +1 -0
- package/dist/src/model/service/idp/providers/OIDCTypes.js +56 -0
- package/dist/src/model/service/idp/providers/OIDCTypes.js.map +1 -0
- package/dist/src/model/service/idp/providers/helpers.d.ts +3 -0
- package/dist/src/model/service/idp/providers/helpers.d.ts.map +1 -0
- package/dist/src/model/service/idp/providers/helpers.js +40 -0
- package/dist/src/model/service/idp/providers/helpers.js.map +1 -0
- package/dist/src/model/utils/DatabaseContext.d.ts +1 -0
- package/dist/src/model/utils/DatabaseContext.d.ts.map +1 -1
- package/dist/src/model/utils/DatabaseContext.js +5 -0
- package/dist/src/model/utils/DatabaseContext.js.map +1 -1
- package/dist/src/resolvers/mutation/idp/UpdateIDPMutationResolver.d.ts.map +1 -1
- package/dist/src/resolvers/mutation/idp/UpdateIDPMutationResolver.js +4 -3
- package/dist/src/resolvers/mutation/idp/UpdateIDPMutationResolver.js.map +1 -1
- package/dist/src/resolvers/mutation/person/IDPMutationResolver.d.ts.map +1 -1
- package/dist/src/resolvers/mutation/person/IDPMutationResolver.js +10 -3
- package/dist/src/resolvers/mutation/person/IDPMutationResolver.js.map +1 -1
- package/dist/src/resolvers/types/ProjectTypeResolver.d.ts.map +1 -1
- package/dist/src/resolvers/types/ProjectTypeResolver.js +14 -6
- package/dist/src/resolvers/types/ProjectTypeResolver.js.map +1 -1
- package/dist/src/schema/index.d.ts +26 -8
- package/dist/src/schema/index.d.ts.map +1 -1
- package/dist/src/schema/index.js +1 -0
- package/dist/src/schema/index.js.map +1 -1
- package/dist/src/schema/tenant.graphql.d.ts.map +1 -1
- package/dist/src/schema/tenant.graphql.js +32 -6
- package/dist/src/schema/tenant.graphql.js.map +1 -1
- package/dist/src/tsconfig.tsbuildinfo +1 -1
- package/dist/tests/cases/integration/db/invite.test.js +2 -2
- package/dist/tests/cases/integration/db/unmanagedInvite.test.js +2 -2
- package/dist/{src → tests/cases}/migrations/2020-06-08-134000-tenant-credentials.test.d.ts +1 -1
- package/dist/tests/cases/migrations/2020-06-08-134000-tenant-credentials.test.d.ts.map +1 -0
- package/dist/{src → tests/cases}/migrations/2020-06-08-134000-tenant-credentials.test.js +19 -9
- package/dist/tests/cases/migrations/2020-06-08-134000-tenant-credentials.test.js.map +1 -0
- package/dist/tests/src/IdPMock.d.ts +4 -4
- package/dist/tests/src/IdPMock.d.ts.map +1 -1
- package/dist/tests/src/IdPMock.js +2 -2
- package/dist/tests/src/IdPMock.js.map +1 -1
- package/dist/tests/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -13
- package/src/TenantContainer.ts +4 -2
- package/src/bin/runMigrations.ts +32 -0
- package/src/migrations/{2018-08-02-174310-init.sql → 2018-08-02-174310-init.ts} +8 -1
- package/src/migrations/{2018-09-03-140621-identity-project.sql → 2018-09-03-140621-identity-project.ts} +8 -0
- package/src/migrations/{2018-10-26-165450-setup-api-key.sql → 2018-10-26-165450-setup-api-key.ts} +8 -0
- package/src/migrations/{2018-10-26-175155-variables.sql → 2018-10-26-175155-variables.ts} +7 -0
- package/src/migrations/{2019-02-18-110949-project-slug.sql → 2019-02-18-110949-project-slug.ts} +8 -0
- package/src/migrations/2019-02-18-160155-session-expiration.ts +10 -0
- package/src/migrations/{2019-05-03-163729-api-key-disabled-at.sql → 2019-05-03-163729-api-key-disabled-at.ts} +8 -0
- package/src/migrations/2019-08-14-153300-project-slug-unique.ts +10 -0
- package/src/migrations/{2019-09-06-111000-membership.sql → 2019-09-06-111000-membership.ts} +8 -0
- package/src/migrations/2019-09-06-111001-drop-old-member.ts +10 -0
- package/src/migrations/2020-01-29-idenity-note.ts +18 -0
- package/src/migrations/2020-04-17-fix-person-index.ts +12 -0
- package/src/migrations/2020-05-01-170000-api-key-index.ts +10 -0
- package/src/migrations/2020-06-08-134000-tenant-credentials.ts +3 -54
- package/src/migrations/2020-08-07-110000-person-otp.ts +12 -0
- package/src/migrations/{2020-08-17-162200-mail-templates.sql → 2020-08-17-162200-mail-templates.ts} +8 -0
- package/src/migrations/{2020-08-21-143400-person-password-reset.sql → 2020-08-21-143400-person-password-reset.ts} +8 -0
- package/src/migrations/{2020-09-07-094200-identity-provider.sql → 2020-09-07-094200-identity-provider.ts} +8 -0
- package/src/migrations/{2021-03-28-134000-timestamp.sql → 2021-03-28-134000-timestamp.ts} +9 -0
- package/src/migrations/2021-07-26-105000-project-config.ts +12 -0
- package/src/migrations/{2021-07-26-132000-project-secrets.sql → 2021-07-26-132000-project-secrets.ts} +8 -0
- package/src/migrations/2021-07-27-174000-project-alias-index.ts +10 -0
- package/src/migrations/2021-11-24-130000-person-password-null.ts +10 -0
- package/src/migrations/{2021-11-24-161500-mail-template-project-null.sql → 2021-11-24-161500-mail-template-project-null.ts} +8 -0
- package/src/migrations/2022-01-04-144000-person-unique-identity.ts +10 -0
- package/src/migrations/{2022-02-09-111800-fix-crypted.sql → 2022-02-09-111800-fix-crypted.ts} +8 -0
- package/src/migrations/2022-02-11-153000-idp-auto-sign-up.ts +10 -0
- package/src/migrations/{2022-06-29-105000-person-idp.sql → 2022-06-29-105000-person-idp.ts} +8 -0
- package/src/migrations/2022-07-07-135000-person-email-opt-uniq.ts +11 -0
- package/src/migrations/2022-07-07-141000-person-display-name.ts +13 -0
- package/src/migrations/{2022-07-14-145000-person-login-options.sql → 2022-07-14-145000-person-login-options.ts} +9 -0
- package/src/migrations/2022-11-08-project-update-notification.ts +64 -0
- package/src/migrations/runner.ts +72 -8
- package/src/migrations/snapshot-factory.ts +21 -0
- package/src/migrations/snapshot-template-end.txt +10 -0
- package/src/migrations/snapshot-template-start.txt +6 -0
- package/src/migrations/snapshot.ts +202 -0
- package/src/migrations/tenantCredentials.ts +58 -0
- package/src/migrations/types.ts +3 -0
- package/src/model/commands/idp/UpdateIdpCommand.ts +1 -0
- package/src/model/queries/membership/ProjectMembersQuery.ts +23 -14
- package/src/model/service/IDPSignInManager.ts +13 -10
- package/src/model/service/ProjectMemberManager.ts +3 -3
- package/src/model/service/idp/IDPHandlerRegistry.ts +3 -3
- package/src/model/service/idp/IDPManager.ts +6 -2
- package/src/model/service/idp/IdentityProviderHandler.ts +7 -15
- package/src/model/service/idp/index.ts +3 -1
- package/src/model/service/idp/providers/AppleProvider.ts +65 -0
- package/src/model/service/idp/providers/FacebookProvider.ts +125 -0
- package/src/model/service/idp/providers/OIDCHelpers.ts +54 -0
- package/src/model/service/idp/providers/OIDCProvider.ts +40 -0
- package/src/model/service/idp/providers/OIDCTypes.ts +61 -0
- package/src/model/service/idp/providers/helpers.ts +12 -0
- package/src/model/utils/DatabaseContext.ts +6 -0
- package/src/resolvers/mutation/idp/UpdateIDPMutationResolver.ts +1 -0
- package/src/resolvers/mutation/person/IDPMutationResolver.ts +9 -7
- package/src/resolvers/types/ProjectTypeResolver.ts +9 -2
- package/src/schema/index.ts +28 -8
- package/src/schema/tenant.graphql.ts +32 -6
- package/src/tsconfig.json +10 -30
- package/tests/cases/integration/db/invite.test.ts +2 -2
- package/tests/cases/integration/db/unmanagedInvite.test.ts +2 -2
- package/{src → tests/cases}/migrations/2020-06-08-134000-tenant-credentials.test.ts +17 -9
- package/tests/src/IdPMock.ts +4 -4
- package/tests/tsconfig.json +2 -6
- package/tsconfig.json +2 -6
- package/dist/src/migrations/2020-06-08-134000-tenant-credentials.test.d.ts.map +0 -1
- package/dist/src/migrations/2020-06-08-134000-tenant-credentials.test.js.map +0 -1
- package/dist/src/model/service/idp/OIDCProvider.d.ts +0 -25
- package/dist/src/model/service/idp/OIDCProvider.d.ts.map +0 -1
- package/dist/src/model/service/idp/OIDCProvider.js +0 -108
- package/dist/src/model/service/idp/OIDCProvider.js.map +0 -1
- package/src/migrations/2019-02-18-160155-session-expiration.sql +0 -2
- package/src/migrations/2019-08-14-153300-project-slug-unique.sql +0 -2
- package/src/migrations/2019-09-06-111001-drop-old-member.sql +0 -2
- package/src/migrations/2020-01-29-idenity-note.sql +0 -9
- package/src/migrations/2020-04-17-fix-person-index.sql +0 -3
- package/src/migrations/2020-05-01-170000-api-key-index.sql +0 -1
- package/src/migrations/2020-08-07-110000-person-otp.sql +0 -3
- package/src/migrations/2021-07-26-105000-project-config.sql +0 -3
- package/src/migrations/2021-07-27-174000-project-alias-index.sql +0 -1
- package/src/migrations/2021-11-24-130000-person-password-null.sql +0 -1
- package/src/migrations/2022-01-04-144000-person-unique-identity.sql +0 -2
- package/src/migrations/2022-02-11-153000-idp-auto-sign-up.sql +0 -2
- package/src/migrations/2022-07-07-135000-person-email-opt-uniq.sql +0 -3
- package/src/migrations/2022-07-07-141000-person-display-name.sql +0 -4
- package/src/model/service/idp/OIDCProvider.ts +0 -100
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.FacebookProvider = void 0;
|
|
27
|
+
const Typesafe = __importStar(require("@contember/typesafe"));
|
|
28
|
+
const openid_client_1 = require("openid-client");
|
|
29
|
+
const IDPValidationError_1 = require("../IDPValidationError");
|
|
30
|
+
const InvalidIDPConfigurationError_1 = require("../InvalidIDPConfigurationError");
|
|
31
|
+
const helpers_1 = require("./helpers");
|
|
32
|
+
const OIDCTypes_1 = require("./OIDCTypes");
|
|
33
|
+
const OIDCHelpers_1 = require("./OIDCHelpers");
|
|
34
|
+
const node_crypto_1 = require("node:crypto");
|
|
35
|
+
const IDPResponseError_1 = require("../IDPResponseError");
|
|
36
|
+
const FacebookConfiguration = OIDCTypes_1.BaseOIDCConfiguration;
|
|
37
|
+
const FacebookResponseData = Typesafe.union(OIDCTypes_1.OIDCResponseData, Typesafe.object({
|
|
38
|
+
authResponse: Typesafe.object({
|
|
39
|
+
accessToken: Typesafe.string,
|
|
40
|
+
signedRequest: Typesafe.string,
|
|
41
|
+
}),
|
|
42
|
+
}));
|
|
43
|
+
const FacebookResponsePayload = Typesafe.object({
|
|
44
|
+
user_id: Typesafe.string,
|
|
45
|
+
code: Typesafe.string,
|
|
46
|
+
});
|
|
47
|
+
class FacebookProvider {
|
|
48
|
+
constructor() {
|
|
49
|
+
// based on https://www.facebook.com/.well-known/openid-configuration/
|
|
50
|
+
// facebook .well-known endpoint does have "token_endpoint" field
|
|
51
|
+
this.facebookIssuer = new openid_client_1.Issuer({
|
|
52
|
+
issuer: 'https://www.facebook.com',
|
|
53
|
+
authorization_endpoint: 'https://facebook.com/dialog/oauth/',
|
|
54
|
+
jwks_uri: 'https://www.facebook.com/.well-known/oauth/openid/jwks/',
|
|
55
|
+
response_types_supported: [
|
|
56
|
+
'id_token',
|
|
57
|
+
'token id_token',
|
|
58
|
+
],
|
|
59
|
+
subject_types_supported: [
|
|
60
|
+
'pairwise',
|
|
61
|
+
],
|
|
62
|
+
id_token_signing_alg_values_supported: [
|
|
63
|
+
'RS256',
|
|
64
|
+
],
|
|
65
|
+
claims_supported: [
|
|
66
|
+
'iss',
|
|
67
|
+
'aud',
|
|
68
|
+
'sub',
|
|
69
|
+
'iat',
|
|
70
|
+
'exp',
|
|
71
|
+
'jti',
|
|
72
|
+
'nonce',
|
|
73
|
+
'at_hash',
|
|
74
|
+
'name',
|
|
75
|
+
'given_name',
|
|
76
|
+
'middle_name',
|
|
77
|
+
'family_name',
|
|
78
|
+
'email',
|
|
79
|
+
'picture',
|
|
80
|
+
'user_friends',
|
|
81
|
+
'user_birthday',
|
|
82
|
+
'user_age_range',
|
|
83
|
+
'user_link',
|
|
84
|
+
'user_hometown',
|
|
85
|
+
'user_location',
|
|
86
|
+
'user_gender',
|
|
87
|
+
],
|
|
88
|
+
token_endpoint: 'https://graph.facebook.com/v11.0/oauth/access_token',
|
|
89
|
+
});
|
|
90
|
+
this.validateConfiguration = (0, helpers_1.catchTypesafe)(FacebookConfiguration, InvalidIDPConfigurationError_1.InvalidIDPConfigurationError);
|
|
91
|
+
}
|
|
92
|
+
async initAuth(configuration, data) {
|
|
93
|
+
const initData = (0, helpers_1.catchTypesafe)(OIDCTypes_1.OIDCInitData, IDPValidationError_1.IDPValidationError)(data);
|
|
94
|
+
const client = await this.createOIDCClient(configuration);
|
|
95
|
+
return await (0, OIDCHelpers_1.initOIDCAuth)(client, {
|
|
96
|
+
claims: configuration.claims,
|
|
97
|
+
...initData,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
async processResponse(configuration, data) {
|
|
101
|
+
const responseData = (0, helpers_1.catchTypesafe)(FacebookResponseData, IDPValidationError_1.IDPValidationError)(data);
|
|
102
|
+
if (!('authResponse' in responseData)) {
|
|
103
|
+
const client = await this.createOIDCClient(configuration);
|
|
104
|
+
return await (0, OIDCHelpers_1.handleOIDCResponse)(client, responseData);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
const [sig, payload] = responseData.authResponse.signedRequest.split('.');
|
|
108
|
+
const data = (0, helpers_1.catchTypesafe)(FacebookResponsePayload, IDPValidationError_1.IDPValidationError)(JSON.parse(Buffer.from(payload, 'base64').toString('utf8')));
|
|
109
|
+
const hmac = (0, node_crypto_1.createHmac)('sha256', configuration.clientSecret);
|
|
110
|
+
const signature = hmac.update(payload).digest();
|
|
111
|
+
const isSignatureValid = signature.compare(Buffer.from(sig, 'base64')) === 0;
|
|
112
|
+
if (!isSignatureValid) {
|
|
113
|
+
throw new IDPValidationError_1.IDPValidationError('Invalid signature');
|
|
114
|
+
}
|
|
115
|
+
const url = `https://graph.facebook.com/${data.user_id}?fields=id,email,name&access_token=${responseData.authResponse.accessToken}`;
|
|
116
|
+
const response = await fetch(url);
|
|
117
|
+
if (!response.ok) {
|
|
118
|
+
throw new IDPResponseError_1.IDPResponseError(`Invalid Facebook response: [${response.status}] ${await response.text()}`);
|
|
119
|
+
}
|
|
120
|
+
const apiData = await response.json();
|
|
121
|
+
return {
|
|
122
|
+
externalIdentifier: data.user_id,
|
|
123
|
+
name: apiData.name,
|
|
124
|
+
email: apiData.email,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
async createOIDCClient(configuration) {
|
|
129
|
+
return new this.facebookIssuer.Client({
|
|
130
|
+
client_id: configuration.clientId,
|
|
131
|
+
client_secret: configuration.clientSecret,
|
|
132
|
+
response_types: [configuration.responseType || 'code'],
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exports.FacebookProvider = FacebookProvider;
|
|
137
|
+
//# sourceMappingURL=FacebookProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FacebookProvider.js","sourceRoot":"","sources":["../../../../../../src/model/service/idp/providers/FacebookProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAA+C;AAC/C,iDAA8C;AAE9C,8DAA0D;AAC1D,kFAA8E;AAC9E,uCAAyC;AACzC,2CAAmF;AACnF,+CAAgE;AAChE,6CAAwC;AACxC,0DAAsD;AAItD,MAAM,qBAAqB,GAAG,iCAAqB,CAAA;AAGnD,MAAM,oBAAoB,GAAG,QAAQ,CAAC,KAAK,CAC1C,4BAAgB,EAChB,QAAQ,CAAC,MAAM,CA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8BAA8B,IAAI,CAAC,OAAO,sCAAsC,YAAY,CAAC,YAAY,CAAC,WAAW,EAAE,CAAA;YACnI,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;YACjC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;gBACjB,MAAM,IAAI,mCAAgB,CAAC,+BAA+B,QAAQ,CAAC,MAAM,KAAK,MAAM,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;aACtG;YACD,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;YAErC,OAAO;gBACN,kBAAkB,EAAE,IAAI,CAAC,OAAO;gBAChC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;aACpB,CAAA;SACD;IACF,CAAC;IAEO,KAAK,CAAC,gBAAgB,CAAC,aAAoC;QAClE,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;YACrC,SAAS,EAAE,aAAa,CAAC,QAAQ;YACjC,aAAa,EAAE,aAAa,CAAC,YAAY;YACzC,cAAc,EAAE,CAAC,aAAa,CAAC,YAAY,IAAI,MAAM,CAAC;SACtD,CAAC,CAAA;IACH,CAAC;CACD;AA3FD,4CA2FC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Client } from 'openid-client';
|
|
2
|
+
import { OIDCResponseData } from './OIDCTypes';
|
|
3
|
+
import { IDPClaim, InitIDPAuthResult } from '../IdentityProviderHandler';
|
|
4
|
+
export declare const initOIDCAuth: (client: Client, { redirectUrl, claims, responseMode }: {
|
|
5
|
+
redirectUrl: string;
|
|
6
|
+
claims?: string | undefined;
|
|
7
|
+
responseMode?: string | undefined;
|
|
8
|
+
}) => Promise<InitIDPAuthResult>;
|
|
9
|
+
export declare const handleOIDCResponse: (client: Client, { sessionData, redirectUrl, ...otherData }: OIDCResponseData) => Promise<IDPClaim>;
|
|
10
|
+
//# sourceMappingURL=OIDCHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OIDCHelpers.d.ts","sourceRoot":"","sources":["../../../../../../src/model/service/idp/providers/OIDCHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA8B,MAAM,eAAe,CAAA;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAG9C,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAMxE,eAAO,MAAM,YAAY,WAAkB,MAAM;iBAAwD,MAAM;;;MAA6C,QAAQ,iBAAiB,CAepL,CAAA;AAED,eAAO,MAAM,kBAAkB,WAAkB,MAAM,8CAA8C,gBAAgB,KAAG,QAAQ,QAAQ,CA0BvI,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleOIDCResponse = exports.initOIDCAuth = void 0;
|
|
4
|
+
const openid_client_1 = require("openid-client");
|
|
5
|
+
const IDPValidationError_1 = require("../IDPValidationError");
|
|
6
|
+
const IDPResponseError_1 = require("../IDPResponseError");
|
|
7
|
+
openid_client_1.custom.setHttpOptionsDefaults({
|
|
8
|
+
timeout: 5000,
|
|
9
|
+
});
|
|
10
|
+
const initOIDCAuth = async (client, { redirectUrl, claims, responseMode }) => {
|
|
11
|
+
const nonce = openid_client_1.generators.nonce();
|
|
12
|
+
const state = openid_client_1.generators.state();
|
|
13
|
+
const url = client.authorizationUrl({
|
|
14
|
+
redirect_uri: redirectUrl,
|
|
15
|
+
response_mode: responseMode,
|
|
16
|
+
scope: claims !== null && claims !== void 0 ? claims : 'openid email',
|
|
17
|
+
nonce,
|
|
18
|
+
state,
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
authUrl: url,
|
|
22
|
+
sessionData: { nonce, state },
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
exports.initOIDCAuth = initOIDCAuth;
|
|
26
|
+
const handleOIDCResponse = async (client, { sessionData, redirectUrl, ...otherData }) => {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
const params = 'parameters' in otherData ? otherData.parameters : client.callbackParams(otherData.url);
|
|
29
|
+
if (params.state && !(sessionData === null || sessionData === void 0 ? void 0 : sessionData.state)) {
|
|
30
|
+
throw new IDPValidationError_1.IDPValidationError(`state is present in parameters, but missing in session data`);
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
const result = await client.callback(redirectUrl, params, sessionData);
|
|
34
|
+
const claims = result.claims();
|
|
35
|
+
return {
|
|
36
|
+
externalIdentifier: claims.sub,
|
|
37
|
+
email: claims.email,
|
|
38
|
+
name: claims.name,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
catch (e) {
|
|
42
|
+
if (e instanceof openid_client_1.errors.RPError) {
|
|
43
|
+
throw new IDPValidationError_1.IDPValidationError(e.message);
|
|
44
|
+
}
|
|
45
|
+
if (e instanceof openid_client_1.errors.OPError) {
|
|
46
|
+
const body = (_a = e.response) === null || _a === void 0 ? void 0 : _a.body;
|
|
47
|
+
if (typeof body === 'object' && typeof (body === null || body === void 0 ? void 0 : body.error) === 'object' && typeof ((_b = body.error) === null || _b === void 0 ? void 0 : _b.message) === 'string') {
|
|
48
|
+
throw new IDPResponseError_1.IDPResponseError(body.error.message);
|
|
49
|
+
}
|
|
50
|
+
throw new IDPResponseError_1.IDPResponseError(e.message);
|
|
51
|
+
}
|
|
52
|
+
throw e;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
exports.handleOIDCResponse = handleOIDCResponse;
|
|
56
|
+
//# sourceMappingURL=OIDCHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OIDCHelpers.js","sourceRoot":"","sources":["../../../../../../src/model/service/idp/providers/OIDCHelpers.ts"],"names":[],"mappings":";;;AAAA,iDAAkE;AAElE,8DAA0D;AAC1D,0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C9B,OAAO;YACN,kBAAkB,EAAE,MAAM,CAAC,GAAG;YAC9B,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,IAAI,EAAE,MAAM,CAAC,IAAI;SACjB,CAAA;KACD;IAAC,OAAO,CAAM,EAAE;QAChB,IAAI,CAAC,YAAY,sBAAM,CAAC,OAAO,EAAE;YAChC,MAAM,IAAI,uCAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;SACvC;QACD,IAAI,CAAC,YAAY,sBAAM,CAAC,OAAO,EAAE;YAChC,MAAM,IAAI,GAAG,MAAA,CAAC,CAAC,QAAQ,0CAAE,IAAW,CAAA;YACpC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAA,KAAK,QAAQ,IAAI,OAAO,CAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,OAAO,CAAA,KAAK,QAAQ,EAAE;gBAC3G,MAAM,IAAI,mCAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;aAC9C;YACD,MAAM,IAAI,mCAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;SACrC;QACD,MAAM,CAAC,CAAA;KACP;AACF,CAAC,CAAA;AA1BY,QAAA,kBAAkB,sBA0B9B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IdentityProviderHandler, IDPClaim, InitIDPAuthResult } from '../IdentityProviderHandler';
|
|
2
|
+
import { OIDCConfiguration } from './OIDCTypes';
|
|
3
|
+
export declare class OIDCProvider implements IdentityProviderHandler<OIDCConfiguration> {
|
|
4
|
+
private issuerCache;
|
|
5
|
+
validateConfiguration: (value: unknown) => {
|
|
6
|
+
readonly url: string;
|
|
7
|
+
readonly clientId: string;
|
|
8
|
+
readonly clientSecret: string;
|
|
9
|
+
} & {
|
|
10
|
+
readonly responseType?: string | undefined;
|
|
11
|
+
readonly claims?: string | undefined;
|
|
12
|
+
} & {
|
|
13
|
+
readonly url: string;
|
|
14
|
+
};
|
|
15
|
+
initAuth(configuration: OIDCConfiguration, data: unknown): Promise<InitIDPAuthResult>;
|
|
16
|
+
processResponse(configuration: OIDCConfiguration, data: unknown): Promise<IDPClaim>;
|
|
17
|
+
private createOIDCClient;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=OIDCProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OIDCProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/model/service/idp/providers/OIDCProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAGjG,OAAO,EAAE,iBAAiB,EAAkC,MAAM,aAAa,CAAA;AAK/E,qBAAa,YAAa,YAAW,uBAAuB,CAAC,iBAAiB,CAAC;IAC9E,OAAO,CAAC,WAAW,CAAqC;IAExD,qBAAqB;;;;;;;;;MAAiE;IAEzE,QAAQ,CAAC,aAAa,EAAE,iBAAiB,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC;IASrF,eAAe,CAAC,aAAa,EAAE,iBAAiB,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;YAOlF,gBAAgB;CAS9B"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OIDCProvider = void 0;
|
|
4
|
+
const openid_client_1 = require("openid-client");
|
|
5
|
+
const InvalidIDPConfigurationError_1 = require("../InvalidIDPConfigurationError");
|
|
6
|
+
const helpers_1 = require("./helpers");
|
|
7
|
+
const OIDCTypes_1 = require("./OIDCTypes");
|
|
8
|
+
const OIDCHelpers_1 = require("./OIDCHelpers");
|
|
9
|
+
const IDPValidationError_1 = require("../IDPValidationError");
|
|
10
|
+
class OIDCProvider {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.issuerCache = {};
|
|
13
|
+
this.validateConfiguration = (0, helpers_1.catchTypesafe)(OIDCTypes_1.OIDCConfiguration, InvalidIDPConfigurationError_1.InvalidIDPConfigurationError);
|
|
14
|
+
}
|
|
15
|
+
async initAuth(configuration, data) {
|
|
16
|
+
const initData = (0, helpers_1.catchTypesafe)(OIDCTypes_1.OIDCInitData, IDPValidationError_1.IDPValidationError)(data);
|
|
17
|
+
const client = await this.createOIDCClient(configuration);
|
|
18
|
+
return await (0, OIDCHelpers_1.initOIDCAuth)(client, {
|
|
19
|
+
claims: configuration.claims,
|
|
20
|
+
...initData,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
async processResponse(configuration, data) {
|
|
24
|
+
const responseData = (0, helpers_1.catchTypesafe)(OIDCTypes_1.OIDCResponseData, IDPValidationError_1.IDPValidationError)(data);
|
|
25
|
+
const client = await this.createOIDCClient(configuration);
|
|
26
|
+
return await (0, OIDCHelpers_1.handleOIDCResponse)(client, responseData);
|
|
27
|
+
}
|
|
28
|
+
async createOIDCClient(configuration) {
|
|
29
|
+
var _a;
|
|
30
|
+
var _b, _c;
|
|
31
|
+
(_a = (_b = this.issuerCache)[_c = configuration.url]) !== null && _a !== void 0 ? _a : (_b[_c] = await openid_client_1.Issuer.discover(configuration.url));
|
|
32
|
+
return new this.issuerCache[configuration.url].Client({
|
|
33
|
+
client_id: configuration.clientId,
|
|
34
|
+
client_secret: configuration.clientSecret,
|
|
35
|
+
response_types: [configuration.responseType || 'code'],
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.OIDCProvider = OIDCProvider;
|
|
40
|
+
//# sourceMappingURL=OIDCProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OIDCProvider.js","sourceRoot":"","sources":["../../../../../../src/model/service/idp/providers/OIDCProvider.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAE9C,kFAA8E;AA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IAAI,MAAM,CAAC;SACtD,CAAC,CAAA;IACH,CAAC;CACD;AA9BD,oCA8BC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as Typesafe from '@contember/typesafe';
|
|
2
|
+
export interface OIDCSessionData {
|
|
3
|
+
nonce: string;
|
|
4
|
+
state: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const OIDCConfigurationOptions: {
|
|
7
|
+
(input: unknown, path?: PropertyKey[] | undefined): {
|
|
8
|
+
readonly responseType?: string | undefined;
|
|
9
|
+
readonly claims?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
inner: {
|
|
12
|
+
responseType: Typesafe.Type<string>;
|
|
13
|
+
claims: Typesafe.Type<string>;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare const BaseOIDCConfiguration: Typesafe.Type<{
|
|
17
|
+
readonly url: string;
|
|
18
|
+
readonly clientId: string;
|
|
19
|
+
readonly clientSecret: string;
|
|
20
|
+
} & {
|
|
21
|
+
readonly responseType?: string | undefined;
|
|
22
|
+
readonly claims?: string | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const OIDCConfiguration: Typesafe.Type<{
|
|
25
|
+
readonly url: string;
|
|
26
|
+
readonly clientId: string;
|
|
27
|
+
readonly clientSecret: string;
|
|
28
|
+
} & {
|
|
29
|
+
readonly responseType?: string | undefined;
|
|
30
|
+
readonly claims?: string | undefined;
|
|
31
|
+
} & {
|
|
32
|
+
readonly url: string;
|
|
33
|
+
}>;
|
|
34
|
+
export declare type OIDCConfiguration = ReturnType<typeof OIDCConfiguration>;
|
|
35
|
+
export declare const OIDCResponseData: Typesafe.Type<({
|
|
36
|
+
readonly url: string;
|
|
37
|
+
} | {
|
|
38
|
+
readonly parameters: {
|
|
39
|
+
readonly [x: string]: string;
|
|
40
|
+
};
|
|
41
|
+
}) & {
|
|
42
|
+
readonly redirectUrl?: string | undefined;
|
|
43
|
+
readonly sessionData?: {
|
|
44
|
+
readonly nonce?: string | undefined;
|
|
45
|
+
readonly state?: string | undefined;
|
|
46
|
+
} | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
export declare type OIDCResponseData = ReturnType<typeof OIDCResponseData>;
|
|
49
|
+
export declare const OIDCInitData: {
|
|
50
|
+
(input: unknown, path?: PropertyKey[] | undefined): {
|
|
51
|
+
readonly redirectUrl: string;
|
|
52
|
+
} & {
|
|
53
|
+
readonly responseMode?: string | undefined;
|
|
54
|
+
};
|
|
55
|
+
inner: Typesafe.Type<{
|
|
56
|
+
readonly redirectUrl: string;
|
|
57
|
+
} & {
|
|
58
|
+
readonly responseMode?: string | undefined;
|
|
59
|
+
}>;
|
|
60
|
+
};
|
|
61
|
+
export declare type OIDCInitData = ReturnType<typeof OIDCInitData>;
|
|
62
|
+
//# sourceMappingURL=OIDCTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OIDCTypes.d.ts","sourceRoot":"","sources":["../../../../../../src/model/service/idp/providers/OIDCTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAA;AAG/C,MAAM,WAAW,eAAe;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACb;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;CAGnC,CAAA;AACF,eAAO,MAAM,qBAAqB;;;;;;;EAOjC,CAAA;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;EAK7B,CAAA;AAED,oBAAY,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAEpE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EAiB5B,CAAA;AAED,oBAAY,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAElE,eAAO,MAAM,YAAY;;;;;;;;;;;CAOvB,CAAA;AAEF,oBAAY,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.OIDCInitData = exports.OIDCResponseData = exports.OIDCConfiguration = exports.BaseOIDCConfiguration = exports.OIDCConfigurationOptions = void 0;
|
|
27
|
+
const Typesafe = __importStar(require("@contember/typesafe"));
|
|
28
|
+
exports.OIDCConfigurationOptions = Typesafe.partial({
|
|
29
|
+
responseType: Typesafe.enumeration('code', 'code id_token', 'code id_token token', 'code token', 'id_token', 'id_token token', 'none'),
|
|
30
|
+
claims: Typesafe.string,
|
|
31
|
+
});
|
|
32
|
+
exports.BaseOIDCConfiguration = Typesafe.intersection(Typesafe.object({
|
|
33
|
+
url: Typesafe.string,
|
|
34
|
+
clientId: Typesafe.string,
|
|
35
|
+
clientSecret: Typesafe.string,
|
|
36
|
+
}), exports.OIDCConfigurationOptions);
|
|
37
|
+
exports.OIDCConfiguration = Typesafe.intersection(exports.BaseOIDCConfiguration, Typesafe.object({
|
|
38
|
+
url: Typesafe.string,
|
|
39
|
+
}));
|
|
40
|
+
exports.OIDCResponseData = Typesafe.intersection(Typesafe.union(Typesafe.object({
|
|
41
|
+
url: Typesafe.string,
|
|
42
|
+
}), Typesafe.object({
|
|
43
|
+
parameters: Typesafe.record(Typesafe.string, Typesafe.string),
|
|
44
|
+
})), Typesafe.partial({
|
|
45
|
+
redirectUrl: Typesafe.string,
|
|
46
|
+
sessionData: Typesafe.partial({
|
|
47
|
+
nonce: Typesafe.string,
|
|
48
|
+
state: Typesafe.string,
|
|
49
|
+
}),
|
|
50
|
+
}));
|
|
51
|
+
exports.OIDCInitData = Typesafe.noExtraProps(Typesafe.intersection(Typesafe.object({
|
|
52
|
+
redirectUrl: Typesafe.string,
|
|
53
|
+
}), Typesafe.partial({
|
|
54
|
+
responseMode: Typesafe.string,
|
|
55
|
+
})));
|
|
56
|
+
//# sourceMappingURL=OIDCTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OIDCTypes.js","sourceRoot":"","sources":["../../../../../../src/model/service/idp/providers/OIDCTypes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAA+C;AAQlC,QAAA,wBAAwB,GAAG,QAAQ,CAAC,OAAO,CAAC;IACxD,YAAY,EAAE,QAAQ,CAAC,WAAW,CAAe,MAAM,EAAE,eAAe,EAAE,qBAAqB,EAAE,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,CAAC;IACpJ,MAAM,EAAE,QAAQ,CAAC,MAAM;CACvB,CAAC,CAAA;AACW,QAAA,qBAAqB,GAAG,QAAQ,CAAC,YAAY,CACzD,QAAQ,CA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AqB,CAAA;AAE/C,eAAO,MAAM,aAAa,oFAAsF,MAAM,KAAG,KAAK,aAAe,OAAO,MASnJ,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.catchTypesafe = void 0;
|
|
27
|
+
const Typesafe = __importStar(require("@contember/typesafe"));
|
|
28
|
+
const catchTypesafe = (type, errorConstructor) => (value) => {
|
|
29
|
+
try {
|
|
30
|
+
return type(value);
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
if (e instanceof Typesafe.ParseError) {
|
|
34
|
+
throw new errorConstructor(e.message);
|
|
35
|
+
}
|
|
36
|
+
throw e;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.catchTypesafe = catchTypesafe;
|
|
40
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../src/model/service/idp/providers/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAA+C;AAExC,MAAM,aAAa,GAAG,CAA0B,IAAsB,EAAE,gBAAiD,EAAE,EAAE,CAAC,CAAC,KAAc,EAAK,EAAE;IAC1J,IAAI;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,CAAA;KAClB;IAAC,OAAO,CAAC,EAAE;QACX,IAAI,CAAC,YAAY,QAAQ,CAAC,UAAU,EAAE;YACrC,MAAM,IAAI,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;SACrC;QACD,MAAM,CAAC,CAAA;KACP;AACF,CAAC,CAAA;AATY,QAAA,aAAa,iBASzB"}
|
|
@@ -10,6 +10,7 @@ export declare class DatabaseContext<Conn extends Connection.ConnectionLike = Co
|
|
|
10
10
|
get commandBus(): CommandBus<Conn>;
|
|
11
11
|
get queryHandler(): import("@contember/queryable").QueryHandler<import("@contember/database").DatabaseQueryable>;
|
|
12
12
|
transaction<T>(cb: (dbContext: DatabaseContext<Connection.TransactionLike>) => Promise<T>): Promise<T>;
|
|
13
|
+
scope<T>(cb: (dbContext: DatabaseContext<Connection.AcquiredConnectionLike>) => Promise<T>): Promise<T>;
|
|
13
14
|
batchLoad<Arg, Result, Item>(loaderArgs: BatchLoaderArgs<Arg, Result, Item>, arg: Arg): Promise<Item>;
|
|
14
15
|
}
|
|
15
16
|
export declare class DatabaseContextFactory {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatabaseContext.d.ts","sourceRoot":"","sources":["../../../../src/model/utils/DatabaseContext.ts"],"names":[],"mappings":"AAA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,UAAU,qBAEpB;IAED,IAAW,YAAY,iGAEtB;IAEY,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC,UAAU,CAAC,eAAe,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAOtG,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,SAAS,EAAE,eAAe,CAAC,UAAU,CAAC,sBAAsB,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAM7G,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAS5G;AAED,qBAAa,sBAAsB;IAEjC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,SAAS;gBADT,UAAU,EAAE,UAAU,CAAC,aAAa,EACpC,SAAS,EAAE,SAAS;IAI/B,MAAM,IAAI,eAAe;CAGhC"}
|
|
@@ -22,6 +22,11 @@ class DatabaseContext {
|
|
|
22
22
|
return await cb(new DatabaseContext(db, this.providers));
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
+
async scope(cb) {
|
|
26
|
+
return await this.client.scope(async (db) => {
|
|
27
|
+
return await cb(new DatabaseContext(db, this.providers));
|
|
28
|
+
});
|
|
29
|
+
}
|
|
25
30
|
batchLoad(loaderArgs, arg) {
|
|
26
31
|
const existing = this.loaders.get(loaderArgs);
|
|
27
32
|
if (existing) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatabaseContext.js","sourceRoot":"","sources":["../../../../src/model/utils/DatabaseContext.ts"],"names":[],"mappings":";;;AAAA,kDAAwD;AAExD,0CAAwC;AACxC,uDAAqF;AAErF,MAAa,eAAe;IAG3B,YAC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EAAE,SAAS,CAAC,CAAA;QACvC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAA;IACtB,CAAC;CACD;AAvCD,0CAuCC;AAED,MAAa,sBAAsB;IAClC,YACkB,UAAoC,EACpC,SAAoB;QADpB,eAAU,GAAV,UAAU,CAA0B;QACpC,cAAS,GAAT,SAAS,CAAW;IAEtC,CAAC;IAEM,MAAM;QACZ,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;IACzG,CAAC;CACD;AAVD,wDAUC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateIDPMutationResolver.d.ts","sourceRoot":"","sources":["../../../../../src/resolvers/mutation/idp/UpdateIDPMutationResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAE7F,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAA;AAElE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,qBAAa,yBAA0B,YAAW,iBAAiB;IACtD,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAG7C,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"UpdateIDPMutationResolver.d.ts","sourceRoot":"","sources":["../../../../../src/resolvers/mutation/idp/UpdateIDPMutationResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAE7F,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAA;AAElE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,qBAAa,yBAA0B,YAAW,iBAAiB;IACtD,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAG7C,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAmBrH"}
|
|
@@ -8,16 +8,17 @@ class UpdateIDPMutationResolver {
|
|
|
8
8
|
this.idpManager = idpManager;
|
|
9
9
|
}
|
|
10
10
|
async updateIDP(parent, args, context) {
|
|
11
|
-
var _a, _b, _c, _d;
|
|
11
|
+
var _a, _b, _c, _d, _e;
|
|
12
12
|
await context.requireAccess({
|
|
13
13
|
action: model_1.PermissionActions.IDP_UPDATE,
|
|
14
14
|
message: 'You are not allowed to update IDP',
|
|
15
15
|
});
|
|
16
16
|
const result = await this.idpManager.updateIDP(context.db, args.identityProvider, {
|
|
17
17
|
configuration: args.configuration,
|
|
18
|
+
type: (_a = args.type) !== null && _a !== void 0 ? _a : undefined,
|
|
18
19
|
options: {
|
|
19
|
-
autoSignUp: (
|
|
20
|
-
exclusive: (
|
|
20
|
+
autoSignUp: (_c = (_b = args.options) === null || _b === void 0 ? void 0 : _b.autoSignUp) !== null && _c !== void 0 ? _c : undefined,
|
|
21
|
+
exclusive: (_e = (_d = args.options) === null || _d === void 0 ? void 0 : _d.exclusive) !== null && _e !== void 0 ? _e : undefined,
|
|
21
22
|
},
|
|
22
23
|
});
|
|
23
24
|
if (!result.ok) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateIDPMutationResolver.js","sourceRoot":"","sources":["../../../../../src/resolvers/mutation/idp/UpdateIDPMutationResolver.ts"],"names":[],"mappings":";;;AACA,0CAAkD;AAElD,iDAAsD;AAGtD,MAAa,yBAAyB;IACrC,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IACnD,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,MAAW,EAAE,IAA2B,EAAE,OAA8B;;QACvF,MAAM,OAAO,CAAC,aAAa,CAAC;YAC3B,MAAM,EAAE,yBAAiB,CAAC,UAAU;YACpC,OAAO,EAAE,mCAAmC;SAC5C,CAAC,CAAA;QACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,gBAAgB,EAAE;YACjF,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,OAAO,EAAE;gBACR,UAAU,EAAE,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,UAAU,mCAAI,SAAS;gBACjD,SAAS,EAAE,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,SAAS,mCAAI,SAAS;aAC/C;SACD,CAAC,CAAA;QACF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;YACf,OAAO,IAAA,gCAAmB,EAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,CAAA;SAC7D;QAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAA;IACpB,CAAC;CACD;
|
|
1
|
+
{"version":3,"file":"UpdateIDPMutationResolver.js","sourceRoot":"","sources":["../../../../../src/resolvers/mutation/idp/UpdateIDPMutationResolver.ts"],"names":[],"mappings":";;;AACA,0CAAkD;AAElD,iDAAsD;AAGtD,MAAa,yBAAyB;IACrC,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IACnD,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,MAAW,EAAE,IAA2B,EAAE,OAA8B;;QACvF,MAAM,OAAO,CAAC,aAAa,CAAC;YAC3B,MAAM,EAAE,yBAAiB,CAAC,UAAU;YACpC,OAAO,EAAE,mCAAmC;SAC5C,CAAC,CAAA;QACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,gBAAgB,EAAE;YACjF,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,IAAI,EAAE,MAAA,IAAI,CAAC,IAAI,mCAAI,SAAS;YAC5B,OAAO,EAAE;gBACR,UAAU,EAAE,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,UAAU,mCAAI,SAAS;gBACjD,SAAS,EAAE,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,SAAS,mCAAI,SAAS;aAC/C;SACD,CAAC,CAAA;QACF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;YACf,OAAO,IAAA,gCAAmB,EAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,CAAA;SAC7D;QAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAA;IACpB,CAAC;CACD;AAvBD,8DAuBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IDPMutationResolver.d.ts","sourceRoot":"","sources":["../../../../../src/resolvers/mutation/person/IDPMutationResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,qBAAqB,EACrB,yBAAyB,EACzB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"IDPMutationResolver.d.ts","sourceRoot":"","sources":["../../../../../src/resolvers/mutation/person/IDPMutationResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,qBAAqB,EACrB,yBAAyB,EACzB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,gBAAgB,EAAqB,MAAM,gBAAgB,CAAA;AAEpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAEnF,qBAAa,mBAAoB,YAAW,iBAAiB;IAE3D,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,qBAAqB;gBADrB,gBAAgB,EAAE,gBAAgB,EAClC,qBAAqB,EAAE,qBAAqB;IAGxD,aAAa,CAClB,MAAM,EAAE,GAAG,EACX,IAAI,EAAE,yBAAyB,EAC/B,OAAO,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC;IAc3B,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAwBrH"}
|
|
@@ -9,23 +9,30 @@ class IDPMutationResolver {
|
|
|
9
9
|
this.signInResponseFactory = signInResponseFactory;
|
|
10
10
|
}
|
|
11
11
|
async initSignInIDP(parent, args, context) {
|
|
12
|
+
var _a;
|
|
12
13
|
await context.requireAccess({
|
|
13
14
|
action: model_1.PermissionActions.PERSON_CREATE_IDP_URL,
|
|
14
15
|
message: 'You are not allowed to create a redirect URL for IDP',
|
|
15
16
|
});
|
|
16
|
-
const result = await this.idpSignInManager.initSignInIDP(context.db, args.identityProvider, args.
|
|
17
|
+
const result = await this.idpSignInManager.initSignInIDP(context.db, args.identityProvider, (_a = args.data) !== null && _a !== void 0 ? _a : {
|
|
18
|
+
redirectUrl: args.redirectUrl,
|
|
19
|
+
});
|
|
17
20
|
if (!result.ok) {
|
|
18
21
|
return (0, errorUtils_1.createErrorResponse)(result.error, result.errorMessage);
|
|
19
22
|
}
|
|
20
23
|
return { ok: true, errors: [], result: result.result };
|
|
21
24
|
}
|
|
22
25
|
async signInIDP(parent, args, context) {
|
|
23
|
-
var _a;
|
|
26
|
+
var _a, _b, _c;
|
|
24
27
|
await context.requireAccess({
|
|
25
28
|
action: model_1.PermissionActions.PERSON_SIGN_IN_IDP,
|
|
26
29
|
message: 'You are not allowed to person IDP sign in',
|
|
27
30
|
});
|
|
28
|
-
const signIn = await this.idpSignInManager.signInIDP(context.db, args.identityProvider,
|
|
31
|
+
const signIn = await this.idpSignInManager.signInIDP(context.db, args.identityProvider, (_a = args.data) !== null && _a !== void 0 ? _a : {
|
|
32
|
+
sessionData: args.sessionData,
|
|
33
|
+
url: (_b = args.idpResponse) === null || _b === void 0 ? void 0 : _b.url,
|
|
34
|
+
redirectUrl: args.redirectUrl,
|
|
35
|
+
}, (_c = args.expiration) !== null && _c !== void 0 ? _c : undefined);
|
|
29
36
|
if (!signIn.ok) {
|
|
30
37
|
return (0, errorUtils_1.createErrorResponse)(signIn.error, signIn.errorMessage);
|
|
31
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IDPMutationResolver.js","sourceRoot":"","sources":["../../../../../src/resolvers/mutation/person/IDPMutationResolver.ts"],"names":[],"mappings":";;;AAQA,
|
|
1
|
+
{"version":3,"file":"IDPMutationResolver.js","sourceRoot":"","sources":["../../../../../src/resolvers/mutation/person/IDPMutationResolver.ts"],"names":[],"mappings":";;;AAQA,0CAAoE;AACpE,iDAAsD;AAGtD,MAAa,mBAAmB;IAC/B,YACkB,gBAAkC,EAClC,qBAA4C;QAD5C,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,0BAAqB,GAArB,qBAAqB,CAAuB;IAC3D,CAAC;IAEJ,KAAK,CAAC,aAAa,CAClB,MAAW,EACX,IAA+B,EAC/B,OAA8B;;QAE9B,MAAM,OAAO,CAAC,aAAa,CAAC;YAC3B,MAAM,EAAE,yBAAiB,CAAC,qBAAqB;YAC/C,OAAO,EAAE,sDAAsD;SAC/D,CAAC,CAAA;QACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAA,IAAI,CAAC,IAAI,mCAAI;YACxG,WAAW,EAAE,IAAI,CAAC,WAAW;SAC7B,CA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.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ProjectTypeResolver.d.ts","sourceRoot":"","sources":["../../../../src/resolvers/types/ProjectTypeResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,uBAAuB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACxG,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAqB,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAErG,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAGvC,qBAAa,mBAAoB,YAAW,gBAAgB;IAE1D,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,qBAAqB;gBADrB,oBAAoB,EAAE,oBAAoB,EAC1C,qBAAqB,EAAE,qBAAqB;IAGxD,OAAO,CACZ,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,kBAAkB,EACxB,OAAO,EAAE,qBAAqB,GAC5B,OAAO,CAAC,SAAS,uBAAuB,EAAE,CAAC;IAoBxC,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,qBAAqB;;;;;;;;;;;;;;;;;;;CAmB1E"}
|