mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 16:28:31 +00:00
* fix: restrict editor-written code in the builder editor and on the editor hostname * fix: simplify builder author code restrictions by hostname * refactor: remove redundant backend custom code hostname checks * refactor: unify builder HTML element rendering restrictions * refactor: clarify builder web frontend hostname terminology * fix: distinguish untrusted builder content in preview notices * refactor: remove unused backend preview security setting * docs: shorten builder code restriction changelog * fix: restrict iframe cookie access across frontend ports * refactor: share web frontend hostname matching * fix: preserve protected HTML interactions and bound iframe height --------- Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com>
33 lines
973 B
JavaScript
33 lines
973 B
JavaScript
import {
|
|
isAuthorCodeRestricted,
|
|
isPreviewAuthorCodeRestricted,
|
|
} from '@baserow/modules/builder/utils/authorCode'
|
|
|
|
/**
|
|
* The one check the editor, Preview and published applications share to decide
|
|
* whether code written by an application's editors is restricted.
|
|
*
|
|
* - `$isAuthorCodeRestricted()`: whether it is restricted on this page,
|
|
* - `$previewRestrictsAuthorCode()`: whether Preview will restrict it, for the
|
|
* editor to tell the user.
|
|
*/
|
|
export default defineNuxtPlugin({
|
|
name: 'builder-author-code',
|
|
dependsOn: ['is-web-frontend-hostname'],
|
|
setup(nuxtApp) {
|
|
const config = useRuntimeConfig()
|
|
|
|
return {
|
|
provide: {
|
|
isAuthorCodeRestricted: () =>
|
|
isAuthorCodeRestricted({
|
|
isWebFrontendHostname: nuxtApp.$isWebFrontendHostname,
|
|
publicConfig: config.public,
|
|
}),
|
|
previewRestrictsAuthorCode: () =>
|
|
isPreviewAuthorCodeRestricted(config.public),
|
|
},
|
|
}
|
|
},
|
|
})
|