@budibase/worker 3.8.4 → 3.8.6
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/worker",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "3.8.
|
|
4
|
+
"version": "3.8.6",
|
|
5
5
|
"description": "Budibase background service",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
|
-
"gitHead": "
|
|
123
|
+
"gitHead": "74dd49640111c5d634c8a8417ce4019cdc1a77b0"
|
|
124
124
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as email from "../../../utilities/email"
|
|
2
2
|
import env from "../../../environment"
|
|
3
|
-
import
|
|
3
|
+
import * as auth from "./auth"
|
|
4
4
|
import {
|
|
5
5
|
cache,
|
|
6
6
|
configs,
|
|
@@ -420,20 +420,58 @@ export async function publicSettings(
|
|
|
420
420
|
) {
|
|
421
421
|
try {
|
|
422
422
|
// settings
|
|
423
|
-
const configDoc = await
|
|
423
|
+
const [configDoc, googleConfig] = await Promise.all([
|
|
424
|
+
configs.getSettingsConfigDoc(),
|
|
425
|
+
configs.getGoogleConfig(),
|
|
426
|
+
])
|
|
424
427
|
const config = configDoc.config
|
|
425
428
|
|
|
426
|
-
const
|
|
429
|
+
const brandingPromise = pro.branding.getBrandingConfig(config)
|
|
427
430
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
config.logoUrl
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
431
|
+
const getLogoUrl = () => {
|
|
432
|
+
// enrich the logo url - empty url means deleted
|
|
433
|
+
if (config.logoUrl && config.logoUrl !== "") {
|
|
434
|
+
return objectStore.getGlobalFileUrl(
|
|
435
|
+
"settings",
|
|
436
|
+
"logoUrl",
|
|
437
|
+
config.logoUrlEtag
|
|
438
|
+
)
|
|
439
|
+
}
|
|
435
440
|
}
|
|
436
441
|
|
|
442
|
+
// google
|
|
443
|
+
const googleDatasourcePromise = configs.getGoogleDatasourceConfig()
|
|
444
|
+
const preActivated = googleConfig && googleConfig.activated == null
|
|
445
|
+
const google = preActivated || !!googleConfig?.activated
|
|
446
|
+
const googleCallbackUrlPromise = auth.googleCallbackUrl(googleConfig)
|
|
447
|
+
|
|
448
|
+
// oidc
|
|
449
|
+
const oidcConfigPromise = configs.getOIDCConfig()
|
|
450
|
+
const oidcCallbackUrlPromise = auth.oidcCallbackUrl()
|
|
451
|
+
|
|
452
|
+
// sso enforced
|
|
453
|
+
const isSSOEnforcedPromise = pro.features.isSSOEnforced({ config })
|
|
454
|
+
|
|
455
|
+
// performance all async work at same time, there is no need for all of these
|
|
456
|
+
// operations to occur in sync, slowing the endpoint down significantly
|
|
457
|
+
const [
|
|
458
|
+
branding,
|
|
459
|
+
googleDatasource,
|
|
460
|
+
googleCallbackUrl,
|
|
461
|
+
oidcConfig,
|
|
462
|
+
oidcCallbackUrl,
|
|
463
|
+
isSSOEnforced,
|
|
464
|
+
logoUrl,
|
|
465
|
+
] = await Promise.all([
|
|
466
|
+
brandingPromise,
|
|
467
|
+
googleDatasourcePromise,
|
|
468
|
+
googleCallbackUrlPromise,
|
|
469
|
+
oidcConfigPromise,
|
|
470
|
+
oidcCallbackUrlPromise,
|
|
471
|
+
isSSOEnforcedPromise,
|
|
472
|
+
getLogoUrl(),
|
|
473
|
+
])
|
|
474
|
+
|
|
437
475
|
// enrich the favicon url - empty url means deleted
|
|
438
476
|
const faviconUrl =
|
|
439
477
|
branding.faviconUrl && branding.faviconUrl !== ""
|
|
@@ -444,21 +482,11 @@ export async function publicSettings(
|
|
|
444
482
|
)
|
|
445
483
|
: undefined
|
|
446
484
|
|
|
447
|
-
// google
|
|
448
|
-
const googleConfig = await configs.getGoogleConfig()
|
|
449
|
-
const googleDatasourceConfigured =
|
|
450
|
-
!!(await configs.getGoogleDatasourceConfig())
|
|
451
|
-
const preActivated = googleConfig && googleConfig.activated == null
|
|
452
|
-
const google = preActivated || !!googleConfig?.activated
|
|
453
|
-
const _googleCallbackUrl = await googleCallbackUrl(googleConfig)
|
|
454
|
-
|
|
455
|
-
// oidc
|
|
456
|
-
const oidcConfig = await configs.getOIDCConfig()
|
|
457
485
|
const oidc = oidcConfig?.activated || false
|
|
458
|
-
const
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
486
|
+
const googleDatasourceConfigured = !!googleDatasource
|
|
487
|
+
if (logoUrl) {
|
|
488
|
+
config.logoUrl = logoUrl
|
|
489
|
+
}
|
|
462
490
|
|
|
463
491
|
ctx.body = {
|
|
464
492
|
type: ConfigType.SETTINGS,
|
|
@@ -472,8 +500,8 @@ export async function publicSettings(
|
|
|
472
500
|
googleDatasourceConfigured,
|
|
473
501
|
oidc,
|
|
474
502
|
isSSOEnforced,
|
|
475
|
-
oidcCallbackUrl
|
|
476
|
-
googleCallbackUrl
|
|
503
|
+
oidcCallbackUrl,
|
|
504
|
+
googleCallbackUrl,
|
|
477
505
|
},
|
|
478
506
|
}
|
|
479
507
|
} catch (err: any) {
|