Answer the question
In order to leave comments, you need to log in
How to isolate(sandbox) part of an application in nodejs?
Hello, I decided to start a pet project for learning and entertainment, something like cms.
For development, I decided to take nodejs and vue
. The task was to somehow isolate untrusted code from clients from trusted code.
For example
<template>
<component :is="component" v-for="component in page" />
</template>
<script>
export default {
async serverPrefetch() {
//Получаем список компонентов для страницы
const data = axois.get('/page/' + this.userId)
//Возвращаем компоненты, загружая их из папки пользователя
this.page = data.map(component => {
return () => import('~/UNTRUSTED_CODE/'+ this.userId +'/components/' + component + '.vue')
})
},
}
</script>
Answer the question
In order to leave comments, you need to log in
Is it possible to somehow isolate such code from the main application?
That is, when reading files, only the folder of this user would be read.
So that the user cannot read other sources, for example, the code above.
So that when memory overflows or endless recursion does not fall, the entire application would not fall.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question