Merge branch 'develop' of github.com:Budibase/budibase into fix/BUDI-6754
This commit is contained in:
commit
1aafdbe9a7
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "2.4.44-alpha.9",
|
||||
"version": "2.4.44-alpha.12",
|
||||
"npmClient": "yarn",
|
||||
"packages": ["packages/*"],
|
||||
"command": {
|
||||
|
@ -11,6 +11,9 @@
|
|||
"# We ignore every JSON file, except for built-in-modules, built-ins and plugins defined in babel-preset-env/data.",
|
||||
"@(!(built-in-modules|built-ins|plugins|package)).json"
|
||||
]
|
||||
},
|
||||
"run": {
|
||||
"loadEnvFiles": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/backend-core",
|
||||
"version": "2.4.44-alpha.9",
|
||||
"version": "2.4.44-alpha.12",
|
||||
"description": "Budibase backend core libraries used in server and worker",
|
||||
"main": "dist/src/index.js",
|
||||
"types": "dist/src/index.d.ts",
|
||||
|
@ -24,7 +24,7 @@
|
|||
"dependencies": {
|
||||
"@budibase/nano": "10.1.2",
|
||||
"@budibase/pouchdb-replication-stream": "1.2.10",
|
||||
"@budibase/types": "2.4.44-alpha.9",
|
||||
"@budibase/types": "2.4.44-alpha.12",
|
||||
"@shopify/jest-koa-mocks": "5.0.1",
|
||||
"@techpass/passport-openidconnect": "0.3.2",
|
||||
"aws-cloudfront-sign": "2.2.0",
|
||||
|
|
|
@ -97,3 +97,11 @@ export class InvalidAPIKeyError extends BudibaseError {
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
// USERS
|
||||
|
||||
export class EmailUnavailableError extends Error {
|
||||
constructor(email: string) {
|
||||
super(`Email already in use: '${email}'`)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/bbui",
|
||||
"description": "A UI solution used in the different Budibase projects.",
|
||||
"version": "2.4.44-alpha.9",
|
||||
"version": "2.4.44-alpha.12",
|
||||
"license": "MPL-2.0",
|
||||
"svelte": "src/index.js",
|
||||
"module": "dist/bbui.es.js",
|
||||
|
@ -38,8 +38,8 @@
|
|||
],
|
||||
"dependencies": {
|
||||
"@adobe/spectrum-css-workflow-icons": "1.2.1",
|
||||
"@budibase/shared-core": "2.4.44-alpha.9",
|
||||
"@budibase/string-templates": "2.4.44-alpha.9",
|
||||
"@budibase/shared-core": "2.4.44-alpha.12",
|
||||
"@budibase/string-templates": "2.4.44-alpha.12",
|
||||
"@spectrum-css/accordion": "3.0.24",
|
||||
"@spectrum-css/actionbutton": "1.0.1",
|
||||
"@spectrum-css/actiongroup": "1.0.1",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/builder",
|
||||
"version": "2.4.44-alpha.9",
|
||||
"version": "2.4.44-alpha.12",
|
||||
"license": "GPL-3.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
@ -58,11 +58,11 @@
|
|||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@budibase/bbui": "2.4.44-alpha.9",
|
||||
"@budibase/client": "2.4.44-alpha.9",
|
||||
"@budibase/frontend-core": "2.4.44-alpha.9",
|
||||
"@budibase/shared-core": "2.4.44-alpha.9",
|
||||
"@budibase/string-templates": "2.4.44-alpha.9",
|
||||
"@budibase/bbui": "2.4.44-alpha.12",
|
||||
"@budibase/client": "2.4.44-alpha.12",
|
||||
"@budibase/frontend-core": "2.4.44-alpha.12",
|
||||
"@budibase/shared-core": "2.4.44-alpha.12",
|
||||
"@budibase/string-templates": "2.4.44-alpha.12",
|
||||
"@fortawesome/fontawesome-svg-core": "^6.2.1",
|
||||
"@fortawesome/free-brands-svg-icons": "^6.2.1",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.2.1",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/cli",
|
||||
"version": "2.4.44-alpha.9",
|
||||
"version": "2.4.44-alpha.12",
|
||||
"description": "Budibase CLI, for developers, self hosting and migrations.",
|
||||
"main": "dist/index.js",
|
||||
"bin": {
|
||||
|
@ -29,9 +29,9 @@
|
|||
"outputPath": "build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@budibase/backend-core": "2.4.44-alpha.9",
|
||||
"@budibase/string-templates": "2.4.44-alpha.9",
|
||||
"@budibase/types": "2.4.44-alpha.9",
|
||||
"@budibase/backend-core": "2.4.44-alpha.12",
|
||||
"@budibase/string-templates": "2.4.44-alpha.12",
|
||||
"@budibase/types": "2.4.44-alpha.12",
|
||||
"axios": "0.21.2",
|
||||
"chalk": "4.1.0",
|
||||
"cli-progress": "3.11.2",
|
||||
|
|
|
@ -785,7 +785,7 @@
|
|||
"barStyle": "picker",
|
||||
"options": [
|
||||
{
|
||||
"label": "Extra amall",
|
||||
"label": "Extra small",
|
||||
"value": "XS"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/client",
|
||||
"version": "2.4.44-alpha.9",
|
||||
"version": "2.4.44-alpha.12",
|
||||
"license": "MPL-2.0",
|
||||
"module": "dist/budibase-client.js",
|
||||
"main": "dist/budibase-client.js",
|
||||
|
@ -19,11 +19,11 @@
|
|||
"dev:builder": "rollup -cw"
|
||||
},
|
||||
"dependencies": {
|
||||
"@budibase/bbui": "2.4.44-alpha.9",
|
||||
"@budibase/frontend-core": "2.4.44-alpha.9",
|
||||
"@budibase/shared-core": "2.4.44-alpha.9",
|
||||
"@budibase/string-templates": "2.4.44-alpha.9",
|
||||
"@budibase/types": "2.4.44-alpha.9",
|
||||
"@budibase/bbui": "2.4.44-alpha.12",
|
||||
"@budibase/frontend-core": "2.4.44-alpha.12",
|
||||
"@budibase/shared-core": "2.4.44-alpha.12",
|
||||
"@budibase/string-templates": "2.4.44-alpha.12",
|
||||
"@budibase/types": "2.4.44-alpha.12",
|
||||
"@spectrum-css/button": "^3.0.3",
|
||||
"@spectrum-css/card": "^3.0.3",
|
||||
"@spectrum-css/divider": "^1.0.3",
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
"name": "@budibase/frontend-core",
|
||||
"version": "2.4.44-alpha.9",
|
||||
"version": "2.4.44-alpha.12",
|
||||
"description": "Budibase frontend core libraries used in builder and client",
|
||||
"author": "Budibase",
|
||||
"license": "MPL-2.0",
|
||||
"svelte": "src/index.js",
|
||||
"dependencies": {
|
||||
"@budibase/bbui": "2.4.44-alpha.9",
|
||||
"@budibase/shared-core": "2.4.44-alpha.9",
|
||||
"@budibase/bbui": "2.4.44-alpha.12",
|
||||
"@budibase/shared-core": "2.4.44-alpha.12",
|
||||
"lodash": "^4.17.21",
|
||||
"svelte": "^3.46.2"
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/sdk",
|
||||
"version": "2.4.44-alpha.9",
|
||||
"version": "2.4.44-alpha.12",
|
||||
"description": "Budibase Public API SDK",
|
||||
"author": "Budibase",
|
||||
"license": "MPL-2.0",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/server",
|
||||
"email": "hi@budibase.com",
|
||||
"version": "2.4.44-alpha.9",
|
||||
"version": "2.4.44-alpha.12",
|
||||
"description": "Budibase Web Server",
|
||||
"main": "src/index.ts",
|
||||
"repository": {
|
||||
|
@ -45,12 +45,12 @@
|
|||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@apidevtools/swagger-parser": "10.0.3",
|
||||
"@budibase/backend-core": "2.4.44-alpha.9",
|
||||
"@budibase/client": "2.4.44-alpha.9",
|
||||
"@budibase/pro": "2.4.44-alpha.9",
|
||||
"@budibase/shared-core": "2.4.44-alpha.9",
|
||||
"@budibase/string-templates": "2.4.44-alpha.9",
|
||||
"@budibase/types": "2.4.44-alpha.9",
|
||||
"@budibase/backend-core": "2.4.44-alpha.12",
|
||||
"@budibase/client": "2.4.44-alpha.12",
|
||||
"@budibase/pro": "2.4.44-alpha.12",
|
||||
"@budibase/shared-core": "2.4.44-alpha.12",
|
||||
"@budibase/string-templates": "2.4.44-alpha.12",
|
||||
"@budibase/types": "2.4.44-alpha.12",
|
||||
"@bull-board/api": "3.7.0",
|
||||
"@bull-board/koa": "3.9.4",
|
||||
"@elastic/elasticsearch": "7.10.0",
|
||||
|
|
|
@ -19,11 +19,14 @@ describe("/automations", () => {
|
|||
|
||||
afterAll(setup.afterAll)
|
||||
|
||||
// For some reason this cannot be a beforeAll or the test "tests the automation successfully" fail
|
||||
beforeEach(async () => {
|
||||
beforeAll(async () => {
|
||||
await config.init()
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
events.automation.deleted.mockClear()
|
||||
})
|
||||
|
||||
describe("get definitions", () => {
|
||||
it("returns a list of definitions for actions", async () => {
|
||||
const res = await request
|
||||
|
|
|
@ -1290,14 +1290,14 @@
|
|||
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
||||
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
||||
|
||||
"@budibase/backend-core@2.4.44-alpha.9":
|
||||
version "2.4.44-alpha.9"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.44-alpha.9.tgz#ea2f1ec39fe0a97172b00e551f9e3b51f860e53b"
|
||||
integrity sha512-uuZEqeyXnVwyNDPSwI8gF8zCv26PWvhbLoEYXMQqNl9J9q5g4i/lNacfKs1x9JDPABHE93mtLL5eoTogzrqTIg==
|
||||
"@budibase/backend-core@2.4.44-alpha.12":
|
||||
version "2.4.44-alpha.12"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.44-alpha.12.tgz#ac5617e6ccb844252fb998ea8daac2d635fe9b95"
|
||||
integrity sha512-KB7WzDNYqdV3XEII4qyER6BXkkKPBA9UBZ+9QOHUsJgdDWyJjZQUXho5T4DOdFUNCsNrZ0MCMOZWNBG6W5bTXg==
|
||||
dependencies:
|
||||
"@budibase/nano" "10.1.2"
|
||||
"@budibase/pouchdb-replication-stream" "1.2.10"
|
||||
"@budibase/types" "2.4.44-alpha.9"
|
||||
"@budibase/types" "2.4.44-alpha.12"
|
||||
"@shopify/jest-koa-mocks" "5.0.1"
|
||||
"@techpass/passport-openidconnect" "0.3.2"
|
||||
aws-cloudfront-sign "2.2.0"
|
||||
|
@ -1430,15 +1430,15 @@
|
|||
pouchdb-promise "^6.0.4"
|
||||
through2 "^2.0.0"
|
||||
|
||||
"@budibase/pro@2.4.44-alpha.9":
|
||||
version "2.4.44-alpha.9"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.44-alpha.9.tgz#f6a5bcfb607ebb2138762e53a04ad55cf6de6014"
|
||||
integrity sha512-cPUXlt9XQ0DlwoR47wLiLGEQlib6vKW15cLkh0pkz57vHbr5T22Ix4G7vgKGPVr5kpaJVNVdYLxBZ3qy8hUnJQ==
|
||||
"@budibase/pro@2.4.44-alpha.12":
|
||||
version "2.4.44-alpha.12"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.44-alpha.12.tgz#964c0f0fd0b9c2e7cfbb1a39a455d84ea6c927ba"
|
||||
integrity sha512-C1VXMKGvdzu55rVbTad1SE37EXPA36OWzFQ1IC6YEl4cs7bR6x7e8yXmn2LBH7uk8qArmjMrYJPKSmIlSHYfcA==
|
||||
dependencies:
|
||||
"@budibase/backend-core" "2.4.44-alpha.9"
|
||||
"@budibase/backend-core" "2.4.44-alpha.12"
|
||||
"@budibase/shared-core" "2.4.44-alpha.1"
|
||||
"@budibase/string-templates" "2.4.44-alpha.1"
|
||||
"@budibase/types" "2.4.44-alpha.9"
|
||||
"@budibase/types" "2.4.44-alpha.12"
|
||||
"@koa/router" "8.0.8"
|
||||
bull "4.10.1"
|
||||
joi "17.6.0"
|
||||
|
@ -1491,10 +1491,10 @@
|
|||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.44-alpha.1.tgz#1679657aa180d9c59afa1dffa611bff0638bd933"
|
||||
integrity sha512-Sq+8HfM75EBMoOvKYFwELdlxmVN6wNZMofDjT/2G+9aF+Zfe5Tzw69C+unmdBgcGGjGCHEYWSz4mF0v8FPAGbg==
|
||||
|
||||
"@budibase/types@2.4.44-alpha.9":
|
||||
version "2.4.44-alpha.9"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.44-alpha.9.tgz#a64fad8252f196bcb2a5fbd53f89ff5a90745813"
|
||||
integrity sha512-auXyD1A1MZ42KYMaQpnHBgXbR3O3t6oycYESwhbkIaTHw3f9ir3m8Sus5R1eMI7YqI8nWjB6y9tW6lZoIAd/Pg==
|
||||
"@budibase/types@2.4.44-alpha.12":
|
||||
version "2.4.44-alpha.12"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.44-alpha.12.tgz#cb7ad803f81ae2fd57412ef744b7dc953227b755"
|
||||
integrity sha512-BJz4HtMVxnRJ+PJdgkJkRiL9FVMZPMx5ReikWalJPb2cYrceNsyZy04avuedIBCnS5S+6HXhGi7Hezlnm4unQQ==
|
||||
dependencies:
|
||||
scim-patch "^0.7.0"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/shared-core",
|
||||
"version": "2.4.44-alpha.9",
|
||||
"version": "2.4.44-alpha.12",
|
||||
"description": "Shared data utils",
|
||||
"main": "dist/cjs/src/index.js",
|
||||
"types": "dist/mjs/src/index.d.ts",
|
||||
|
@ -20,7 +20,7 @@
|
|||
"dev:builder": "yarn prebuild && concurrently \"tsc -p tsconfig.build.json --watch\" \"tsc -p tsconfig-cjs.build.json --watch\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@budibase/types": "2.4.44-alpha.9"
|
||||
"@budibase/types": "2.4.44-alpha.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"concurrently": "^7.6.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/string-templates",
|
||||
"version": "2.4.44-alpha.9",
|
||||
"version": "2.4.44-alpha.12",
|
||||
"description": "Handlebars wrapper for Budibase templating.",
|
||||
"main": "src/index.cjs",
|
||||
"module": "dist/bundle.mjs",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/types",
|
||||
"version": "2.4.44-alpha.9",
|
||||
"version": "2.4.44-alpha.12",
|
||||
"description": "Budibase types",
|
||||
"main": "dist/cjs/index.js",
|
||||
"types": "dist/mjs/index.d.ts",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/worker",
|
||||
"email": "hi@budibase.com",
|
||||
"version": "2.4.44-alpha.9",
|
||||
"version": "2.4.44-alpha.12",
|
||||
"description": "Budibase background service",
|
||||
"main": "src/index.ts",
|
||||
"repository": {
|
||||
|
@ -37,10 +37,10 @@
|
|||
"author": "Budibase",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@budibase/backend-core": "2.4.44-alpha.9",
|
||||
"@budibase/pro": "2.4.44-alpha.9",
|
||||
"@budibase/string-templates": "2.4.44-alpha.9",
|
||||
"@budibase/types": "2.4.44-alpha.9",
|
||||
"@budibase/backend-core": "2.4.44-alpha.12",
|
||||
"@budibase/pro": "2.4.44-alpha.12",
|
||||
"@budibase/string-templates": "2.4.44-alpha.12",
|
||||
"@budibase/types": "2.4.44-alpha.12",
|
||||
"@koa/router": "8.0.8",
|
||||
"@sentry/node": "6.17.7",
|
||||
"@techpass/passport-openidconnect": "0.3.2",
|
||||
|
|
|
@ -318,6 +318,15 @@ describe("scim", () => {
|
|||
await postScimUser({ body }, { expect: 500 })
|
||||
})
|
||||
})
|
||||
|
||||
it("creating an existing user name returns a conflict", async () => {
|
||||
const body = structures.scim.createUserRequest()
|
||||
|
||||
await postScimUser({ body })
|
||||
|
||||
const res = await postScimUser({ body }, { expect: 409 })
|
||||
expect((res as any).message).toBe("Email already in use")
|
||||
})
|
||||
})
|
||||
|
||||
describe("GET /api/global/scim/v2/users/:id", () => {
|
||||
|
@ -399,53 +408,19 @@ describe("scim", () => {
|
|||
})
|
||||
|
||||
it.each([false, "false", "False"])(
|
||||
"can deactive an active user (sending %s)",
|
||||
"deactivating an active user (sending %s) will delete it",
|
||||
async activeValue => {
|
||||
const body: ScimUpdateRequest = {
|
||||
schemas: ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
|
||||
Operations: [{ op: "Replace", path: "active", value: activeValue }],
|
||||
}
|
||||
|
||||
const response = await patchScimUser({ id: user.id, body })
|
||||
await patchScimUser(
|
||||
{ id: user.id, body },
|
||||
{ expect: 204, skipContentTypeCheck: true }
|
||||
)
|
||||
|
||||
const expectedScimUser: ScimUserResponse = {
|
||||
...user,
|
||||
active: false,
|
||||
}
|
||||
expect(response).toEqual(expectedScimUser)
|
||||
|
||||
const persistedUser = await config.api.scimUsersAPI.find(user.id)
|
||||
expect(persistedUser).toEqual(expectedScimUser)
|
||||
}
|
||||
)
|
||||
|
||||
it.each([true, "true", "True"])(
|
||||
"can activate an inactive user (sending %s)",
|
||||
async activeValue => {
|
||||
// Deactivate user
|
||||
await patchScimUser({
|
||||
id: user.id,
|
||||
body: {
|
||||
schemas: ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
|
||||
Operations: [{ op: "Replace", path: "active", value: true }],
|
||||
},
|
||||
})
|
||||
|
||||
const body: ScimUpdateRequest = {
|
||||
schemas: ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
|
||||
Operations: [{ op: "Replace", path: "active", value: activeValue }],
|
||||
}
|
||||
|
||||
const response = await patchScimUser({ id: user.id, body })
|
||||
|
||||
const expectedScimUser: ScimUserResponse = {
|
||||
...user,
|
||||
active: true,
|
||||
}
|
||||
expect(response).toEqual(expectedScimUser)
|
||||
|
||||
const persistedUser = await config.api.scimUsersAPI.find(user.id)
|
||||
expect(persistedUser).toEqual(expectedScimUser)
|
||||
await config.api.scimUsersAPI.find(user.id, { expect: 404 })
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ describe("/api/global/users", () => {
|
|||
400
|
||||
)
|
||||
|
||||
expect(res.body.message).toBe("Unavailable")
|
||||
expect(res.body.message).toBe(`Unavailable`)
|
||||
expect(sendMailMock).toHaveBeenCalledTimes(0)
|
||||
expect(code).toBeUndefined()
|
||||
expect(events.user.invited).toBeCalledTimes(0)
|
||||
|
@ -225,7 +225,9 @@ describe("/api/global/users", () => {
|
|||
|
||||
const response = await config.api.users.saveUser(user, 400)
|
||||
|
||||
expect(response.body.message).toBe(`Unavailable`)
|
||||
expect(response.body.message).toBe(
|
||||
`Email already in use: '${user.email}'`
|
||||
)
|
||||
expect(events.user.created).toBeCalledTimes(0)
|
||||
})
|
||||
|
||||
|
@ -237,7 +239,9 @@ describe("/api/global/users", () => {
|
|||
delete user._id
|
||||
const response = await config.api.users.saveUser(user, 400)
|
||||
|
||||
expect(response.body.message).toBe(`Unavailable`)
|
||||
expect(response.body.message).toBe(
|
||||
`Email already in use: '${user.email}'`
|
||||
)
|
||||
expect(events.user.created).toBeCalledTimes(0)
|
||||
})
|
||||
})
|
||||
|
@ -249,7 +253,9 @@ describe("/api/global/users", () => {
|
|||
|
||||
const response = await config.api.users.saveUser(user, 400)
|
||||
|
||||
expect(response.body.message).toBe(`Unavailable`)
|
||||
expect(response.body.message).toBe(
|
||||
`Email already in use: '${user.email}'`
|
||||
)
|
||||
expect(events.user.created).toBeCalledTimes(0)
|
||||
})
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ import {
|
|||
ViewName,
|
||||
env as coreEnv,
|
||||
context,
|
||||
EmailUnavailableError,
|
||||
} from "@budibase/backend-core"
|
||||
import {
|
||||
AccountMetadata,
|
||||
|
@ -156,7 +157,7 @@ const validateUniqueUser = async (email: string, tenantId: string) => {
|
|||
if (env.MULTI_TENANCY) {
|
||||
const tenantUser = await getPlatformUser(email)
|
||||
if (tenantUser != null && tenantUser.tenantId !== tenantId) {
|
||||
throw `Unavailable`
|
||||
throw new EmailUnavailableError(email)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -164,7 +165,7 @@ const validateUniqueUser = async (email: string, tenantId: string) => {
|
|||
if (!env.SELF_HOSTED && !env.DISABLE_ACCOUNT_PORTAL) {
|
||||
const account = await accounts.getAccount(email)
|
||||
if (account && account.verified && account.tenantId !== tenantId) {
|
||||
throw `Unavailable`
|
||||
throw new EmailUnavailableError(email)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -233,7 +234,7 @@ export const save = async (
|
|||
// no id was specified - load from email instead
|
||||
dbUser = await usersCore.getGlobalUserByEmail(email)
|
||||
if (dbUser && dbUser._id !== _id) {
|
||||
throw `Unavailable`
|
||||
throw new EmailUnavailableError(email)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import { TestAPI } from "../base"
|
|||
const defaultConfig = {
|
||||
expect: 200,
|
||||
setHeaders: true,
|
||||
skipContentTypeCheck: false,
|
||||
}
|
||||
|
||||
export type RequestSettings = typeof defaultConfig
|
||||
|
@ -27,7 +28,7 @@ export abstract class ScimTestAPI extends TestAPI {
|
|||
"application/scim+json; charset=utf-8"
|
||||
)
|
||||
|
||||
if (method !== "delete") {
|
||||
if (method !== "delete" && !requestSettings?.skipContentTypeCheck) {
|
||||
request = request.expect("Content-Type", /json/)
|
||||
}
|
||||
|
||||
|
|
|
@ -475,14 +475,14 @@
|
|||
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
||||
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
||||
|
||||
"@budibase/backend-core@2.4.44-alpha.9":
|
||||
version "2.4.44-alpha.9"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.44-alpha.9.tgz#ea2f1ec39fe0a97172b00e551f9e3b51f860e53b"
|
||||
integrity sha512-uuZEqeyXnVwyNDPSwI8gF8zCv26PWvhbLoEYXMQqNl9J9q5g4i/lNacfKs1x9JDPABHE93mtLL5eoTogzrqTIg==
|
||||
"@budibase/backend-core@2.4.44-alpha.12":
|
||||
version "2.4.44-alpha.12"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.4.44-alpha.12.tgz#ac5617e6ccb844252fb998ea8daac2d635fe9b95"
|
||||
integrity sha512-KB7WzDNYqdV3XEII4qyER6BXkkKPBA9UBZ+9QOHUsJgdDWyJjZQUXho5T4DOdFUNCsNrZ0MCMOZWNBG6W5bTXg==
|
||||
dependencies:
|
||||
"@budibase/nano" "10.1.2"
|
||||
"@budibase/pouchdb-replication-stream" "1.2.10"
|
||||
"@budibase/types" "2.4.44-alpha.9"
|
||||
"@budibase/types" "2.4.44-alpha.12"
|
||||
"@shopify/jest-koa-mocks" "5.0.1"
|
||||
"@techpass/passport-openidconnect" "0.3.2"
|
||||
aws-cloudfront-sign "2.2.0"
|
||||
|
@ -565,15 +565,15 @@
|
|||
pouchdb-promise "^6.0.4"
|
||||
through2 "^2.0.0"
|
||||
|
||||
"@budibase/pro@2.4.44-alpha.9":
|
||||
version "2.4.44-alpha.9"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.44-alpha.9.tgz#f6a5bcfb607ebb2138762e53a04ad55cf6de6014"
|
||||
integrity sha512-cPUXlt9XQ0DlwoR47wLiLGEQlib6vKW15cLkh0pkz57vHbr5T22Ix4G7vgKGPVr5kpaJVNVdYLxBZ3qy8hUnJQ==
|
||||
"@budibase/pro@2.4.44-alpha.12":
|
||||
version "2.4.44-alpha.12"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.4.44-alpha.12.tgz#964c0f0fd0b9c2e7cfbb1a39a455d84ea6c927ba"
|
||||
integrity sha512-C1VXMKGvdzu55rVbTad1SE37EXPA36OWzFQ1IC6YEl4cs7bR6x7e8yXmn2LBH7uk8qArmjMrYJPKSmIlSHYfcA==
|
||||
dependencies:
|
||||
"@budibase/backend-core" "2.4.44-alpha.9"
|
||||
"@budibase/backend-core" "2.4.44-alpha.12"
|
||||
"@budibase/shared-core" "2.4.44-alpha.1"
|
||||
"@budibase/string-templates" "2.4.44-alpha.1"
|
||||
"@budibase/types" "2.4.44-alpha.9"
|
||||
"@budibase/types" "2.4.44-alpha.12"
|
||||
"@koa/router" "8.0.8"
|
||||
bull "4.10.1"
|
||||
joi "17.6.0"
|
||||
|
@ -608,10 +608,10 @@
|
|||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.44-alpha.1.tgz#1679657aa180d9c59afa1dffa611bff0638bd933"
|
||||
integrity sha512-Sq+8HfM75EBMoOvKYFwELdlxmVN6wNZMofDjT/2G+9aF+Zfe5Tzw69C+unmdBgcGGjGCHEYWSz4mF0v8FPAGbg==
|
||||
|
||||
"@budibase/types@2.4.44-alpha.9":
|
||||
version "2.4.44-alpha.9"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.44-alpha.9.tgz#a64fad8252f196bcb2a5fbd53f89ff5a90745813"
|
||||
integrity sha512-auXyD1A1MZ42KYMaQpnHBgXbR3O3t6oycYESwhbkIaTHw3f9ir3m8Sus5R1eMI7YqI8nWjB6y9tW6lZoIAd/Pg==
|
||||
"@budibase/types@2.4.44-alpha.12":
|
||||
version "2.4.44-alpha.12"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.4.44-alpha.12.tgz#cb7ad803f81ae2fd57412ef744b7dc953227b755"
|
||||
integrity sha512-BJz4HtMVxnRJ+PJdgkJkRiL9FVMZPMx5ReikWalJPb2cYrceNsyZy04avuedIBCnS5S+6HXhGi7Hezlnm4unQQ==
|
||||
dependencies:
|
||||
scim-patch "^0.7.0"
|
||||
|
||||
|
|
Loading…
Reference in New Issue