From aedda408919806ada3a8843d3365867da4e993e6 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Fri, 10 Jun 2022 14:04:34 +0100 Subject: [PATCH 1/2] Removed ServiceAccount to reduce confusion --- packages/server/src/integrations/firebase.ts | 30 +++++--------------- packages/server/yarn.lock | 18 ++++++------ packages/worker/yarn.lock | 18 ++++++------ 3 files changed, 25 insertions(+), 41 deletions(-) diff --git a/packages/server/src/integrations/firebase.ts b/packages/server/src/integrations/firebase.ts index b985797b4f..2e539f876a 100644 --- a/packages/server/src/integrations/firebase.ts +++ b/packages/server/src/integrations/firebase.ts @@ -11,7 +11,6 @@ module Firebase { email: string privateKey: string projectId: string - serviceAccount?: string } const SCHEMA: Integration = { @@ -32,10 +31,6 @@ module Firebase { type: DatasourceFieldTypes.STRING, required: true, }, - serviceAccount: { - type: DatasourceFieldTypes.JSON, - required: false, - }, }, query: { create: { @@ -96,24 +91,13 @@ module Firebase { constructor(config: FirebaseConfig) { this.config = config - if (config.serviceAccount) { - const serviceAccount = JSON.parse(config.serviceAccount) - this.client = new Firestore({ - projectId: serviceAccount.project_id, - credentials: { - client_email: serviceAccount.client_email, - private_key: serviceAccount.private_key, - }, - }) - } else { - this.client = new Firestore({ - projectId: config.projectId, - credentials: { - client_email: config.email, - private_key: config.privateKey, - }, - }) - } + this.client = new Firestore({ + projectId: config.projectId, + credentials: { + client_email: config.email, + private_key: config.privateKey, + }, + }) } async create(query: { json: object; extra: { [key: string]: string } }) { diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index cf9f013aa6..775765e4e8 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1014,10 +1014,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.197": - version "1.0.197" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.197.tgz#3458d70c6d44376b7930672d6af8c6e89ddf4069" - integrity sha512-Cgzr1bJWKRg3+jqte7rnKPziWiH5Q+r/piRvHuD7EVmh2+xJLfWUz9iml72aFfcgRIOX8SyhejG7KTwxILx/vg== +"@budibase/backend-core@1.0.198": + version "1.0.198" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.198.tgz#4b9a4dc4dabc73da31b5f95e38c6cfd2c87bfd09" + integrity sha512-IYTY3yuZQ0YVFy4v9zqX0L3ZhFowzY40DgthfbdCbdwHiaoLFpSi0+ynLHxholz3a7eCTcW6M5a3dHqy4kXtIQ== dependencies: "@techpass/passport-openidconnect" "^0.3.0" aws-sdk "^2.901.0" @@ -1092,12 +1092,12 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.0.197": - version "1.0.197" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.197.tgz#a171b46bb8ee6251881ae9262136270533b3958d" - integrity sha512-SCVKjNgpzefmrXnLmkpQJLvYViykyzA6B9TwL7qrb6fBeXwAiSZ3hXGjNgZkVpy/v43hccPWt9BJFzFp457wgQ== +"@budibase/pro@1.0.198": + version "1.0.198" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.198.tgz#b585e269e12317ede722e2b3814329bc63b60185" + integrity sha512-ow3R2MZZKwTsAZQ8knPQsVdzS28frAP5/csj0rW1O53mOsVu6K5LZLJMlZ72cLsLDZPHKtAku7Xgb+b+YWtbvA== dependencies: - "@budibase/backend-core" "1.0.197" + "@budibase/backend-core" "1.0.198" node-fetch "^2.6.1" "@budibase/standard-components@^0.9.139": diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 977725108a..ab3baaf823 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -293,10 +293,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.197": - version "1.0.197" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.197.tgz#3458d70c6d44376b7930672d6af8c6e89ddf4069" - integrity sha512-Cgzr1bJWKRg3+jqte7rnKPziWiH5Q+r/piRvHuD7EVmh2+xJLfWUz9iml72aFfcgRIOX8SyhejG7KTwxILx/vg== +"@budibase/backend-core@1.0.198": + version "1.0.198" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.198.tgz#4b9a4dc4dabc73da31b5f95e38c6cfd2c87bfd09" + integrity sha512-IYTY3yuZQ0YVFy4v9zqX0L3ZhFowzY40DgthfbdCbdwHiaoLFpSi0+ynLHxholz3a7eCTcW6M5a3dHqy4kXtIQ== dependencies: "@techpass/passport-openidconnect" "^0.3.0" aws-sdk "^2.901.0" @@ -322,12 +322,12 @@ uuid "^8.3.2" zlib "^1.0.5" -"@budibase/pro@1.0.197": - version "1.0.197" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.197.tgz#a171b46bb8ee6251881ae9262136270533b3958d" - integrity sha512-SCVKjNgpzefmrXnLmkpQJLvYViykyzA6B9TwL7qrb6fBeXwAiSZ3hXGjNgZkVpy/v43hccPWt9BJFzFp457wgQ== +"@budibase/pro@1.0.198": + version "1.0.198" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.198.tgz#b585e269e12317ede722e2b3814329bc63b60185" + integrity sha512-ow3R2MZZKwTsAZQ8knPQsVdzS28frAP5/csj0rW1O53mOsVu6K5LZLJMlZ72cLsLDZPHKtAku7Xgb+b+YWtbvA== dependencies: - "@budibase/backend-core" "1.0.197" + "@budibase/backend-core" "1.0.198" node-fetch "^2.6.1" "@cspotcode/source-map-consumer@0.8.0": From 86d0d37fd5904026da1ed063d5b3d448eea4c7f8 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Fri, 10 Jun 2022 14:15:25 +0100 Subject: [PATCH 2/2] Fix for privatekey newline --- packages/server/src/integrations/firebase.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/integrations/firebase.ts b/packages/server/src/integrations/firebase.ts index 2e539f876a..e95bda8d46 100644 --- a/packages/server/src/integrations/firebase.ts +++ b/packages/server/src/integrations/firebase.ts @@ -95,7 +95,7 @@ module Firebase { projectId: config.projectId, credentials: { client_email: config.email, - private_key: config.privateKey, + private_key: config.privateKey?.replace(/\\n/g, "\n"), }, }) }